From 3d6311d5f7e5078df992c5167b53a586cfb7213a Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Tue, 8 May 2012 22:10:46 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenFunction.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') 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(); } -- cgit v1.1