diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-13 03:18:27 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-13 03:18:27 +0000 |
commit | c50a0fd7cb6da0e674e154205da65241f9c90e1d (patch) | |
tree | 373701c9b0abb7bc546ad0b9052878b99577a2f6 /lib/MC | |
parent | 7247c079f7416d6bb919f792fcfc67797a10a0e2 (diff) | |
download | external_llvm-c50a0fd7cb6da0e674e154205da65241f9c90e1d.zip external_llvm-c50a0fd7cb6da0e674e154205da65241f9c90e1d.tar.gz external_llvm-c50a0fd7cb6da0e674e154205da65241f9c90e1d.tar.bz2 |
Parse and remember discriminators in .loc line. I try to output them with
another patch.
This lets us parse a bit more of the gcc 4.5 output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCContext.cpp | 2 | ||||
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index 311f383..87619d5 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -25,7 +25,7 @@ typedef StringMap<const MCSectionCOFF*> COFFUniqueMapTy; MCContext::MCContext(const MCAsmInfo &mai) : MAI(mai), NextUniqueID(0), - CurrentDwarfLoc(0,0,0,0,0) { + CurrentDwarfLoc(0,0,0,0,0,0) { MachOUniquingMap = 0; ELFUniquingMap = 0; COFFUniquingMap = 0; diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 489d451..24b94d1 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -2019,6 +2019,7 @@ bool GenericAsmParser::ParseDirectiveLoc(StringRef, SMLoc DirectiveLoc) { unsigned Flags = DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0; unsigned Isa = 0; + int64_t Discriminator = 0; if (getLexer().isNot(AsmToken::EndOfStatement)) { for (;;) { if (getLexer().is(AsmToken::EndOfStatement)) @@ -2070,6 +2071,10 @@ bool GenericAsmParser::ParseDirectiveLoc(StringRef, SMLoc DirectiveLoc) { return Error(Loc, "isa number not a constant value"); } } + else if (Name == "discriminator") { + if (getParser().ParseAbsoluteExpression(Discriminator)) + return true; + } else { return Error(Loc, "unknown sub-directive in '.loc' directive"); } @@ -2079,7 +2084,8 @@ bool GenericAsmParser::ParseDirectiveLoc(StringRef, SMLoc DirectiveLoc) { } } - getContext().setCurrentDwarfLoc(FileNumber, LineNumber, ColumnPos, Flags,Isa); + getContext().setCurrentDwarfLoc(FileNumber, LineNumber, ColumnPos, Flags, + Isa, Discriminator); return false; } |