diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-04-14 21:42:36 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-04-14 21:42:36 +0000 |
commit | e5f13831d08f6a3ed3e0e0742d687aba0315468b (patch) | |
tree | be5282a665258b096c7e55400c1672531d63570a /llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp | |
parent | ed796d518c0af106e34836fcf5375246caa23dfb (diff) | |
download | bcm5719-llvm-e5f13831d08f6a3ed3e0e0742d687aba0315468b.tar.gz bcm5719-llvm-e5f13831d08f6a3ed3e0e0742d687aba0315468b.zip |
[WinEH] Avoid emitting xdata tables twice for cleanups
Since adding invokes of llvm.donothing to cleanups, we come here now,
and trivial EH cleanup usage from clang fails to compile.
llvm-svn: 234948
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp index 39f7875cb3f..8cbf3407cf7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp @@ -344,9 +344,11 @@ void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) { } // Defer emission until we've visited the parent function and all the catch - // handlers. - if (ParentF == F || FuncInfo.CatchHandlerMaxState.count(F)) - ++FuncInfo.NumIPToStateFuncsVisited; + // handlers. Cleanups don't contribute to the ip2state table yet, so don't + // count them. + if (ParentF != F && !FuncInfo.CatchHandlerMaxState.count(F)) + return; + ++FuncInfo.NumIPToStateFuncsVisited; if (FuncInfo.NumIPToStateFuncsVisited != FuncInfo.CatchHandlerMaxState.size()) return; |