mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
DI: Use Metadata for DITypeRef and DIScopeRef
Now that `MDString` and `MDNode` have a common base class, use it. Note that it's not useful to assume subclasses of `Metadata` must be one or the other since we'll be adding more subclasses soon enough. Part of PR21532. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222064 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -39,6 +39,7 @@ class Value;
|
||||
class DbgDeclareInst;
|
||||
class DbgValueInst;
|
||||
class Instruction;
|
||||
class Metadata;
|
||||
class MDNode;
|
||||
class MDString;
|
||||
class NamedMDNode;
|
||||
@@ -333,13 +334,13 @@ template <typename T> class DIRef {
|
||||
/// \brief Val can be either a MDNode or a MDString.
|
||||
///
|
||||
/// In the latter, MDString specifies the type identifier.
|
||||
const Value *Val;
|
||||
explicit DIRef(const Value *V);
|
||||
const Metadata *Val;
|
||||
explicit DIRef(const Metadata *V);
|
||||
|
||||
public:
|
||||
T resolve(const DITypeIdentifierMap &Map) const;
|
||||
StringRef getName() const;
|
||||
operator Value *() const { return const_cast<Value *>(Val); }
|
||||
operator Metadata *() const { return const_cast<Metadata *>(Val); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@@ -373,12 +374,12 @@ template <typename T> StringRef DIRef<T>::getName() const {
|
||||
/// \brief Handle fields that are references to DIScopes.
|
||||
template <> DIScopeRef DIDescriptor::getFieldAs<DIScopeRef>(unsigned Elt) const;
|
||||
/// \brief Specialize DIRef constructor for DIScopeRef.
|
||||
template <> DIRef<DIScope>::DIRef(const Value *V);
|
||||
template <> DIRef<DIScope>::DIRef(const Metadata *V);
|
||||
|
||||
/// \brief Handle fields that are references to DITypes.
|
||||
template <> DITypeRef DIDescriptor::getFieldAs<DITypeRef>(unsigned Elt) const;
|
||||
/// \brief Specialize DIRef constructor for DITypeRef.
|
||||
template <> DIRef<DIType>::DIRef(const Value *V);
|
||||
template <> DIRef<DIType>::DIRef(const Metadata *V);
|
||||
|
||||
/// \briefThis is a wrapper for a type.
|
||||
///
|
||||
|
Reference in New Issue
Block a user