mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
IR: Make MDString inherit from Metadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
848d9223c5
commit
6bc59dcccb
@ -45,7 +45,7 @@ protected:
|
||||
|
||||
public:
|
||||
static bool classof(const Value *V) {
|
||||
return V->getValueID() == MDNodeVal;
|
||||
return V->getValueID() == MDNodeVal || V->getValueID() == MDStringVal;
|
||||
}
|
||||
};
|
||||
|
||||
@ -54,15 +54,14 @@ public:
|
||||
///
|
||||
/// These are used to efficiently contain a byte sequence for metadata.
|
||||
/// MDString is always unnamed.
|
||||
///
|
||||
/// TODO: Inherit from Metadata.
|
||||
class MDString : public Value {
|
||||
class MDString : public Metadata {
|
||||
friend class StringMapEntry<MDString>;
|
||||
|
||||
virtual void anchor();
|
||||
MDString(const MDString &) LLVM_DELETED_FUNCTION;
|
||||
|
||||
explicit MDString(LLVMContext &C);
|
||||
explicit MDString(LLVMContext &Context)
|
||||
: Metadata(Context, Value::MDStringVal) {}
|
||||
|
||||
/// \brief Shadow Value::getName() to prevent its use.
|
||||
StringRef getName() const LLVM_DELETED_FUNCTION;
|
||||
|
@ -37,9 +37,6 @@ Metadata::Metadata(LLVMContext &Context, unsigned ID)
|
||||
|
||||
void MDString::anchor() { }
|
||||
|
||||
MDString::MDString(LLVMContext &C)
|
||||
: Value(Type::getMetadataTy(C), Value::MDStringVal) {}
|
||||
|
||||
MDString *MDString::get(LLVMContext &Context, StringRef Str) {
|
||||
auto &Store = Context.pImpl->MDStringCache;
|
||||
auto I = Store.find(Str);
|
||||
|
Loading…
Reference in New Issue
Block a user