Rename these methods to match the style guide.
[oota-llvm.git] / lib / Transforms / Instrumentation / BoundsChecking.cpp
index 031577ac3f8c85952babe317392df1ca0c920a25..7a9f0f69fbdf22e3c2e44f9a4739f972fcbc085c 100644 (file)
@@ -82,6 +82,7 @@ BasicBlock *BoundsChecking::getTrapBB() {
   Function *Fn = Inst->getParent()->getParent();
   IRBuilder<>::InsertPointGuard Guard(*Builder);
   TrapBB = BasicBlock::Create(Fn->getContext(), "trap", Fn);
+  Builder->SetInsertPoint(TrapBB);
 
   llvm::Value *F = Intrinsic::getDeclaration(Fn->getParent(), Intrinsic::trap);
   CallInst *TrapCall = Builder->CreateCall(F);
@@ -171,7 +172,8 @@ bool BoundsChecking::runOnFunction(Function &F) {
   TrapBB = 0;
   BuilderTy TheBuilder(F.getContext(), TargetFolder(TD));
   Builder = &TheBuilder;
-  ObjectSizeOffsetEvaluator TheObjSizeEval(TD, TLI, F.getContext());
+  ObjectSizeOffsetEvaluator TheObjSizeEval(TD, TLI, F.getContext(),
+                                           /*RoundToAlign=*/true);
   ObjSizeEval = &TheObjSizeEval;
 
   // check HANDLE_MEMORY_INST in include/llvm/Instruction.def for memory