Move to llvm-readobj code that is only used there.
[oota-llvm.git] / include / llvm / Object / SymbolicFile.h
index 537997ac63183e598bc390e2376bd609c0530210..6b10ceb263acb875ef6150e8bb279a526a8998bb 100644 (file)
@@ -15,6 +15,7 @@
 #define LLVM_OBJECT_SYMBOLICFILE_H
 
 #include "llvm/Object/Binary.h"
+#include "llvm/Support/Format.h"
 
 namespace llvm {
 namespace object {
@@ -29,6 +30,12 @@ union DataRefImpl {
   DataRefImpl() { std::memset(this, 0, sizeof(DataRefImpl)); }
 };
 
+template <typename OStream>
+OStream& operator<<(OStream &OS, const DataRefImpl &D) {
+  OS << "(" << format("0x%x8", D.p) << " (" << format("0x%x8", D.d.a) << ", " << format("0x%x8", D.d.b) << "))";
+  return OS;
+}
+
 inline bool operator==(const DataRefImpl &a, const DataRefImpl &b) {
   // Check bitwise identical. This is the only legal way to compare a union w/o
   // knowing which member is in use.