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),
......
...@@ -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;
......
...@@ -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
......
...@@ -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();
......
...@@ -608,7 +608,6 @@ namespace llvm { ...@@ -608,7 +608,6 @@ namespace llvm {
struct isPodLike<LoweredPHIRecord> { static const bool value = true; }; struct isPodLike<LoweredPHIRecord> { static const bool value = true; };
} }
/// SliceUpIllegalIntegerPHI - This is an integer PHI and we know that it has an /// SliceUpIllegalIntegerPHI - This is an integer PHI and we know that it has an
/// illegal type: see if it is only used by trunc or trunc(lshr) operations. If /// illegal type: see if it is only used by trunc or trunc(lshr) operations. If
/// so, we split the PHI into the various pieces being extracted. This sort of /// so, we split the PHI into the various pieces being extracted. This sort of
...@@ -618,6 +617,11 @@ namespace llvm { ...@@ -618,6 +617,11 @@ namespace llvm {
/// inttoptr. We should produce new PHIs in the right type. /// inttoptr. We should produce new PHIs in the right type.
/// ///
Instruction *InstCombiner::SliceUpIllegalIntegerPHI(PHINode &FirstPhi) { Instruction *InstCombiner::SliceUpIllegalIntegerPHI(PHINode &FirstPhi) {
// Silence unused variable warning. I'd normally just remove them - but this
// will cause chaos if the compiler is wrong.
(void) isPodLike<LoweredPHIRecord>::value;
// PHIUsers - Keep track of all of the truncated values extracted from a set // PHIUsers - Keep track of all of the truncated values extracted from a set
// of PHIs, along with their offset. These are the things we want to rewrite. // of PHIs, along with their offset. These are the things we want to rewrite.
SmallVector<PHIUsageRecord, 16> PHIUsers; SmallVector<PHIUsageRecord, 16> PHIUsers;
......
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