diff options
author | Alp Toker <alp@nuanti.com> | 2014-07-06 10:33:31 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-07-06 10:33:31 +0000 |
commit | a55b95b58ad8f2d474564eefd3815759c5a0d1c2 (patch) | |
tree | 8b595a435702695b569fbd488a734b462e71cad7 /llvm/lib/MC/MCDwarf.cpp | |
parent | 54cc62740f8abe1ac69c664e006c22bea5c4957b (diff) | |
download | bcm5719-llvm-a55b95b58ad8f2d474564eefd3815759c5a0d1c2.tar.gz bcm5719-llvm-a55b95b58ad8f2d474564eefd3815759c5a0d1c2.zip |
SourceMgr: make valid buffer IDs start from one
Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned
representation to enable more idiomatic usage.
Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1
to identify the main file.
llvm-svn: 212398
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index bddbf578d80..0a3fab8c455 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -928,7 +928,7 @@ void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, // Finding the line number is the expensive part which is why we just don't // pass it in as for some symbols we won't create a dwarf label. - int CurBuffer = SrcMgr.FindBufferContainingLoc(Loc); + unsigned CurBuffer = SrcMgr.FindBufferContainingLoc(Loc); unsigned LineNumber = SrcMgr.FindLineNumber(Loc, CurBuffer); // We create a temporary symbol for use for the AT_high_pc and AT_low_pc |