From 68afdc3ab08975569e59cc8c04c2db9e9478a996 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 5 Jan 2009 18:33:01 +0000 Subject: Construct array/vector type DIEs using DebugInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61724 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/DebugInfo.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'include/llvm') diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index e9a7cb1..fac86b3 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -86,6 +86,15 @@ namespace llvm { unsigned getAnchorTag() const { return getUnsignedField(1); } }; + + /// DISubrange - This is used to represent ranges, for array bounds. + class DISubrange : public DIDescriptor { + public: + explicit DISubrange(GlobalVariable *GV = 0); + + int64_t getLo() const { return (int64_t)getUInt64Field(1); } + int64_t getHi() const { return (int64_t)getUInt64Field(2); } + }; /// DIArray - This descriptor holds an array of descriptors. class DIArray : public DIDescriptor { @@ -93,7 +102,9 @@ namespace llvm { explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {} unsigned getNumElements() const; - DIDescriptor getElement(unsigned Idx) const; + DISubrange getElement(unsigned Idx) const { + return getFieldAs(Idx); + } }; /// DICompileUnit - A wrapper for a compile unit. @@ -118,15 +129,6 @@ namespace llvm { uint64_t getLanguage() const { return getUInt64Field(2); } }; - /// DISubrange - This is used to represent ranges, for array bounds. - class DISubrange : public DIDescriptor { - public: - explicit DISubrange(GlobalVariable *GV = 0); - - int64_t getLo() const { return (int64_t)getUInt64Field(1); } - int64_t getHi() const { return (int64_t)getUInt64Field(2); } - }; - /// DIType - This is a wrapper for a type. /// FIXME: Types should be factored much better so that CV qualifiers and /// others do not require a huge and empty descriptor full of zeros. -- cgit v1.1