Add a LangOptions::areExceptionsEnabled and start using it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126062 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index fc239a5..8e88beb 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -406,7 +406,8 @@
CGF.EmitAggExpr(BaseInit->getInit(), AggSlot);
- if (CGF.Exceptions && !BaseClassDecl->hasTrivialDestructor())
+ if (CGF.CGM.getLangOptions().areExceptionsEnabled() &&
+ !BaseClassDecl->hasTrivialDestructor())
CGF.EHStack.pushCleanup<CallBaseDtor>(EHCleanup, BaseClassDecl,
isBaseVirtual);
}
@@ -604,7 +605,7 @@
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,
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp
index 8b37e9a..e295267 100644
--- a/lib/CodeGen/CGDeclCXX.cpp
+++ b/lib/CodeGen/CGDeclCXX.cpp
@@ -166,7 +166,7 @@
Fn->setSection(Section);
}
- if (!CGM.getLangOptions().Exceptions)
+ if (!CGM.getLangOptions().areExceptionsEnabled())
Fn->setDoesNotThrow();
return Fn;
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index 0e717e2..6181965 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -439,7 +439,7 @@
}
void CodeGenFunction::EmitStartEHSpec(const Decl *D) {
- if (!Exceptions)
+ if (!CGM.getLangOptions().areExceptionsEnabled())
return;
const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
@@ -467,7 +467,7 @@
}
void CodeGenFunction::EmitEndEHSpec(const Decl *D) {
- if (!Exceptions)
+ if (!CGM.getLangOptions().areExceptionsEnabled())
return;
const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
@@ -541,7 +541,7 @@
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
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 96716ad..f1b7286 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -39,8 +39,7 @@
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();
}
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index c19de38..67ef414 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -582,7 +582,6 @@
/// we prefer to insert allocas.
llvm::AssertingVH<llvm::Instruction> AllocaInsertPt;
- bool Exceptions;
bool CatchUndefined;
const CodeGen::CGBlockInfo *BlockInfo;