From 7a17851eee37f933eb57a5af7e1a0eb455443f6a Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 28 Feb 2011 00:33:03 +0000 Subject: [PATCH] Get rid of the areExceptionsEnabled() getter from LangOptions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126598 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/LangOptions.h | 4 ---- lib/Analysis/CFG.cpp | 2 +- lib/CodeGen/CGClass.cpp | 4 ++-- lib/CodeGen/CGDeclCXX.cpp | 2 +- lib/CodeGen/CGException.cpp | 6 +++--- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index 0bd983e8e6..35dfdb6c3a 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -239,10 +239,6 @@ public: void setSignedOverflowBehavior(SignedOverflowBehaviorTy V) { SignedOverflowBehavior = (unsigned)V; } - - bool areExceptionsEnabled() const { - return Exceptions; - } }; /// Floating point control options diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index cc6e9c592a..d2cccc8d2b 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -1099,7 +1099,7 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) { bool AddEHEdge = false; // Languages without exceptions are assumed to not throw. - if (Context->getLangOptions().areExceptionsEnabled()) { + if (Context->getLangOptions().Exceptions) { if (BuildOpts.AddEHEdges) AddEHEdge = true; } diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index cd28bbe44d..fbc5f3f030 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -407,7 +407,7 @@ static void EmitBaseInitializer(CodeGenFunction &CGF, CGF.EmitAggExpr(BaseInit->getInit(), AggSlot); - if (CGF.CGM.getLangOptions().areExceptionsEnabled() && + if (CGF.CGM.getLangOptions().Exceptions && !BaseClassDecl->hasTrivialDestructor()) CGF.EHStack.pushCleanup(EHCleanup, BaseClassDecl, isBaseVirtual); @@ -606,7 +606,7 @@ static void EmitMemberInitializer(CodeGenFunction &CGF, EmitAggMemberInitializer(CGF, LHS, ArrayIndexVar, MemberInit, FieldType, 0); - if (!CGF.CGM.getLangOptions().areExceptionsEnabled()) + if (!CGF.CGM.getLangOptions().Exceptions) 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 e295267896..8b37e9af3c 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -166,7 +166,7 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM, Fn->setSection(Section); } - if (!CGM.getLangOptions().areExceptionsEnabled()) + if (!CGM.getLangOptions().Exceptions) Fn->setDoesNotThrow(); return Fn; diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 4bce081e48..eb907e1fff 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -439,7 +439,7 @@ void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) { } void CodeGenFunction::EmitStartEHSpec(const Decl *D) { - if (!CGM.getLangOptions().areExceptionsEnabled()) + if (!CGM.getLangOptions().Exceptions) return; const FunctionDecl* FD = dyn_cast_or_null(D); @@ -467,7 +467,7 @@ void CodeGenFunction::EmitStartEHSpec(const Decl *D) { } void CodeGenFunction::EmitEndEHSpec(const Decl *D) { - if (!CGM.getLangOptions().areExceptionsEnabled()) + if (!CGM.getLangOptions().Exceptions) return; const FunctionDecl* FD = dyn_cast_or_null(D); @@ -541,7 +541,7 @@ llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() { assert(EHStack.requiresLandingPad()); assert(!EHStack.empty()); - if (!CGM.getLangOptions().areExceptionsEnabled()) + if (!CGM.getLangOptions().Exceptions) return 0; // Check the innermost scope for a cached landing pad. If this is -- 2.40.0