diff options
-rw-r--r-- | clang/include/clang/Basic/LangOptions.h | 4 | ||||
-rw-r--r-- | clang/lib/Analysis/CFG.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 5 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGDeclCXX.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 1 |
7 files changed, 13 insertions, 10 deletions
diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 868a0bec914..f4db55ae062 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -238,6 +238,10 @@ public: void setSignedOverflowBehavior(SignedOverflowBehaviorTy V) { SignedOverflowBehavior = (unsigned)V; } + + bool areExceptionsEnabled() const { + return Exceptions; + } }; /// Floating point control options diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index 1ae5d40f4d1..a0ec5febbef 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/lib/Analysis/CFG.cpp @@ -1089,7 +1089,7 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) { bool AddEHEdge = false; // Languages without exceptions are assumed to not throw. - if (Context->getLangOptions().Exceptions) { + if (Context->getLangOptions().areExceptionsEnabled()) { if (BuildOpts.AddEHEdges) AddEHEdge = true; } diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index fc239a536f9..8e88beb3cf0 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -406,7 +406,8 @@ static void EmitBaseInitializer(CodeGenFunction &CGF, 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 @@ static void EmitMemberInitializer(CodeGenFunction &CGF, 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/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp index 8b37e9af3c6..e295267896e 100644 --- a/clang/lib/CodeGen/CGDeclCXX.cpp +++ b/clang/lib/CodeGen/CGDeclCXX.cpp @@ -166,7 +166,7 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM, Fn->setSection(Section); } - if (!CGM.getLangOptions().Exceptions) + if (!CGM.getLangOptions().areExceptionsEnabled()) Fn->setDoesNotThrow(); return Fn; diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 0e717e26ab3..6181965748c 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -439,7 +439,7 @@ void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) { } 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::EmitStartEHSpec(const Decl *D) { } 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 @@ llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() { 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/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 96716ad9ccf..f1b72863cac 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -39,8 +39,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) 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/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index c19de38dc9b..67ef41448e8 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -582,7 +582,6 @@ public: /// we prefer to insert allocas. llvm::AssertingVH<llvm::Instruction> AllocaInsertPt; - bool Exceptions; bool CatchUndefined; const CodeGen::CGBlockInfo *BlockInfo; |