Commit 3fa3bcb7 by Ben Clayton

Build: Silence all Clang + SubZero warnings.

Most of these come from LLVM 3. I'd normally try hard to silence these warnings without modifying 3rd party code, but I indend to delete this dependency in the very near future. Bug: b/130343040 Change-Id: Icf6003c58ad118989240d64cf480aa1e2e639fb7 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29088 Presubmit-Ready: Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent a0c2bc4c
...@@ -292,6 +292,7 @@ else() ...@@ -292,6 +292,7 @@ else()
set_cpp_flag("-Wno-unneeded-internal-declaration") # function 'X' is not needed and will not be emitted set_cpp_flag("-Wno-unneeded-internal-declaration") # function 'X' is not needed and will not be emitted
set_cpp_flag("-Wno-unused-private-field") # private field 'offset' is not used - TODO: Consider enabling this once Vulkan is further implemented. set_cpp_flag("-Wno-unused-private-field") # private field 'offset' is not used - TODO: Consider enabling this once Vulkan is further implemented.
set_cpp_flag("-Wno-comment") # multi-line comment set_cpp_flag("-Wno-comment") # multi-line comment
set_cpp_flag("-Wno-undefined-var-template") # instantiation of variable 'X' required here, but no definition is available
endif() endif()
# For distribution it is more important to be slim than super optimized # For distribution it is more important to be slim than super optimized
......
...@@ -294,7 +294,6 @@ public: ...@@ -294,7 +294,6 @@ public:
// Loop over the predecessors of the header node... // Loop over the predecessors of the header node...
BlockT *Header = getHeader(); BlockT *Header = getHeader();
typedef GraphTraits<BlockT*> BlockTraits;
typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
for (typename InvBlockTraits::ChildIteratorType PI = for (typename InvBlockTraits::ChildIteratorType PI =
InvBlockTraits::child_begin(Header), InvBlockTraits::child_begin(Header),
...@@ -828,10 +827,10 @@ public: ...@@ -828,10 +827,10 @@ public:
typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
// Add all of the predecessors of X to the end of the work stack... // Add all of the predecessors of X to the end of the work stack...
for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(X), PE = InvBlockTraits::child_end(X); PI != PE; ++PI) { for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(X), PE = InvBlockTraits::child_end(X); PI != PE; ++PI) {
typename InvBlockTraits::NodeType *N = *PI; typename InvBlockTraits::NodeType *N = *PI;
TodoStack.push_back(N); TodoStack.push_back(N);
} }
} }
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
namespace llvm { namespace llvm {
class ValueSymbolTable; class ValueSymbolTable;
template<typename NodeTy> class ilist_iterator; template<typename NodeTy> class ilist_iterator;
template<typename NodeTy, typename Traits> class iplist; template<typename NodeTy, typename Traits> class iplist;
template<typename Ty> struct ilist_traits; template<typename Ty> struct ilist_traits;
...@@ -46,7 +46,6 @@ public: ...@@ -46,7 +46,6 @@ public:
/// getListOwner - Return the object that owns this list. If this is a list /// getListOwner - Return the object that owns this list. If this is a list
/// of instructions, it returns the BasicBlock that owns them. /// of instructions, it returns the BasicBlock that owns them.
ItemParentClass *getListOwner() { ItemParentClass *getListOwner() {
typedef iplist<ValueSubClass> ItemParentClass::*Sublist;
size_t Offset(size_t(&((ItemParentClass*)0->*ItemParentClass:: size_t Offset(size_t(&((ItemParentClass*)0->*ItemParentClass::
getSublistAccess(static_cast<ValueSubClass*>(0))))); getSublistAccess(static_cast<ValueSubClass*>(0)))));
iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this)); iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this));
......
...@@ -265,13 +265,6 @@ MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI, ...@@ -265,13 +265,6 @@ MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI,
TheModule = 0; TheModule = 0;
} }
MachineModuleInfo::MachineModuleInfo()
: ImmutablePass(ID),
Context(*(MCAsmInfo*)0, *(MCRegisterInfo*)0, (MCObjectFileInfo*)0) {
assert(0 && "This MachineModuleInfo constructor should never be called, MMI "
"should always be explicitly constructed by LLVMTargetMachine");
abort();
}
MachineModuleInfo::~MachineModuleInfo() { MachineModuleInfo::~MachineModuleInfo() {
delete ObjFileMMI; delete ObjFileMMI;
......
...@@ -1441,7 +1441,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { ...@@ -1441,7 +1441,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
&LoadChains[0], LoadChains.size()); &LoadChains[0], LoadChains.size());
EVT TempWideVector = EVT::getVectorVT(*DAG.getContext(), EVT TempWideVector = EVT::getVectorVT(*DAG.getContext(),
SrcVT.getScalarType(), NumElem*SizeRatio); SrcVT.getScalarType(), NumElem*SizeRatio);
SDValue ValRes = DAG.getNode(ISD::BUILD_VECTOR, dl, SDValue ValRes = DAG.getNode(ISD::BUILD_VECTOR, dl,
TempWideVector, &LoadVals[0], LoadVals.size()); TempWideVector, &LoadVals[0], LoadVals.size());
// Cast to the correct type // Cast to the correct type
...@@ -1629,7 +1629,6 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { ...@@ -1629,7 +1629,6 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
break; break;
case TargetLowering::Expand: case TargetLowering::Expand:
EVT WideScalarVT = Tmp3.getValueType().getScalarType();
EVT NarrowScalarVT = StVT.getScalarType(); EVT NarrowScalarVT = StVT.getScalarType();
if (StVT.isVector()) { if (StVT.isVector()) {
...@@ -1649,7 +1648,6 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { ...@@ -1649,7 +1648,6 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
if (RegScalarLegal) { if (RegScalarLegal) {
// Cast floats into integers // Cast floats into integers
unsigned ScalarSize = MemSclVT.getSizeInBits(); unsigned ScalarSize = MemSclVT.getSizeInBits();
EVT EltVT = EVT::getIntegerVT(*DAG.getContext(), ScalarSize);
// Round odd types to the next pow of two. // Round odd types to the next pow of two.
if (!isPowerOf2_32(ScalarSize)) if (!isPowerOf2_32(ScalarSize))
......
...@@ -191,17 +191,6 @@ static inline void write_uint32_le(void *Data, uint32_t const &Value) { ...@@ -191,17 +191,6 @@ static inline void write_uint32_le(void *Data, uint32_t const &Value) {
Ptr[3] = (Value & 0xFF000000) >> 24; Ptr[3] = (Value & 0xFF000000) >> 24;
} }
static inline void write_uint16_le(void *Data, uint16_t const &Value) {
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Data);
Ptr[0] = (Value & 0x00FF) >> 0;
Ptr[1] = (Value & 0xFF00) >> 8;
}
static inline void write_uint8_le(void *Data, uint8_t const &Value) {
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Data);
Ptr[0] = (Value & 0xFF) >> 0;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Symbol class implementation // Symbol class implementation
......
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
static sys::Mutex gCrashRecoveryContexMutex; static sys::Mutex gCrashRecoveryContexMutex;
static bool gCrashRecoveryEnabled = false; static bool gCrashRecoveryEnabled = false;
static sys::ThreadLocal<const CrashRecoveryContextCleanup> static sys::ThreadLocal<const CrashRecoveryContextCleanup>
tlIsRecoveringFromCrash; tlIsRecoveringFromCrash;
CrashRecoveryContextCleanup::~CrashRecoveryContextCleanup() {} CrashRecoveryContextCleanup::~CrashRecoveryContextCleanup() {}
...@@ -75,7 +75,7 @@ CrashRecoveryContext::~CrashRecoveryContext() { ...@@ -75,7 +75,7 @@ CrashRecoveryContext::~CrashRecoveryContext() {
delete tmp; delete tmp;
} }
tlIsRecoveringFromCrash.erase(); tlIsRecoveringFromCrash.erase();
CrashRecoveryContextImpl *CRCI = (CrashRecoveryContextImpl *) Impl; CrashRecoveryContextImpl *CRCI = (CrashRecoveryContextImpl *) Impl;
delete CRCI; delete CRCI;
} }
...@@ -224,10 +224,10 @@ void CrashRecoveryContext::Disable() { ...@@ -224,10 +224,10 @@ void CrashRecoveryContext::Disable() {
#include <signal.h> #include <signal.h>
#ifdef ENABLE_SIGNAL_OVERRIDES
static int Signals[] = { SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP }; static int Signals[] = { SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP };
static const unsigned NumSignals = sizeof(Signals) / sizeof(Signals[0]); static const unsigned NumSignals = sizeof(Signals) / sizeof(Signals[0]);
static struct sigaction PrevActions[NumSignals]; static struct sigaction PrevActions[NumSignals];
static void CrashRecoverySignalHandler(int Signal) { static void CrashRecoverySignalHandler(int Signal) {
// Lookup the current thread local recovery object. // Lookup the current thread local recovery object.
const CrashRecoveryContextImpl *CRCI = CurrentContext.get(); const CrashRecoveryContextImpl *CRCI = CurrentContext.get();
...@@ -259,6 +259,7 @@ static void CrashRecoverySignalHandler(int Signal) { ...@@ -259,6 +259,7 @@ static void CrashRecoverySignalHandler(int Signal) {
if (CRCI) if (CRCI)
const_cast<CrashRecoveryContextImpl*>(CRCI)->HandleCrash(); const_cast<CrashRecoveryContextImpl*>(CRCI)->HandleCrash();
} }
#endif // ENABLE_SIGNAL_OVERRIDES
void CrashRecoveryContext::Enable() { void CrashRecoveryContext::Enable() {
sys::ScopedLock L(gCrashRecoveryContexMutex); sys::ScopedLock L(gCrashRecoveryContexMutex);
......
...@@ -149,8 +149,10 @@ static bool RedirectIO_PS(const Path *Path, int FD, std::string *ErrMsg, ...@@ -149,8 +149,10 @@ static bool RedirectIO_PS(const Path *Path, int FD, std::string *ErrMsg,
} }
#endif #endif
#ifdef ENABLE_SIGNAL_OVERRIDES
static void TimeOutHandler(int Sig) { static void TimeOutHandler(int Sig) {
} }
#endif
static void SetMemoryLimits (unsigned size) static void SetMemoryLimits (unsigned size)
{ {
...@@ -302,6 +304,7 @@ Program::Wait(const sys::Path &path, ...@@ -302,6 +304,7 @@ Program::Wait(const sys::Path &path,
{ {
#ifdef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H
struct sigaction Act, Old; struct sigaction Act, Old;
(void)Act; (void)Old;
if (Data_ == 0) { if (Data_ == 0) {
MakeErrMsg(ErrMsg, "Process not started!"); MakeErrMsg(ErrMsg, "Process not started!");
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
#endif #endif
using namespace llvm; using namespace llvm;
#ifdef ENABLE_SIGNAL_OVERRIDES
static RETSIGTYPE SignalHandler(int Sig); // defined below. static RETSIGTYPE SignalHandler(int Sig); // defined below.
#endif // ENABLE_SIGNAL_OVERRIDES
static SmartMutex<true> SignalsMutex; static SmartMutex<true> SignalsMutex;
...@@ -76,6 +78,7 @@ static struct { ...@@ -76,6 +78,7 @@ static struct {
} RegisteredSignalInfo[(sizeof(IntSigs)+sizeof(KillSigs))/sizeof(KillSigs[0])]; } RegisteredSignalInfo[(sizeof(IntSigs)+sizeof(KillSigs))/sizeof(KillSigs[0])];
#ifdef ENABLE_SIGNAL_OVERRIDES
static void RegisterHandler(int Signal) { static void RegisterHandler(int Signal) {
assert(NumRegisteredSignals < assert(NumRegisteredSignals <
sizeof(RegisteredSignalInfo)/sizeof(RegisteredSignalInfo[0]) && sizeof(RegisteredSignalInfo)/sizeof(RegisteredSignalInfo[0]) &&
...@@ -93,6 +96,7 @@ static void RegisterHandler(int Signal) { ...@@ -93,6 +96,7 @@ static void RegisterHandler(int Signal) {
RegisteredSignalInfo[NumRegisteredSignals].SigNo = Signal; RegisteredSignalInfo[NumRegisteredSignals].SigNo = Signal;
++NumRegisteredSignals; ++NumRegisteredSignals;
} }
#endif // ENABLE_SIGNAL_OVERRIDES
static void RegisterHandlers() { static void RegisterHandlers() {
#ifdef ENABLE_SIGNAL_OVERRIDES #ifdef ENABLE_SIGNAL_OVERRIDES
...@@ -104,6 +108,7 @@ static void RegisterHandlers() { ...@@ -104,6 +108,7 @@ static void RegisterHandlers() {
#endif #endif
} }
#ifdef ENABLE_SIGNAL_OVERRIDES
static void UnregisterHandlers() { static void UnregisterHandlers() {
// Restore all of the signal handlers to how they were before we showed up. // Restore all of the signal handlers to how they were before we showed up.
for (unsigned i = 0, e = NumRegisteredSignals; i != e; ++i) for (unsigned i = 0, e = NumRegisteredSignals; i != e; ++i)
...@@ -111,6 +116,7 @@ static void UnregisterHandlers() { ...@@ -111,6 +116,7 @@ static void UnregisterHandlers() {
&RegisteredSignalInfo[i].SA, 0); &RegisteredSignalInfo[i].SA, 0);
NumRegisteredSignals = 0; NumRegisteredSignals = 0;
} }
#endif // ENABLE_SIGNAL_OVERRIDES
/// RemoveFilesToRemove - Process the FilesToRemove list. This function /// RemoveFilesToRemove - Process the FilesToRemove list. This function
...@@ -122,6 +128,7 @@ static void RemoveFilesToRemove() { ...@@ -122,6 +128,7 @@ static void RemoveFilesToRemove() {
} }
} }
#ifdef ENABLE_SIGNAL_OVERRIDES
// SignalHandler - The signal handler that runs. // SignalHandler - The signal handler that runs.
static RETSIGTYPE SignalHandler(int Sig) { static RETSIGTYPE SignalHandler(int Sig) {
// Restore the signal behavior to default, so that the program actually // Restore the signal behavior to default, so that the program actually
...@@ -158,6 +165,7 @@ static RETSIGTYPE SignalHandler(int Sig) { ...@@ -158,6 +165,7 @@ static RETSIGTYPE SignalHandler(int Sig) {
for (unsigned i = 0, e = CallBacksToRun.size(); i != e; ++i) for (unsigned i = 0, e = CallBacksToRun.size(); i != e; ++i)
CallBacksToRun[i].first(CallBacksToRun[i].second); CallBacksToRun[i].first(CallBacksToRun[i].second);
} }
#endif // ENABLE_SIGNAL_OVERRIDES
void llvm::sys::RunInterruptHandlers() { void llvm::sys::RunInterruptHandlers() {
SignalsMutex.acquire(); SignalsMutex.acquire();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment