diff options
author | Mike Stump <mrs@apple.com> | 2009-12-12 01:27:46 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-12-12 01:27:46 +0000 |
commit | 9c276ae0f24d4cee8f7954069d4b8eae45d0447d (patch) | |
tree | 967ccefb7c10869562faaa2dd6f5b9feb43c8ce7 /lib/CodeGen/CodeGenFunction.cpp | |
parent | 498eb7ece2a5699e215acf071040de27d7882931 (diff) |
Implement runtime checks for undefined behavior. WIP.
This implements a new flag -fcatch-undefined-behavior. The flag turns
on additional runtime checks for:
T a[I];
a[i] abort when i < 0 or i >= I.
Future stuff includes shifts by >= bitwidth amounts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 26964529ea..db604f63b1 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -32,10 +32,11 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) SwitchInsn(0), CaseRangeBlock(0), InvokeDest(0), CXXThisDecl(0), CXXVTTDecl(0), ConditionalBranchLevel(0), TerminateHandler(0), - UniqueAggrDestructorCount(0) { + UniqueAggrDestructorCount(0), AbortBB(0) { LLVMIntTy = ConvertType(getContext().IntTy); LLVMPointerWidth = Target.getPointerWidth(0); Exceptions = getContext().getLangOptions().Exceptions; + CatchUndefined = getContext().getLangOptions().CatchUndefined; } ASTContext &CodeGenFunction::getContext() const { |