MCDwarf: Simplify MCDwarfFile to just use std::string instead of cunning use of MCContext's allocator.

There aren't /that/ many files, and we are already using various maps
and other standard containers that don't use MCContext's allocator to
store these values, so this doesn't seem to be critical and simplifies
the design (I'll be moving construction out of MCContext shortly so it'd
be annoying to have to pass the allocator around to allocate these
things... and we'll have non-MCContext users (debug_line.dwo) shortly)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-03-13 18:55:04 +00:00
parent ed2ca70ccf
commit 8c987f5340
5 changed files with 23 additions and 29 deletions

View File

@@ -322,7 +322,7 @@ namespace llvm {
return I->second;
}
const SmallVectorImpl<MCDwarfFile *> &getMCDwarfFiles(unsigned CUID = 0) {
const SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles(unsigned CUID = 0) {
return getMCDwarfFileTable(CUID).getMCDwarfFiles();
}
const SmallVectorImpl<StringRef> &getMCDwarfDirs(unsigned CUID = 0) {

View File

@@ -40,7 +40,7 @@ class SMLoc;
struct MCDwarfFile {
// Name - the base name of the file without its directory path.
// The StringRef references memory allocated in the MCContext.
StringRef Name;
std::string Name;
// DirIndex - the index into the list of directory names for this file name.
unsigned DirIndex;
@@ -176,7 +176,7 @@ public:
class MCDwarfFileTable {
MCSymbol *Label;
SmallVector<StringRef, 3> MCDwarfDirs;
SmallVector<MCDwarfFile *, 3> MCDwarfFiles;
SmallVector<MCDwarfFile, 3> MCDwarfFiles;
MCLineSection MCLineSections;
public:
@@ -197,11 +197,11 @@ public:
return MCDwarfDirs;
}
const SmallVectorImpl<MCDwarfFile *> &getMCDwarfFiles() const {
const SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles() const {
return MCDwarfFiles;
}
SmallVectorImpl<MCDwarfFile *> &getMCDwarfFiles() {
SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles() {
return MCDwarfFiles;
}