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 | efd9f385878c9c70d5c852961a73c4374b667a44 (patch) | |
tree | c6629c36efe7e6d70bfffcb970bfb5e943887692 /lib/MC | |
parent | e1e0af06e2841e8f4cd86a959ef5ed1023c2aa2a (diff) | |
download | external_llvm-efd9f385878c9c70d5c852961a73c4374b667a44.zip external_llvm-efd9f385878c9c70d5c852961a73c4374b667a44.tar.gz external_llvm-efd9f385878c9c70d5c852961a73c4374b667a44.tar.bz2 |
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')
-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 6c6019c..6c74dcd 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); } |