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()
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-comment") # multi-line comment
set_cpp_flag("-Wno-undefined-var-template") # instantiation of variable 'X' required here, but no definition is available
endif()
# For distribution it is more important to be slim than super optimized
......
......@@ -294,7 +294,6 @@ public:
// Loop over the predecessors of the header node...
BlockT *Header = getHeader();
typedef GraphTraits<BlockT*> BlockTraits;
typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
for (typename InvBlockTraits::ChildIteratorType PI =
InvBlockTraits::child_begin(Header),
......@@ -828,10 +827,10 @@ public:
typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
// 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) {
typename InvBlockTraits::NodeType *N = *PI;
TodoStack.push_back(N);
}
for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(X), PE = InvBlockTraits::child_end(X); PI != PE; ++PI) {
typename InvBlockTraits::NodeType *N = *PI;
TodoStack.push_back(N);
}
}
}
......
......@@ -29,7 +29,7 @@
namespace llvm {
class ValueSymbolTable;
template<typename NodeTy> class ilist_iterator;
template<typename NodeTy, typename Traits> class iplist;
template<typename Ty> struct ilist_traits;
......@@ -46,7 +46,6 @@ public:
/// getListOwner - Return the object that owns this list. If this is a list
/// of instructions, it returns the BasicBlock that owns them.
ItemParentClass *getListOwner() {
typedef iplist<ValueSubClass> ItemParentClass::*Sublist;
size_t Offset(size_t(&((ItemParentClass*)0->*ItemParentClass::
getSublistAccess(static_cast<ValueSubClass*>(0)))));
iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this));
......
......@@ -265,13 +265,6 @@ MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI,
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() {
delete ObjFileMMI;
......
......@@ -1441,7 +1441,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
&LoadChains[0], LoadChains.size());
EVT TempWideVector = EVT::getVectorVT(*DAG.getContext(),
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());
// Cast to the correct type
......@@ -1629,7 +1629,6 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
break;
case TargetLowering::Expand:
EVT WideScalarVT = Tmp3.getValueType().getScalarType();
EVT NarrowScalarVT = StVT.getScalarType();
if (StVT.isVector()) {
......@@ -1649,7 +1648,6 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
if (RegScalarLegal) {
// Cast floats into integers
unsigned ScalarSize = MemSclVT.getSizeInBits();
EVT EltVT = EVT::getIntegerVT(*DAG.getContext(), ScalarSize);
// Round odd types to the next pow of two.
if (!isPowerOf2_32(ScalarSize))
......
......@@ -191,17 +191,6 @@ static inline void write_uint32_le(void *Data, uint32_t const &Value) {
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
......
......@@ -58,7 +58,7 @@ public:
static sys::Mutex gCrashRecoveryContexMutex;
static bool gCrashRecoveryEnabled = false;
static sys::ThreadLocal<const CrashRecoveryContextCleanup>
static sys::ThreadLocal<const CrashRecoveryContextCleanup>
tlIsRecoveringFromCrash;
CrashRecoveryContextCleanup::~CrashRecoveryContextCleanup() {}
......@@ -75,7 +75,7 @@ CrashRecoveryContext::~CrashRecoveryContext() {
delete tmp;
}
tlIsRecoveringFromCrash.erase();
CrashRecoveryContextImpl *CRCI = (CrashRecoveryContextImpl *) Impl;
delete CRCI;
}
......@@ -224,10 +224,10 @@ void CrashRecoveryContext::Disable() {
#include <signal.h>
#ifdef ENABLE_SIGNAL_OVERRIDES
static int Signals[] = { SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP };
static const unsigned NumSignals = sizeof(Signals) / sizeof(Signals[0]);
static struct sigaction PrevActions[NumSignals];
static void CrashRecoverySignalHandler(int Signal) {
// Lookup the current thread local recovery object.
const CrashRecoveryContextImpl *CRCI = CurrentContext.get();
......@@ -259,6 +259,7 @@ static void CrashRecoverySignalHandler(int Signal) {
if (CRCI)
const_cast<CrashRecoveryContextImpl*>(CRCI)->HandleCrash();
}
#endif // ENABLE_SIGNAL_OVERRIDES
void CrashRecoveryContext::Enable() {
sys::ScopedLock L(gCrashRecoveryContexMutex);
......
......@@ -149,8 +149,10 @@ static bool RedirectIO_PS(const Path *Path, int FD, std::string *ErrMsg,
}
#endif
#ifdef ENABLE_SIGNAL_OVERRIDES
static void TimeOutHandler(int Sig) {
}
#endif
static void SetMemoryLimits (unsigned size)
{
......@@ -302,6 +304,7 @@ Program::Wait(const sys::Path &path,
{
#ifdef HAVE_SYS_WAIT_H
struct sigaction Act, Old;
(void)Act; (void)Old;
if (Data_ == 0) {
MakeErrMsg(ErrMsg, "Process not started!");
......
......@@ -32,7 +32,9 @@
#endif
using namespace llvm;
#ifdef ENABLE_SIGNAL_OVERRIDES
static RETSIGTYPE SignalHandler(int Sig); // defined below.
#endif // ENABLE_SIGNAL_OVERRIDES
static SmartMutex<true> SignalsMutex;
......@@ -76,6 +78,7 @@ static struct {
} RegisteredSignalInfo[(sizeof(IntSigs)+sizeof(KillSigs))/sizeof(KillSigs[0])];
#ifdef ENABLE_SIGNAL_OVERRIDES
static void RegisterHandler(int Signal) {
assert(NumRegisteredSignals <
sizeof(RegisteredSignalInfo)/sizeof(RegisteredSignalInfo[0]) &&
......@@ -93,6 +96,7 @@ static void RegisterHandler(int Signal) {
RegisteredSignalInfo[NumRegisteredSignals].SigNo = Signal;
++NumRegisteredSignals;
}
#endif // ENABLE_SIGNAL_OVERRIDES
static void RegisterHandlers() {
#ifdef ENABLE_SIGNAL_OVERRIDES
......@@ -104,6 +108,7 @@ static void RegisterHandlers() {
#endif
}
#ifdef ENABLE_SIGNAL_OVERRIDES
static void UnregisterHandlers() {
// Restore all of the signal handlers to how they were before we showed up.
for (unsigned i = 0, e = NumRegisteredSignals; i != e; ++i)
......@@ -111,6 +116,7 @@ static void UnregisterHandlers() {
&RegisteredSignalInfo[i].SA, 0);
NumRegisteredSignals = 0;
}
#endif // ENABLE_SIGNAL_OVERRIDES
/// RemoveFilesToRemove - Process the FilesToRemove list. This function
......@@ -122,6 +128,7 @@ static void RemoveFilesToRemove() {
}
}
#ifdef ENABLE_SIGNAL_OVERRIDES
// SignalHandler - The signal handler that runs.
static RETSIGTYPE SignalHandler(int Sig) {
// Restore the signal behavior to default, so that the program actually
......@@ -158,6 +165,7 @@ static RETSIGTYPE SignalHandler(int Sig) {
for (unsigned i = 0, e = CallBacksToRun.size(); i != e; ++i)
CallBacksToRun[i].first(CallBacksToRun[i].second);
}
#endif // ENABLE_SIGNAL_OVERRIDES
void llvm::sys::RunInterruptHandlers() {
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