diff options
author | Eric Christopher <echristo@gmail.com> | 2013-07-26 17:02:41 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-07-26 17:02:41 +0000 |
commit | 3dee575b8dfe9c3d89f581e51dd11ddd08c43cd6 (patch) | |
tree | 8559512eff23c3111d0e179fd5a1f8bc4167dc13 /lib/CodeGen/AsmPrinter/DIE.h | |
parent | 956e5aa3bd32212c6902a585a367dbf58d685340 (diff) | |
download | llvm-3dee575b8dfe9c3d89f581e51dd11ddd08c43cd6.tar.gz llvm-3dee575b8dfe9c3d89f581e51dd11ddd08c43cd6.tar.bz2 llvm-3dee575b8dfe9c3d89f581e51dd11ddd08c43cd6.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIE.h')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DIE.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.h b/lib/CodeGen/AsmPrinter/DIE.h index 3b04e20625..e2f49d64be 100644 --- a/lib/CodeGen/AsmPrinter/DIE.h +++ b/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.) |