mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Use StringRef to construct MDString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7f23958aa4
commit
921bdaaa98
@ -57,8 +57,8 @@ class MDString : public MetadataBase {
|
|||||||
|
|
||||||
StringRef Str;
|
StringRef Str;
|
||||||
protected:
|
protected:
|
||||||
explicit MDString(LLVMContext &C, const char *begin, unsigned l)
|
explicit MDString(LLVMContext &C, StringRef S)
|
||||||
: MetadataBase(Type::getMetadataTy(C), Value::MDStringVal), Str(begin, l) {}
|
: MetadataBase(Type::getMetadataTy(C), Value::MDStringVal), Str(S) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static MDString *get(LLVMContext &Context, StringRef Str);
|
static MDString *get(LLVMContext &Context, StringRef Str);
|
||||||
|
@ -33,7 +33,8 @@ MDString *MDString::get(LLVMContext &Context, StringRef Str) {
|
|||||||
MDString *&S = Entry.getValue();
|
MDString *&S = Entry.getValue();
|
||||||
if (S) return S;
|
if (S) return S;
|
||||||
|
|
||||||
return S = new MDString(Context, Entry.getKeyData(), Entry.getKeyLength());
|
return S =
|
||||||
|
new MDString(Context, StringRef(Entry.getKeyData(), Entry.getKeyLength()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user