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 | d954638f02e77ed3ade66d60945f7ee60747e3b5 (patch) | |
tree | 197149147fb245fe77f0c5797c19569a16f0b07d /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 7cc35b76c3eb20b1eae194317bff8872e5119086 (diff) | |
download | bcm5719-llvm-d954638f02e77ed3ade66d60945f7ee60747e3b5.tar.gz bcm5719-llvm-d954638f02e77ed3ade66d60945f7ee60747e3b5.zip |
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.
llvm-svn: 91198
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 26964529ea6..db604f63b18 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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 { |