[C++11] DwarfDebug: Use range-based for loops.
[oota-llvm.git] / lib / CodeGen / ShadowStackGC.cpp
index e2919d3583ca8c87cc204d23da43e724ae3ad022..adb3ef916342a2e2ffade2bd1129c8172023c75e 100644 (file)
 #include "llvm/CodeGen/GCs.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/CodeGen/GCStrategy.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/IRBuilder.h"
+#include "llvm/IR/CallSite.h"
+#include "llvm/IR/IRBuilder.h"
+#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/Module.h"
 
 using namespace llvm;
 
@@ -55,8 +55,8 @@ namespace {
   public:
     ShadowStackGC();
 
-    bool initializeCustomLowering(Module &M);
-    bool performCustomLowering(Function &F);
+    bool initializeCustomLowering(Module &M) override;
+    bool performCustomLowering(Function &F) override;
 
   private:
     bool IsNullValue(Value *V);
@@ -116,8 +116,7 @@ namespace {
           // Branches and invokes do not escape, only unwind, resume, and return
           // do.
           TerminatorInst *TI = CurBB->getTerminator();
-          if (!isa<UnwindInst>(TI) && !isa<ReturnInst>(TI) &&
-              !isa<ResumeInst>(TI))
+          if (!isa<ReturnInst>(TI) && !isa<ResumeInst>(TI))
             continue;
 
           Builder.SetInsertPoint(TI->getParent(), TI);
@@ -145,11 +144,9 @@ namespace {
         BasicBlock *CleanupBB = BasicBlock::Create(C, CleanupBBName, &F);
         Type *ExnTy = StructType::get(Type::getInt8PtrTy(C),
                                       Type::getInt32Ty(C), NULL);
-        // FIXME: Assuming the C++ personality function probably isn't the best
-        //        thing in the world.
         Constant *PersFn =
           F.getParent()->
-          getOrInsertFunction("__gxx_personality_v0",
+          getOrInsertFunction("__gcc_personality_v0",
                               FunctionType::get(Type::getInt32Ty(C), true));
         LandingPadInst *LPad = LandingPadInst::Create(ExnTy, PersFn, 1,
                                                       "cleanup.lpad",