Remove duplicated code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98156 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-03-10 16:04:20 +00:00
parent a2f767b1a7
commit 48ee0bbb72
2 changed files with 4 additions and 11 deletions

View File

@ -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(); }

View File

@ -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.
//