summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-02-23 22:37:30 +0000
committerJim Laskey <jlaskey@mac.com>2006-02-23 22:37:30 +0000
commit434b40b42f915822871d26ab3eb13db36d2984a3 (patch)
tree258acf065755368cd4b9899b2730702c2b97afc5 /include
parentd0839f3071f687de505dba26a16c125b10f982ef (diff)
downloadllvm-434b40b42f915822871d26ab3eb13db36d2984a3.tar.gz
llvm-434b40b42f915822871d26ab3eb13db36d2984a3.tar.bz2
llvm-434b40b42f915822871d26ab3eb13db36d2984a3.tar.xz
Added basic support for typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineDebugInfo.h41
1 files changed, 39 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineDebugInfo.h b/include/llvm/CodeGen/MachineDebugInfo.h
index c51b3ea84d..f2119c2c3d 100644
--- a/include/llvm/CodeGen/MachineDebugInfo.h
+++ b/include/llvm/CodeGen/MachineDebugInfo.h
@@ -62,7 +62,8 @@ enum {
DI_TAG_compile_unit,
DI_TAG_global_variable,
DI_TAG_subprogram,
- DI_TAG_basictype
+ DI_TAG_basictype,
+ DI_TAG_typedef
};
//===----------------------------------------------------------------------===//
@@ -342,6 +343,42 @@ public:
#endif
};
+
+//===----------------------------------------------------------------------===//
+/// TypedefDesc - This class packages debug information associated with a
+/// derived typedef.
+class TypedefDesc : public TypeDesc {
+private:
+ TypeDesc *FromType; // Type derived from.
+ CompileUnitDesc *File; // Declared compile unit.
+ int Line; // Declared line#.
+
+public:
+ TypedefDesc();
+
+ // 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 DebugInfoDesc *D) {
+ return D->getTag() == DI_TAG_typedef;
+ }
+
+ /// ApplyToFields - Target the visitor to the fields of the TypedefDesc.
+ ///
+ virtual void ApplyToFields(DIVisitor *Visitor);
+
+#ifndef NDEBUG
+ virtual void dump();
+#endif
+};
+
//===----------------------------------------------------------------------===//
/// GlobalDesc - This class is the base descriptor for global functions and
/// variables.
@@ -712,7 +749,7 @@ public:
getGlobalVariablesUsing(M, Desc.getAnchorString());
std::vector<T *> AnchoredDescs;
for (unsigned i = 0, N = Globals.size(); i < N; ++i) {
- AnchoredDescs.push_back(static_cast<T *>(DR.Deserialize(Globals[i])));
+ AnchoredDescs.push_back(cast<T>(DR.Deserialize(Globals[i])));
}
return AnchoredDescs;