summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-08-18 19:07:12 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-08-18 19:07:12 +0000
commit0ad363eebc2d4246cf4bb7d6cf047cd8f8210bc4 (patch)
tree31b043ed528212e32ae8c0e79d3a585db1576e05 /llvm/lib/CodeGen/AsmPrinter/WinException.cpp
parent1378a5aec3f1f03ff02df671a700f4a41c4acc97 (diff)
downloadbcm5719-llvm-0ad363eebc2d4246cf4bb7d6cf047cd8f8210bc4.tar.gz
bcm5719-llvm-0ad363eebc2d4246cf4bb7d6cf047cd8f8210bc4.zip
[WinEH] Calculate state numbers for the new EH representation
State numbers are calculated by performing a walk from the innermost funclet to the outermost funclet. Rudimentary support for the new EH constructs has been added to the assembly printer, just enough to test the new machinery. Differential Revision: http://reviews.llvm.org/D12098 llvm-svn: 245331
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinException.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 71c77815e28..4151101e22b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -182,10 +182,10 @@ const MCExpr *WinException::create32bitRef(const MCSymbol *Value) {
Asm->OutContext);
}
-const MCExpr *WinException::create32bitRef(const GlobalValue *GV) {
- if (!GV)
+const MCExpr *WinException::create32bitRef(const Value *V) {
+ if (!V)
return MCConstantExpr::create(0, Asm->OutContext);
- return create32bitRef(Asm->getSymbol(GV));
+ return create32bitRef(Asm->getSymbol(cast<GlobalValue>(V)));
}
/// Emit the language-specific data that __C_specific_handler expects. This
@@ -413,7 +413,8 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) {
int CatchHigh = -1;
for (WinEHHandlerType &HT : TBME.HandlerArray)
CatchHigh =
- std::max(CatchHigh, FuncInfo.CatchHandlerMaxState[HT.Handler]);
+ std::max(CatchHigh,
+ FuncInfo.CatchHandlerMaxState[cast<Function>(HT.Handler)]);
assert(TBME.TryLow <= TBME.TryHigh);
OS.EmitIntValue(TBME.TryLow, 4); // TryLow
OpenPOWER on IntegriCloud