summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DIE.h
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-07-26 17:02:41 +0000
committerEric Christopher <echristo@gmail.com>2013-07-26 17:02:41 +0000
commit67646438c912b9cc69724729ec7bfec0b144cc90 (patch)
treee9a9708ec001b899aa1be05e67c4c97b687ce364 /llvm/lib/CodeGen/AsmPrinter/DIE.h
parentfeea95c88468cadbbed4ca0526826a7d279f2f7d (diff)
downloadbcm5719-llvm-67646438c912b9cc69724729ec7bfec0b144cc90.tar.gz
bcm5719-llvm-67646438c912b9cc69724729ec7bfec0b144cc90.zip
Add preliminary support for hashing DIEs and breaking them into
type units. Initially this support is used in the computation of an ODR checker for C++. For now we're attaching it to the DIE, but in the future it will be attached to the type unit. This also starts breaking out types into the separation for type units, but without actually splitting the DIEs. In preparation for hashing the DIEs this adds a DIEString type that contains a StringRef with the string contained at the label. llvm-svn: 187213
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DIE.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DIE.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.h b/llvm/lib/CodeGen/AsmPrinter/DIE.h
index 3b04e206254..e2f49d64bee 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.h
@@ -346,6 +346,36 @@ namespace llvm {
};
//===--------------------------------------------------------------------===//
+ /// DIEString - A container for string values.
+ ///
+ class DIEString : public DIEValue {
+ const DIEValue *Access;
+ const StringRef Str;
+
+ public:
+ DIEString(const DIEValue *Acc, const StringRef S)
+ : DIEValue(isString), Access(Acc), Str(S) {}
+
+ /// getString - Grab the string out of the object.
+ StringRef getString() const { return Str; }
+
+ /// EmitValue - Emit delta value.
+ ///
+ virtual void EmitValue(AsmPrinter *AP, unsigned Form) const;
+
+ /// SizeOf - Determine size of delta value in bytes.
+ ///
+ virtual unsigned SizeOf(AsmPrinter *AP, unsigned Form) const;
+
+ // Implement isa/cast/dyncast.
+ static bool classof(const DIEValue *D) { return D->getType() == isString; }
+
+ #ifndef NDEBUG
+ virtual void print(raw_ostream &O) const;
+ #endif
+ };
+
+ //===--------------------------------------------------------------------===//
/// DIEEntry - A pointer to another debug information entry. An instance of
/// this class can also be used as a proxy for a debug information entry not
/// yet defined (ie. types.)
OpenPOWER on IntegriCloud