Commit f6e849c9 by Nicolas Capens

Fix LLVM code warnings.

Bug 15387371 Change-Id: Ic5374735e6ca386e871848c34890272c1259c273 Reviewed-on: https://swiftshader-review.googlesource.com/4496Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 3b396464
......@@ -84,7 +84,8 @@ public:
// Loop through the basic block until we find A or B.
MachineBasicBlock::iterator I = BBA->begin();
for (; &*I != A && &*I != B; ++I) /*empty*/;
for (; &*I != A && &*I != B; ++I)
/*empty*/ ;
//if(!DT.IsPostDominators) {
// A dominates B if it is found first in the basic block.
......
......@@ -4473,9 +4473,9 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
getValue(I.getArgOperand(0))));
return 0;
case Intrinsic::setjmp:
return "_setjmp"+!TLI.usesUnderscoreSetJmp();
return &"_setjmp"[!TLI.usesUnderscoreSetJmp()];
case Intrinsic::longjmp:
return "_longjmp"+!TLI.usesUnderscoreLongJmp();
return &"_longjmp"[!TLI.usesUnderscoreLongJmp()];
case Intrinsic::memcpy: {
// Assert for address < 256 since we support only user defined address
// spaces.
......
......@@ -934,13 +934,14 @@ public:
void run(AllocaInst *AI, const SmallVectorImpl<Instruction*> &Insts) {
// Remember which alloca we're promoting (for isInstInList).
this->AI = AI;
if (MDNode *DebugNode = MDNode::getIfExists(AI->getContext(), AI))
if (MDNode *DebugNode = MDNode::getIfExists(AI->getContext(), AI)) {
for (Value::use_iterator UI = DebugNode->use_begin(),
E = DebugNode->use_end(); UI != E; ++UI)
if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(*UI))
DDIs.push_back(DDI);
else if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(*UI))
DVIs.push_back(DVI);
}
LoadAndStorePromoter::run(Insts);
AI->eraseFromParent();
......
......@@ -2038,10 +2038,6 @@ void NamedMDNode::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
}
void Type::print(raw_ostream &OS) const {
if (this == 0) {
OS << "<null Type>";
return;
}
TypePrinting TP;
TP.print(const_cast<Type*>(this), OS);
......@@ -2054,10 +2050,6 @@ void Type::print(raw_ostream &OS) const {
}
void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
if (this == 0) {
ROS << "printing a <null> value\n";
return;
}
formatted_raw_ostream OS(ROS);
if (const Instruction *I = dyn_cast<Instruction>(this)) {
const Function *F = I->getParent() ? I->getParent()->getParent() : 0;
......
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