summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-27 21:22:30 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-27 21:22:30 +0000
commita87555aaa8fcb856a45d05154150686612862432 (patch)
tree736215d7a65e1a63a14f6eea640144311e62f6b1 /llvm/lib/MC/MCContext.cpp
parent9f79643f4b469d7009b9edfafa2607c6c2a6588a (diff)
downloadbcm5719-llvm-a87555aaa8fcb856a45d05154150686612862432.tar.gz
bcm5719-llvm-a87555aaa8fcb856a45d05154150686612862432.zip
Move MCContext and friends to StringRef based APIs.
llvm-svn: 77251
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 6c6019c76ff..6c74dcd9ecf 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud