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 | 3d6311d5f7e5078df992c5167b53a586cfb7213a (patch) | |
tree | 6daffe4e34e3129dc4f01776be1a20311d2575c3 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | a777dc2abe4525b34a0e9d6433b41ea9728b27a2 (diff) | |
download | llvm-3d6311d5f7e5078df992c5167b53a586cfb7213a.zip llvm-3d6311d5f7e5078df992c5167b53a586cfb7213a.tar.gz llvm-3d6311d5f7e5078df992c5167b53a586cfb7213a.tar.bz2 |
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.
llvm-svn: 156431
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index dfb04b4..5d108be 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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(); } |