mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-10 02:38:50 +00:00
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:
parent
a2f767b1a7
commit
48ee0bbb72
@ -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…
x
Reference in New Issue
Block a user