mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
[Debug Info] add DISubroutineType and its creation takes DITypeArray.
DITypeArray is an array of DITypeRef, at its creation, we will create DITypeRef (i.e use the identifier if the type node has an identifier). This is the last patch to unique the type array of a subroutine type. rdar://17628609 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -127,6 +127,7 @@ public:
|
||||
|
||||
bool isDerivedType() const;
|
||||
bool isCompositeType() const;
|
||||
bool isSubroutineType() const;
|
||||
bool isBasicType() const;
|
||||
bool isTrivialType() const;
|
||||
bool isVariable() const;
|
||||
@@ -430,7 +431,10 @@ class DICompositeType : public DIDerivedType {
|
||||
public:
|
||||
explicit DICompositeType(const MDNode *N = nullptr) : DIDerivedType(N) {}
|
||||
|
||||
DIArray getElements() const { return getFieldAs<DIArray>(10); }
|
||||
DIArray getElements() const {
|
||||
assert(!isSubroutineType() && "no elements for DISubroutineType");
|
||||
return getFieldAs<DIArray>(10);
|
||||
}
|
||||
template <typename T>
|
||||
void setArrays(DITypedArray<T> Elements, DIArray TParams = DIArray()) {
|
||||
assert((!TParams || DbgNode->getNumOperands() == 15) &&
|
||||
@@ -448,6 +452,14 @@ public:
|
||||
bool Verify() const;
|
||||
};
|
||||
|
||||
class DISubroutineType : public DICompositeType {
|
||||
public:
|
||||
explicit DISubroutineType(const MDNode *N = nullptr) : DICompositeType(N) {}
|
||||
DITypedArray<DITypeRef> getTypeArray() const {
|
||||
return getFieldAs<DITypedArray<DITypeRef>>(10);
|
||||
}
|
||||
};
|
||||
|
||||
/// DIFile - This is a wrapper for a file.
|
||||
class DIFile : public DIScope {
|
||||
friend class DIDescriptor;
|
||||
@@ -501,7 +513,7 @@ public:
|
||||
StringRef getDisplayName() const { return getStringField(4); }
|
||||
StringRef getLinkageName() const { return getStringField(5); }
|
||||
unsigned getLineNumber() const { return getUnsignedField(6); }
|
||||
DICompositeType getType() const { return getFieldAs<DICompositeType>(7); }
|
||||
DISubroutineType getType() const { return getFieldAs<DISubroutineType>(7); }
|
||||
|
||||
/// isLocalToUnit - Return true if this subprogram is local to the current
|
||||
/// compile unit, like 'static' in C.
|
||||
|
Reference in New Issue
Block a user