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 /include | |
parent | dd061f6085e7492089befa7ed88dd0669ccb049a (diff) | |
download | external_llvm-b5261ebabb215330d6549048b825d236fb3c9b6b.zip external_llvm-b5261ebabb215330d6549048b825d236fb3c9b6b.tar.gz external_llvm-b5261ebabb215330d6549048b825d236fb3c9b6b.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 'include')
-rw-r--r-- | include/llvm/MC/MCContext.h | 11 | ||||
-rw-r--r-- | include/llvm/MC/MCSection.h | 3 | ||||
-rw-r--r-- | include/llvm/MC/MCSymbol.h | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h index 846e195..24dbc40 100644 --- a/include/llvm/MC/MCContext.h +++ b/include/llvm/MC/MCContext.h @@ -18,6 +18,7 @@ namespace llvm { class MCValue; class MCSection; class MCSymbol; + class StringRef; /// MCContext - Context object for machine code objects. class MCContext { @@ -46,19 +47,19 @@ namespace llvm { ~MCContext(); /// GetSection - Get or create a new section with the given @param Name. - MCSection *GetSection(const char *Name); + MCSection *GetSection(const StringRef &Name); /// CreateSymbol - Create a new symbol with the specified @param Name. /// /// @param Name - The symbol name, which must be unique across all symbols. - MCSymbol *CreateSymbol(const char *Name); + MCSymbol *CreateSymbol(const StringRef &Name); /// GetOrCreateSymbol - Lookup the symbol inside with the specified /// @param Name. If it exists, return it. If not, create a forward /// reference and return it. /// /// @param Name - The symbol name, which must be unique across all symbols. - MCSymbol *GetOrCreateSymbol(const char *Name); + MCSymbol *GetOrCreateSymbol(const StringRef &Name); /// CreateTemporarySymbol - Create a new temporary symbol with the specified /// @param Name. @@ -66,10 +67,10 @@ namespace llvm { /// @param Name - The symbol name, for debugging purposes only, temporary /// symbols do not surive assembly. If non-empty the name must be unique /// across all symbols. - MCSymbol *CreateTemporarySymbol(const char *Name = ""); + MCSymbol *CreateTemporarySymbol(const StringRef &Name = ""); /// LookupSymbol - Get the symbol for @param Name, or null. - MCSymbol *LookupSymbol(const char *Name) const; + MCSymbol *LookupSymbol(const StringRef &Name) const; /// ClearSymbolValue - Erase a value binding for @param Symbol, if one /// exists. diff --git a/include/llvm/MC/MCSection.h b/include/llvm/MC/MCSection.h index 1b127b5..48ffa2f 100644 --- a/include/llvm/MC/MCSection.h +++ b/include/llvm/MC/MCSection.h @@ -15,6 +15,7 @@ #define LLVM_MC_MCSECTION_H #include <string> +#include "llvm/ADT/StringRef.h" namespace llvm { @@ -25,7 +26,7 @@ namespace llvm { std::string Name; private: friend class MCContext; - MCSection(const char *_Name) : Name(_Name) {} + MCSection(const StringRef &_Name) : Name(_Name) {} MCSection(const MCSection&); // DO NOT IMPLEMENT void operator=(const MCSection&); // DO NOT IMPLEMENT diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 235e661..de6dc5f 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -15,6 +15,7 @@ #define LLVM_MC_MCSYMBOL_H #include <string> +#include "llvm/ADT/StringRef.h" namespace llvm { class MCSection; @@ -46,7 +47,7 @@ namespace llvm { private: // MCContext creates and uniques these. friend class MCContext; - MCSymbol(const char *_Name, bool _IsTemporary) + MCSymbol(const StringRef &_Name, bool _IsTemporary) : Name(_Name), Section(0), IsTemporary(_IsTemporary), IsExternal(false) {} MCSymbol(const MCSymbol&); // DO NOT IMPLEMENT |