diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-08 22:10:46 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-08 22:10:46 +0000 |
commit | b3198a841e7f356f171f1e11faff014b2deb1eb8 (patch) | |
tree | f115cc1178faeca731a111d9a02f0ccad49f9dba /lib/CodeGen/CGExpr.cpp | |
parent | 4213e389d6f8fa96ab30eec0d932e4e3eee32997 (diff) |
add -fbounds-checking option.
When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend.
OK'ed by Chad; thanks for the review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index f977f5531a..19ee42824f 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -517,7 +517,7 @@ unsigned CodeGenFunction::getAccessedFieldNo(unsigned Idx, } void CodeGenFunction::EmitCheck(llvm::Value *Address, unsigned Size) { - if (!CatchUndefined) + if (BoundsChecking <= 0) return; // This needs to be to the standard address space. |