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
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user