Pass StringRef by value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2009-11-06 10:58:06 +00:00
parent c128b3e74e
commit 2928c83b01
51 changed files with 196 additions and 200 deletions

View File

@@ -56,7 +56,7 @@ struct AsmToken {
public:
AsmToken() {}
AsmToken(TokenKind _Kind, const StringRef &_Str, int64_t _IntVal = 0)
AsmToken(TokenKind _Kind, StringRef _Str, int64_t _IntVal = 0)
: Kind(_Kind), Str(_Str), IntVal(_IntVal) {}
TokenKind getKind() const { return Kind; }

View File

@@ -49,7 +49,7 @@ namespace llvm {
/// 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 StringRef &Name);
MCSymbol *CreateSymbol(StringRef Name);
/// GetOrCreateSymbol - Lookup the symbol inside with the specified
/// @param Name. If it exists, return it. If not, create a forward
@@ -58,7 +58,7 @@ namespace llvm {
/// @param Name - The symbol name, which must be unique across all symbols.
/// @param IsTemporary - Whether this symbol is an assembler temporary,
/// which should not survive into the symbol table for the translation unit.
MCSymbol *GetOrCreateSymbol(const StringRef &Name);
MCSymbol *GetOrCreateSymbol(StringRef Name);
MCSymbol *GetOrCreateSymbol(const Twine &Name);
/// CreateTemporarySymbol - Create a new temporary symbol with the specified
@@ -67,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 StringRef &Name = "");
MCSymbol *CreateTemporarySymbol(StringRef Name = "");
/// LookupSymbol - Get the symbol for @param Name, or null.
MCSymbol *LookupSymbol(const StringRef &Name) const;
MCSymbol *LookupSymbol(StringRef Name) const;
/// @}

View File

@@ -120,7 +120,7 @@ public:
/// @{
static const MCSymbolRefExpr *Create(const MCSymbol *Symbol, MCContext &Ctx);
static const MCSymbolRefExpr *Create(const StringRef &Name, MCContext &Ctx);
static const MCSymbolRefExpr *Create(StringRef Name, MCContext &Ctx);
/// @}
/// @name Accessors

View File

@@ -51,13 +51,13 @@ namespace llvm {
/// of a syntactic one.
bool IsDirective;
MCSectionCOFF(const StringRef &name, bool isDirective, SectionKind K)
MCSectionCOFF(StringRef name, bool isDirective, SectionKind K)
: MCSection(K), Name(name), IsDirective(isDirective) {
}
public:
static MCSectionCOFF *Create(const StringRef &Name, bool IsDirective,
SectionKind K, MCContext &Ctx);
static MCSectionCOFF *Create(StringRef Name, bool IsDirective,
SectionKind K, MCContext &Ctx);
const std::string &getName() const { return Name; }
bool isDirective() const { return IsDirective; }

View File

@@ -35,13 +35,13 @@ class MCSectionELF : public MCSection {
bool IsExplicit;
protected:
MCSectionELF(const StringRef &Section, unsigned type, unsigned flags,
MCSectionELF(StringRef Section, unsigned type, unsigned flags,
SectionKind K, bool isExplicit)
: MCSection(K), SectionName(Section.str()), Type(type), Flags(flags),
IsExplicit(isExplicit) {}
public:
static MCSectionELF *Create(const StringRef &Section, unsigned Type,
static MCSectionELF *Create(StringRef Section, unsigned Type,
unsigned Flags, SectionKind K, bool isExplicit,
MCContext &Ctx);

View File

@@ -33,7 +33,7 @@ class MCSectionMachO : public MCSection {
/// size of stubs, for example.
unsigned Reserved2;
MCSectionMachO(const StringRef &Segment, const StringRef &Section,
MCSectionMachO(StringRef Segment, StringRef Section,
unsigned TAA, unsigned reserved2, SectionKind K)
: MCSection(K), TypeAndAttributes(TAA), Reserved2(reserved2) {
assert(Segment.size() <= 16 && Section.size() <= 16 &&
@@ -52,8 +52,8 @@ class MCSectionMachO : public MCSection {
}
public:
static MCSectionMachO *Create(const StringRef &Segment,
const StringRef &Section,
static MCSectionMachO *Create(StringRef Segment,
StringRef Section,
unsigned TypeAndAttributes,
unsigned Reserved2,
SectionKind K, MCContext &Ctx);

View File

@@ -155,7 +155,7 @@ namespace llvm {
///
/// This is used to implement assembler directives such as .byte, .ascii,
/// etc.
virtual void EmitBytes(const StringRef &Data) = 0;
virtual void EmitBytes(StringRef Data) = 0;
/// EmitValue - Emit the expression @param Value into the output as a native
/// integer of the given @param Size bytes.

View File

@@ -56,7 +56,7 @@ namespace llvm {
private: // MCContext creates and uniques these.
friend class MCContext;
MCSymbol(const StringRef &_Name, bool _IsTemporary)
MCSymbol(StringRef _Name, bool _IsTemporary)
: Name(_Name), Section(0), Value(0), IsTemporary(_IsTemporary) {}
MCSymbol(const MCSymbol&); // DO NOT IMPLEMENT