aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-03-01 19:42:53 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-03-01 19:42:53 +0000
commit25eb165f18a6479bcae7bcb338b22a2bfc4290fd (patch)
tree56d7d9e2e2d369bf0e15d1b80859a60dff5959af /clang/lib/CodeGen/CodeGenFunction.h
parentd2da0f0cace6ae715c2eb4e1053d1cc20665ae62 (diff)
downloadllvm-25eb165f18a6479bcae7bcb338b22a2bfc4290fd.zip
llvm-25eb165f18a6479bcae7bcb338b22a2bfc4290fd.tar.gz
llvm-25eb165f18a6479bcae7bcb338b22a2bfc4290fd.tar.bz2
[MSVC Compat] Correctly handle finallys nested within finallys
We'd lose track of the parent CodeGenFunction, leading us to get confused with regard to which function a nested finally belonged to. Differential Revision: http://reviews.llvm.org/D17752 llvm-svn: 262379
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 9a31c8f..b9421fc 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -276,6 +276,8 @@ public:
/// potentially set the return value.
bool SawAsmBlock;
+ const FunctionDecl *CurSEHParent = nullptr;
+
/// True if the current function is an outlined SEH helper. This can be a
/// finally block or filter expression.
bool IsOutlinedSEHHelper;
@@ -1150,10 +1152,7 @@ public:
return getInvokeDestImpl();
}
- bool currentFunctionUsesSEHTry() const {
- const auto *FD = dyn_cast_or_null<FunctionDecl>(CurCodeDecl);
- return FD && FD->usesSEHTry();
- }
+ bool currentFunctionUsesSEHTry() const { return CurSEHParent != nullptr; }
const TargetInfo &getTarget() const { return Target; }
llvm::LLVMContext &getLLVMContext() { return CGM.getLLVMContext(); }