void setSignedOverflowBehavior(SignedOverflowBehaviorTy V) {
SignedOverflowBehavior = (unsigned)V;
}
+
+ bool areExceptionsEnabled() const {
+ return Exceptions;
+ }
};
/// Floating point control options
bool AddEHEdge = false;
// Languages without exceptions are assumed to not throw.
- if (Context->getLangOptions().Exceptions) {
+ if (Context->getLangOptions().areExceptionsEnabled()) {
if (BuildOpts.AddEHEdges)
AddEHEdge = true;
}
CGF.EmitAggExpr(BaseInit->getInit(), AggSlot);
- if (CGF.Exceptions && !BaseClassDecl->hasTrivialDestructor())
+ if (CGF.CGM.getLangOptions().areExceptionsEnabled() &&
+ !BaseClassDecl->hasTrivialDestructor())
CGF.EHStack.pushCleanup<CallBaseDtor>(EHCleanup, BaseClassDecl,
isBaseVirtual);
}
EmitAggMemberInitializer(CGF, LHS, ArrayIndexVar, MemberInit, FieldType, 0);
- if (!CGF.Exceptions)
+ if (!CGF.CGM.getLangOptions().areExceptionsEnabled())
return;
// FIXME: If we have an array of classes w/ non-trivial destructors,
Fn->setSection(Section);
}
- if (!CGM.getLangOptions().Exceptions)
+ if (!CGM.getLangOptions().areExceptionsEnabled())
Fn->setDoesNotThrow();
return Fn;
}
void CodeGenFunction::EmitStartEHSpec(const Decl *D) {
- if (!Exceptions)
+ if (!CGM.getLangOptions().areExceptionsEnabled())
return;
const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
}
void CodeGenFunction::EmitEndEHSpec(const Decl *D) {
- if (!Exceptions)
+ if (!CGM.getLangOptions().areExceptionsEnabled())
return;
const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
assert(EHStack.requiresLandingPad());
assert(!EHStack.empty());
- if (!Exceptions)
+ if (!CGM.getLangOptions().areExceptionsEnabled())
return 0;
// Check the innermost scope for a cached landing pad. If this is
CXXThisDecl(0), CXXThisValue(0), CXXVTTDecl(0), CXXVTTValue(0),
OutermostConditional(0), TerminateLandingPad(0), TerminateHandler(0),
TrapBB(0) {
-
- Exceptions = getContext().getLangOptions().Exceptions;
+
CatchUndefined = getContext().getLangOptions().CatchUndefined;
CGM.getCXXABI().getMangleContext().startNewFunction();
}
/// we prefer to insert allocas.
llvm::AssertingVH<llvm::Instruction> AllocaInsertPt;
- bool Exceptions;
bool CatchUndefined;
const CodeGen::CGBlockInfo *BlockInfo;