X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FCodeGen%2FAsmPrinter%2FAsmPrinter.cpp;h=85ee9b3b8538c98b8fd589818c267a3e2cb1d989;hp=cb8aa72e246d527bef6a08b917317e72abd6d469;hb=145cdc632a29600c2d8ea1707917e227f9a2c8b1;hpb=82b72bed60cd6f38a202b76fed9ea7ca6b7aad4c diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index cb8aa72e246..85ee9b3b853 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -902,7 +902,8 @@ void AsmPrinter::EmitFunctionBody() { const MCExpr *SizeExp = MCBinaryExpr::createSub( MCSymbolRefExpr::create(CurrentFnEnd, OutContext), MCSymbolRefExpr::create(CurrentFnSymForSize, OutContext), OutContext); - OutStreamer->emitELFSize(cast(CurrentFnSym), SizeExp); + if (auto Sym = dyn_cast(CurrentFnSym)) + OutStreamer->emitELFSize(Sym, SizeExp); } for (const HandlerInfo &HI : Handlers) {