[PATCH] llvm-readobj: COFF/ELF-specific low-level output

Michael Spencer bigcheesegs at gmail.com
Tue Mar 12 12:49:28 PDT 2013


  Looks fine, but Eric and David should make sure the output format is acceptable.


================
Comment at: tools/llvm-readobj/StreamWriter.h:24-25
@@ +23,4 @@
+template<typename T>
+struct EnumEntry
+{
+  StringRef Name;
----------------
No newline before {. Same issue throughout this file.

================
Comment at: tools/llvm-readobj/StreamWriter.h:135-173
@@ +134,41 @@
+
+  void printNumber(StringRef Label, uint64_t Value)
+  {
+    startLine() << Label << ": " << Value << "\n";
+  }
+
+  void printNumber(StringRef Label, uint32_t Value)
+  {
+    startLine() << Label << ": " << Value << "\n";
+  }
+
+  void printNumber(StringRef Label, uint16_t Value)
+  {
+    startLine() << Label << ": " << Value << "\n";
+  }
+
+  void printNumber(StringRef Label, uint8_t Value)
+  {
+    startLine() << Label << ": " << unsigned(Value) << "\n";
+  }
+
+  void printNumber(StringRef Label, int64_t Value)
+  {
+    startLine() << Label << ": " << Value << "\n";
+  }
+
+  void printNumber(StringRef Label, int32_t Value)
+  {
+    startLine() << Label << ": " << Value << "\n";
+  }
+
+  void printNumber(StringRef Label, int16_t Value)
+  {
+    startLine() << Label << ": " << Value << "\n";
+  }
+
+  void printNumber(StringRef Label, int8_t Value)
+  {
+    startLine() << Label << ": " << int(Value) << "\n";
+  }
+
----------------
These don't need to be duplicated.


http://llvm-reviews.chandlerc.com/D416



More information about the llvm-commits mailing list