diff options
author | Devang Patel <dpatel@apple.com> | 2011-02-02 21:38:25 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-02-02 21:38:25 +0000 |
commit | 7e2cb116556e1153401cd6b94d0f51db978f6902 (patch) | |
tree | 12c42fff5a598ca8d3723a8c5787d97cc624f2ed /include | |
parent | 4b720718fbda1194f925e0a9d931bc220e8b0e3a (diff) | |
download | llvm-7e2cb116556e1153401cd6b94d0f51db978f6902.tar.gz llvm-7e2cb116556e1153401cd6b94d0f51db978f6902.tar.bz2 llvm-7e2cb116556e1153401cd6b94d0f51db978f6902.tar.xz |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/DIBuilder.h | 18 | ||||
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 20 |
2 files changed, 37 insertions, 1 deletions
diff --git a/include/llvm/Analysis/DIBuilder.h b/include/llvm/Analysis/DIBuilder.h index 2fb9ed0e96..a948ce2c1d 100644 --- a/include/llvm/Analysis/DIBuilder.h +++ b/include/llvm/Analysis/DIBuilder.h @@ -38,6 +38,7 @@ namespace llvm { class DISubrange; class DILexicalBlock; class DISubprogram; + class DITemplateTypeParameter; class DIBuilder { private: @@ -157,11 +158,13 @@ namespace llvm { /// for this type. This is used in /// DW_AT_containing_type. See DWARF documentation /// for more info. + /// @param TemplateParms Template type parameters. DIType CreateClassType(DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType DerivedFrom, - DIArray Elements, MDNode *VTableHolder = 0); + DIArray Elements, MDNode *VTableHolder = 0, + MDNode *TemplateParms = 0); /// CreateStructType - Create debugging information entry for a struct. /// @param Scope Scope in which this struct is defined. @@ -193,6 +196,19 @@ namespace llvm { uint64_t AlignInBits, unsigned Flags, DIArray Elements, unsigned RunTimeLang = 0); + /// CreateTemplateTypeParameter - Create debugging information for template + /// type parameter. + /// @param Scope Scope in which this type is dfiend + /// @param Name Type parameter name. + /// @param Ty Parameter type. + /// @param File File where this type parameter is defined. + /// @param LineNo Line number. + /// @param ColumnNo Column Number. + DITemplateTypeParameter + CreateTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty, + MDNode *File = 0, unsigned LineNo = 0, + unsigned ColumnNo = 0); + /// CreateArrayType - Create debugging information entry for an array. /// @param Size Array size. /// @param AlignInBits Alignment. diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index f0effb7567..b547263669 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -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: |