mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +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;
|
||||
protected:
|
||||
explicit MDString(LLVMContext &C, const char *begin, unsigned l)
|
||||
: MetadataBase(Type::getMetadataTy(C), Value::MDStringVal), Str(begin, l) {}
|
||||
explicit MDString(LLVMContext &C, StringRef S)
|
||||
: MetadataBase(Type::getMetadataTy(C), Value::MDStringVal), Str(S) {}
|
||||
|
||||
public:
|
||||
static MDString *get(LLVMContext &Context, StringRef Str);
|
||||
|
@ -33,7 +33,8 @@ MDString *MDString::get(LLVMContext &Context, StringRef Str) {
|
||||
MDString *&S = Entry.getValue();
|
||||
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