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/CodeGenFunction.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/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index dfb04b42aa..5d108be273 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -41,6 +41,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) CXXVTTValue(0), OutermostConditional(0), TerminateLandingPad(0), TerminateHandler(0), TrapBB(0) { + BoundsChecking = getContext().getLangOpts().BoundsChecking; CatchUndefined = getContext().getLangOpts().CatchUndefined; CGM.getCXXABI().getMangleContext().startNewFunction(); } |