diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-27 21:22:30 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-27 21:22:30 +0000 |
commit | b5261ebabb215330d6549048b825d236fb3c9b6b (patch) | |
tree | c6629c36efe7e6d70bfffcb970bfb5e943887692 /lib/MC/MCContext.cpp | |
parent | dd061f6085e7492089befa7ed88dd0669ccb049a (diff) |
Move MCContext and friends to StringRef based APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCContext.cpp')
-rw-r--r-- | lib/MC/MCContext.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index 6c6019c76f..6c74dcd9ec 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -21,7 +21,7 @@ MCContext::MCContext() MCContext::~MCContext() { } -MCSection *MCContext::GetSection(const char *Name) { +MCSection *MCContext::GetSection(const StringRef &Name) { MCSection *&Entry = Sections[Name]; if (!Entry) @@ -30,7 +30,7 @@ MCSection *MCContext::GetSection(const char *Name) { return Entry; } -MCSymbol *MCContext::CreateSymbol(const char *Name) { +MCSymbol *MCContext::CreateSymbol(const StringRef &Name) { assert(Name[0] != '\0' && "Normal symbols cannot be unnamed!"); // Create and bind the symbol, and ensure that names are unique. @@ -39,7 +39,7 @@ MCSymbol *MCContext::CreateSymbol(const char *Name) { return Entry = new (*this) MCSymbol(Name, false); } -MCSymbol *MCContext::GetOrCreateSymbol(const char *Name) { +MCSymbol *MCContext::GetOrCreateSymbol(const StringRef &Name) { MCSymbol *&Entry = Symbols[Name]; if (Entry) return Entry; @@ -47,9 +47,9 @@ MCSymbol *MCContext::GetOrCreateSymbol(const char *Name) { } -MCSymbol *MCContext::CreateTemporarySymbol(const char *Name) { +MCSymbol *MCContext::CreateTemporarySymbol(const StringRef &Name) { // If unnamed, just create a symbol. - if (Name[0] == '\0') + if (Name.empty()) new (*this) MCSymbol("", true); // Otherwise create as usual. @@ -58,7 +58,7 @@ MCSymbol *MCContext::CreateTemporarySymbol(const char *Name) { return Entry = new (*this) MCSymbol(Name, true); } -MCSymbol *MCContext::LookupSymbol(const char *Name) const { +MCSymbol *MCContext::LookupSymbol(const StringRef &Name) const { return Symbols.lookup(Name); } |