aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-05-09 15:53:34 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-05-09 15:53:34 +0000
commit08a9ae95ba7e0a87e667f97ccc5bac646df9a705 (patch)
tree35c153a72ba127c12aca2a8b641c0af683207375 /lib/CodeGen/CGExpr.cpp
parent83a22ecbf52c06b4ee364f3fadcdb0abaf2dabf6 (diff)
update calls to objectsize intrinsic to match LLVM r156473
add a test for -fbounds-checking code generation git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 19ee42824f..979454bdc8 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -525,8 +525,9 @@ void CodeGenFunction::EmitCheck(llvm::Value *Address, unsigned Size) {
llvm::Value *F = CGM.getIntrinsic(llvm::Intrinsic::objectsize, IntPtrTy);
- llvm::Value *Arg = Builder.getFalse();
- llvm::Value *C = Builder.CreateCall2(F, Address, Arg);
+ llvm::Value *Min = Builder.getFalse();
+ llvm::Value *Runtime = Builder.getInt32(BoundsChecking);
+ llvm::Value *C = Builder.CreateCall3(F, Address, Min, Runtime);
llvm::BasicBlock *Cont = createBasicBlock();
Builder.CreateCondBr(Builder.CreateICmpUGE(C,
llvm::ConstantInt::get(IntPtrTy, Size)),