aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-05-08 22:10:46 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-05-08 22:10:46 +0000
commit3d6311d5f7e5078df992c5167b53a586cfb7213a (patch)
tree6daffe4e34e3129dc4f01776be1a20311d2575c3 /clang/lib/CodeGen/CodeGenFunction.cpp
parenta777dc2abe4525b34a0e9d6433b41ea9728b27a2 (diff)
downloadllvm-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.cpp1
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();
}