aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineDebugInfo.h
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-02-24 16:46:40 +0000
committerJim Laskey <jlaskey@mac.com>2006-02-24 16:46:40 +0000
commit6990600f93c212bd73623d523eb8f53ae0b6eee5 (patch)
tree260d82f54c0f8bcb48647e6b521d7fb74663e01b /include/llvm/CodeGen/MachineDebugInfo.h
parent7e88103cdea8c36b2229dae8c60def14e3816512 (diff)
Add pointer and reference types. Added short-term code to ignore NULL types
(to allow llvm-gcc4 to build.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineDebugInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineDebugInfo.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/include/llvm/CodeGen/MachineDebugInfo.h b/include/llvm/CodeGen/MachineDebugInfo.h
index b27c0ab300..b51ea64689 100644
--- a/include/llvm/CodeGen/MachineDebugInfo.h
+++ b/include/llvm/CodeGen/MachineDebugInfo.h
@@ -64,7 +64,9 @@ enum {
DI_TAG_global_variable,
DI_TAG_subprogram,
DI_TAG_basictype,
- DI_TAG_typedef
+ DI_TAG_typedef,
+ DI_TAG_pointer,
+ DI_TAG_reference
};
//===----------------------------------------------------------------------===//
@@ -283,8 +285,10 @@ public:
class TypeDesc : public DebugInfoDesc {
private:
DebugInfoDesc *Context; // Context debug descriptor.
- std::string Name; // Type name.
- uint64_t Size; // Type size.
+ std::string Name; // Type name (may be empty.)
+ CompileUnitDesc *File; // Declared compile unit (may be NULL.)
+ int Line; // Declared line# (may be zero.)
+ uint64_t Size; // Type size (may be zero.)
protected:
TypeDesc(unsigned T);
@@ -293,9 +297,13 @@ public:
// Accessors
DebugInfoDesc *getContext() const { return Context; }
const std::string &getName() const { return Name; }
+ CompileUnitDesc *getFile() const { return File; }
+ int getLine() const { return Line; }
uint64_t getSize() const { return Size; }
void setContext(DebugInfoDesc *C) { Context = C; }
void setName(const std::string &N) { Name = N; }
+ void setFile(CompileUnitDesc *U) { File = U; }
+ void setLine(int L) { Line = L; }
void setSize(uint64_t S) { Size = S; }
/// ApplyToFields - Target the visitor to the fields of the TypeDesc.
@@ -346,32 +354,27 @@ public:
//===----------------------------------------------------------------------===//
-/// TypedefDesc - This class packages debug information associated with a
-/// derived typedef.
-class TypedefDesc : public TypeDesc {
+/// DerivedTypeDesc - This class packages debug information associated with a
+/// derived types (eg., typedef, pointer, reference.)
+class DerivedTypeDesc : public TypeDesc {
private:
TypeDesc *FromType; // Type derived from.
- CompileUnitDesc *File; // Declared compile unit.
- int Line; // Declared line#.
public:
- TypedefDesc();
+ DerivedTypeDesc(unsigned T);
// Accessors
TypeDesc *getFromType() const { return FromType; }
- CompileUnitDesc *getFile() const { return File; }
- int getLine() const { return Line; }
void setFromType(TypeDesc *F) { FromType = F; }
- void setFile(CompileUnitDesc *U) { File = U; }
- void setLine(int L) { Line = L; }
// Implement isa/cast/dyncast.
- static bool classof(const TypedefDesc *) { return true; }
+ static bool classof(const DerivedTypeDesc *) { return true; }
static bool classof(const DebugInfoDesc *D) {
- return D->getTag() == DI_TAG_typedef;
+ unsigned T = D->getTag();
+ return T == DI_TAG_typedef || T == DI_TAG_pointer || T == DI_TAG_reference;
}
- /// ApplyToFields - Target the visitor to the fields of the TypedefDesc.
+ /// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc.
///
virtual void ApplyToFields(DIVisitor *Visitor);