From e5f13831d08f6a3ed3e0e0742d687aba0315468b Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 14 Apr 2015 21:42:36 +0000 Subject: [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 --- llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp') 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; -- cgit v1.2.3