summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
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.cpp
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.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DIE.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
index d6caef7e5b8..0b154123315 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -24,6 +24,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormattedStream.h"
+#include "llvm/Support/MD5.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -323,6 +324,29 @@ void DIEDelta::print(raw_ostream &O) const {
#endif
//===----------------------------------------------------------------------===//
+// DIEString Implementation
+//===----------------------------------------------------------------------===//
+
+/// EmitValue - Emit string value.
+///
+void DIEString::EmitValue(AsmPrinter *AP, unsigned Form) const {
+ Access->EmitValue(AP, Form);
+}
+
+/// SizeOf - Determine size of delta value in bytes.
+///
+unsigned DIEString::SizeOf(AsmPrinter *AP, unsigned Form) const {
+ return Access->SizeOf(AP, Form);
+}
+
+#ifndef NDEBUG
+void DIEString::print(raw_ostream &O) const {
+ O << "String: " << Str << "\tSymbol: ";
+ Access->print(O);
+}
+#endif
+
+//===----------------------------------------------------------------------===//
// DIEEntry Implementation
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud