mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Remove meaningless const.
Pass StringRef by value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6d31268a7d
commit
49b63a1f2c
@ -61,7 +61,7 @@ protected:
|
||||
: MetadataBase(Type::getMetadataTy(C), Value::MDStringVal), Str(begin, l) {}
|
||||
|
||||
public:
|
||||
static MDString *get(LLVMContext &Context, const StringRef &Str);
|
||||
static MDString *get(LLVMContext &Context, StringRef Str);
|
||||
|
||||
StringRef getString() const { return Str; }
|
||||
|
||||
@ -256,14 +256,14 @@ private:
|
||||
public:
|
||||
/// registerMDKind - Register a new metadata kind and return its ID.
|
||||
/// A metadata kind can be registered only once.
|
||||
unsigned registerMDKind(const StringRef Name);
|
||||
unsigned registerMDKind(StringRef Name);
|
||||
|
||||
/// getMDKind - Return metadata kind. If the requested metadata kind
|
||||
/// is not registered then return 0.
|
||||
unsigned getMDKind(const StringRef Name) const;
|
||||
unsigned getMDKind(StringRef Name) const;
|
||||
|
||||
/// isValidName - Return true if Name is a valid custom metadata handler name.
|
||||
static bool isValidName(const StringRef Name);
|
||||
static bool isValidName(StringRef Name);
|
||||
|
||||
/// getMD - Get the metadata of given kind attached to an Instruction.
|
||||
/// If the metadata is not found then return 0.
|
||||
|
@ -26,7 +26,7 @@ using namespace llvm;
|
||||
//===----------------------------------------------------------------------===//
|
||||
// MDString implementation.
|
||||
//
|
||||
MDString *MDString::get(LLVMContext &Context, const StringRef &Str) {
|
||||
MDString *MDString::get(LLVMContext &Context, StringRef Str) {
|
||||
LLVMContextImpl *pImpl = Context.pImpl;
|
||||
StringMapEntry<MDString *> &Entry =
|
||||
pImpl->MDStringCache.GetOrCreateValue(Str);
|
||||
@ -186,7 +186,7 @@ NamedMDNode::~NamedMDNode() {
|
||||
|
||||
/// registerMDKind - Register a new metadata kind and return its ID.
|
||||
/// A metadata kind can be registered only once.
|
||||
unsigned MetadataContext::registerMDKind(const StringRef Name) {
|
||||
unsigned MetadataContext::registerMDKind(StringRef Name) {
|
||||
assert(isValidName(Name) && "Invalid custome metadata name!");
|
||||
unsigned Count = MDHandlerNames.size();
|
||||
assert(MDHandlerNames.count(Name) == 0 && "Already registered MDKind!");
|
||||
@ -194,7 +194,7 @@ unsigned MetadataContext::registerMDKind(const StringRef Name) {
|
||||
}
|
||||
|
||||
/// isValidName - Return true if Name is a valid custom metadata handler name.
|
||||
bool MetadataContext::isValidName(const StringRef MDName) {
|
||||
bool MetadataContext::isValidName(StringRef MDName) {
|
||||
if (MDName.empty())
|
||||
return false;
|
||||
|
||||
@ -211,7 +211,7 @@ bool MetadataContext::isValidName(const StringRef MDName) {
|
||||
|
||||
/// getMDKind - Return metadata kind. If the requested metadata kind
|
||||
/// is not registered then return 0.
|
||||
unsigned MetadataContext::getMDKind(const StringRef Name) const {
|
||||
unsigned MetadataContext::getMDKind(StringRef Name) const {
|
||||
StringMap<unsigned>::const_iterator I = MDHandlerNames.find(Name);
|
||||
if (I == MDHandlerNames.end()) {
|
||||
assert(isValidName(Name) && "Invalid custome metadata name!");
|
||||
|
Loading…
Reference in New Issue
Block a user