[llvm] r283254 - Revert r283248. It caused failures in the hexagon buildbots.
David L Kreitzer via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 4 13:57:20 PDT 2016
Author: dlkreitz
Date: Tue Oct 4 15:57:19 2016
New Revision: 283254
URL: http://llvm.org/viewvc/llvm-project?rev=283254&view=rev
Log:
Revert r283248. It caused failures in the hexagon buildbots.
Modified:
llvm/trunk/lib/CodeGen/SafeStack.cpp
Modified: llvm/trunk/lib/CodeGen/SafeStack.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SafeStack.cpp?rev=283254&r1=283253&r2=283254&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SafeStack.cpp (original)
+++ llvm/trunk/lib/CodeGen/SafeStack.cpp Tue Oct 4 15:57:19 2016
@@ -358,8 +358,9 @@ bool SafeStack::IsSafeStackAlloca(const
Value *SafeStack::getOrCreateUnsafeStackPtr(IRBuilder<> &IRB, Function &F) {
// Check if there is a target-specific location for the unsafe stack pointer.
- if (Value *V = TL->getSafeStackPointerLocation(IRB))
- return V;
+ if (TL)
+ if (Value *V = TL->getSafeStackPointerLocation(IRB))
+ return V;
// Otherwise, assume the target links with compiler-rt, which provides a
// thread-local variable with a magic name.
@@ -392,7 +393,9 @@ Value *SafeStack::getOrCreateUnsafeStack
}
Value *SafeStack::getStackGuard(IRBuilder<> &IRB, Function &F) {
- Value *StackGuardVar = TL->getIRStackGuard(IRB);
+ Value *StackGuardVar = nullptr;
+ if (TL)
+ StackGuardVar = TL->getIRStackGuard(IRB);
if (!StackGuardVar)
StackGuardVar =
F.getParent()->getOrInsertGlobal("__stack_chk_guard", StackPtrTy);
@@ -749,9 +752,7 @@ bool SafeStack::runOnFunction(Function &
return false;
}
- if (!TM)
- report_fatal_error("Target machine is required");
- TL = TM->getSubtargetImpl(F)->getTargetLowering();
+ TL = TM ? TM->getSubtargetImpl(F)->getTargetLowering() : nullptr;
SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
++NumFunctions;
More information about the llvm-commits
mailing list