forked from OSchip/llvm-project
Remove duplicated code. No functionality change.
llvm-svn: 98156
This commit is contained in:
parent
8340cc0d6c
commit
74ca599a73
|
@ -43,8 +43,10 @@ protected:
|
|||
|
||||
public:
|
||||
static MDString *get(LLVMContext &Context, StringRef Str);
|
||||
static MDString *get(LLVMContext &Context, const char *Str);
|
||||
|
||||
static MDString *get(LLVMContext &Context, const char *Str) {
|
||||
return get(Context, Str ? StringRef(Str) : StringRef());
|
||||
}
|
||||
|
||||
StringRef getString() const { return Str; }
|
||||
|
||||
unsigned getLength() const { return (unsigned)Str.size(); }
|
||||
|
|
|
@ -39,15 +39,6 @@ MDString *MDString::get(LLVMContext &Context, StringRef Str) {
|
|||
return S;
|
||||
}
|
||||
|
||||
MDString *MDString::get(LLVMContext &Context, const char *Str) {
|
||||
LLVMContextImpl *pImpl = Context.pImpl;
|
||||
StringMapEntry<MDString *> &Entry =
|
||||
pImpl->MDStringCache.GetOrCreateValue(Str ? StringRef(Str) : StringRef());
|
||||
MDString *&S = Entry.getValue();
|
||||
if (!S) S = new MDString(Context, Entry.getKey());
|
||||
return S;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// MDNodeOperand implementation.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue