summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-02-12 23:40:45 +0000
committerReid Kleckner <reid@kleckner.net>2015-02-12 23:40:45 +0000
commit11c033e8aa6cf4cb89c7c74cff6ca6197a6d52c8 (patch)
tree7f64b16a8cd23a0439877f0ef0d6c608c37db27b /clang/lib/CodeGen
parentf3e0e3acdafb2b52eb197b4d8251aa2f91886d81 (diff)
downloadbcm5719-llvm-11c033e8aa6cf4cb89c7c74cff6ca6197a6d52c8.tar.gz
bcm5719-llvm-11c033e8aa6cf4cb89c7c74cff6ca6197a6d52c8.zip
SEH: Use the SEHTryEpilogueStack instead of a separate bool
We don't need a bool to track this now that we have a stack for it. llvm-svn: 228982
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp2
-rw-r--r--clang/lib/CodeGen/CGException.cpp7
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp2
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h6
4 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 60ab2effbeb..90cf5ee65df 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -3326,7 +3326,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
llvm::Attribute::AlwaysInline);
// Disable inlining inside SEH __try blocks.
- if (IsSEHTryScope)
+ if (isSEHTryScope())
Attrs =
Attrs.addAttribute(getLLVMContext(), llvm::AttributeSet::FunctionIndex,
llvm::Attribute::NoInline);
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index a76b3d82abb..61f538b0eec 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -21,7 +21,6 @@
#include "clang/AST/StmtObjC.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Intrinsics.h"
-#include "llvm/Support/SaveAndRestore.h"
using namespace clang;
using namespace CodeGen;
@@ -1708,17 +1707,15 @@ void CodeGenFunction::EmitSEHTryStmt(const SEHTryStmt &S) {
EnterSEHTryStmt(S, FI);
{
JumpDest TryExit = getJumpDestInCurrentScope("__try.__leave");
- SEHTryEpilogueStack.push_back(&TryExit);
- // Disable inlining inside SEH __try scopes.
- SaveAndRestore<bool> Saver(IsSEHTryScope, true);
+ SEHTryEpilogueStack.push_back(&TryExit);
EmitStmt(S.getTryBlock());
+ SEHTryEpilogueStack.pop_back();
if (!TryExit.getBlock()->use_empty())
EmitBlock(TryExit.getBlock(), /*IsFinished=*/true);
else
delete TryExit.getBlock();
- SEHTryEpilogueStack.pop_back();
}
ExitSEHTryStmt(S, FI);
}
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 43dd7a05de1..79425d4c21e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -40,7 +40,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm, bool suppressNewContext)
CurFn(nullptr), CapturedStmtInfo(nullptr),
SanOpts(CGM.getLangOpts().Sanitize), IsSanitizerScope(false),
CurFuncIsThunk(false), AutoreleaseResult(false), SawAsmBlock(false),
- IsSEHTryScope(false), BlockInfo(nullptr), BlockPointer(nullptr),
+ BlockInfo(nullptr), BlockPointer(nullptr),
LambdaThisCaptureField(nullptr), NormalCleanupDest(nullptr),
NextCleanupDestIndex(1), FirstBlockInfo(nullptr), EHResumeBlock(nullptr),
ExceptionSlot(nullptr), EHSelectorSlot(nullptr),
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 67188dfa0a1..12f066bf171 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -263,9 +263,6 @@ public:
/// potentially set the return value.
bool SawAsmBlock;
- /// Codegen is currently inside an SEH try block.
- bool IsSEHTryScope;
-
const CodeGen::CGBlockInfo *BlockInfo;
llvm::Value *BlockPointer;
@@ -365,6 +362,9 @@ public:
llvm::BasicBlock *ResumeBB;
};
+ /// Returns true inside SEH __try blocks.
+ bool isSEHTryScope() const { return !SEHTryEpilogueStack.empty(); }
+
/// pushFullExprCleanup - Push a cleanup to be run at the end of the
/// current full-expression. Safe against the possibility that
/// we're currently inside a conditionally-evaluated expression.
OpenPOWER on IntegriCloud