diff options
| author | Manman Ren <mren@apple.com> | 2013-03-07 01:42:00 +0000 |
|---|---|---|
| committer | Manman Ren <mren@apple.com> | 2013-03-07 01:42:00 +0000 |
| commit | 1e4272085d666ac02affbbd70d621fe386ab66b3 (patch) | |
| tree | 3e3fa128182e97d1c03abb10fbc034d18a257427 /llvm/lib/MC/MCContext.cpp | |
| parent | 96a4aa678cdcef65f63366da95c9898fcbfd70ad (diff) | |
| download | bcm5719-llvm-1e4272085d666ac02affbbd70d621fe386ab66b3.tar.gz bcm5719-llvm-1e4272085d666ac02affbbd70d621fe386ab66b3.zip | |
Debug Info: store the files and directories for each compile unit.
We now emit a line table for each compile unit. To reduce the prologue size
of each line table, the files and directories used by each compile unit are
stored in std::map<unsigned, std::vector< > > instead of std::vector< >.
The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each
compile unit causes a huge increase of debug info. With this patch, each
prologue will only emit the files required by the compile unit.
rdar://problem/13342023
llvm-svn: 176605
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
| -rw-r--r-- | llvm/lib/MC/MCContext.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 1a7df6041e6..26d378e6c0c 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -77,8 +77,8 @@ void MCContext::reset() { Symbols.clear(); Allocator.Reset(); Instances.clear(); - MCDwarfFiles.clear(); - MCDwarfDirs.clear(); + MCDwarfFilesCUMap.clear(); + MCDwarfDirsCUMap.clear(); MCGenDwarfLabelEntries.clear(); DwarfDebugFlags = StringRef(); MCLineSections.clear(); @@ -299,11 +299,13 @@ const MCSection *MCContext::getCOFFSection(StringRef Section, /// error and zero is returned and the client reports the error, else the /// allocated file number is returned. The file numbers may be in any order. unsigned MCContext::GetDwarfFile(StringRef Directory, StringRef FileName, - unsigned FileNumber) { + unsigned FileNumber, unsigned CUID) { // TODO: a FileNumber of zero says to use the next available file number. // Note: in GenericAsmParser::ParseDirectiveFile() FileNumber was checked // to not be less than one. This needs to be change to be not less than zero. + std::vector<MCDwarfFile *>& MCDwarfFiles = MCDwarfFilesCUMap[CUID]; + std::vector<StringRef>& MCDwarfDirs = MCDwarfDirsCUMap[CUID]; // Make space for this FileNumber in the MCDwarfFiles vector if needed. if (FileNumber >= MCDwarfFiles.size()) { MCDwarfFiles.resize(FileNumber + 1); @@ -363,7 +365,8 @@ unsigned MCContext::GetDwarfFile(StringRef Directory, StringRef FileName, /// isValidDwarfFileNumber - takes a dwarf file number and returns true if it /// currently is assigned and false otherwise. -bool MCContext::isValidDwarfFileNumber(unsigned FileNumber) { +bool MCContext::isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID) { + std::vector<MCDwarfFile *>& MCDwarfFiles = MCDwarfFilesCUMap[CUID]; if(FileNumber == 0 || FileNumber >= MCDwarfFiles.size()) return false; |

