diff options
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index de7d96129f1..5a56094a3c7 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -172,6 +172,9 @@ private: /// \brief Are we parsing ms-style inline assembly? bool ParsingInlineAsm; + /// \brief The last symbol we emitted, used for call frame information. + MCSymbol *LastFuncSymbol; + public: AsmParser(SourceMgr &SM, MCContext &Ctx, MCStreamer &Out, const MCAsmInfo &MAI); @@ -491,7 +494,8 @@ AsmParser::AsmParser(SourceMgr &_SM, MCContext &_Ctx, MCStreamer &_Out, : Lexer(_MAI), Ctx(_Ctx), Out(_Out), MAI(_MAI), SrcMgr(_SM), PlatformParser(nullptr), CurBuffer(_SM.getMainFileID()), MacrosEnabledFlag(true), HadError(false), CppHashLineNumber(0), - AssemblerDialect(~0U), IsDarwin(false), ParsingInlineAsm(false) { + AssemblerDialect(~0U), IsDarwin(false), ParsingInlineAsm(false), + LastFuncSymbol(nullptr) { // Save the old handler. SavedDiagHandler = SrcMgr.getDiagHandler(); SavedDiagContext = SrcMgr.getDiagContext(); @@ -1305,6 +1309,9 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info, if (!ParsingInlineAsm) Out.EmitLabel(Sym); + // Record the symbol, so that it can be used for call frame information + LastFuncSymbol = Sym; + // If we are generating dwarf for assembly source files then gather the // info to make a dwarf label entry for this label if needed. if (getContext().getGenDwarfForAssembly()) @@ -2961,7 +2968,7 @@ bool AsmParser::parseDirectiveCFIStartProc() { if (parseIdentifier(Simple) || Simple != "simple") return TokError("unexpected token in .cfi_startproc directive"); - getStreamer().EmitCFIStartProc(!Simple.empty()); + getStreamer().EmitCFIStartProc(!Simple.empty(), LastFuncSymbol); return false; } |