Add support to describe template parameter type in debug info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2011-02-02 21:38:25 +00:00
parent 4b720718fb
commit 7e2cb11655
6 changed files with 97 additions and 3 deletions
+20
View File
@@ -122,6 +122,7 @@ namespace llvm {
bool isType() const;
bool isGlobal() const;
bool isUnspecifiedParameter() const;
bool isTemplateTypeParameter() const;
};
/// DISubrange - This is used to represent ranges, for array bounds.
@@ -356,6 +357,7 @@ namespace llvm {
DICompositeType getContainingType() const {
return getFieldAs<DICompositeType>(12);
}
DIArray getTemplateParams() const { return getFieldAs<DIArray>(13); }
/// Verify - Verify that a composite type descriptor is well formed.
bool Verify() const;
@@ -367,6 +369,24 @@ namespace llvm {
void dump() const;
};
/// DITemplateTypeParameter - This is a wrapper for template type parameter.
class DITemplateTypeParameter : public DIDescriptor {
public:
explicit DITemplateTypeParameter(const MDNode *N = 0) : DIDescriptor(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
DIType getType() const { return getFieldAs<DIType>(3); }
StringRef getFilename() const {
return getFieldAs<DIFile>(4).getFilename();
}
StringRef getDirectory() const {
return getFieldAs<DIFile>(4).getDirectory();
}
unsigned getLineNumber() const { return getUnsignedField(5); }
unsigned getColumnNumber() const { return getUnsignedField(6); }
};
/// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
class DISubprogram : public DIScope {
public: