summaryrefslogtreecommitdiffstats
path: root/tools/llvm-readobj/StreamWriter.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-readobj/StreamWriter.h')
-rw-r--r--tools/llvm-readobj/StreamWriter.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/llvm-readobj/StreamWriter.h b/tools/llvm-readobj/StreamWriter.h
index 129f6e7..c40077a 100644
--- a/tools/llvm-readobj/StreamWriter.h
+++ b/tools/llvm-readobj/StreamWriter.h
@@ -11,8 +11,8 @@
#define LLVM_READOBJ_STREAMWRITER_H
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/raw_ostream.h"
@@ -172,6 +172,19 @@ public:
startLine() << Label << ": " << int(Value) << "\n";
}
+ template <typename T_>
+ void printList(StringRef Label, const SmallVectorImpl<T_> &List) {
+ startLine() << Label << ": [";
+ bool Comma = false;
+ for (unsigned LI = 0, LE = List.size(); LI != LE; ++LI) {
+ if (Comma)
+ OS << ", ";
+ OS << List[LI];
+ Comma = true;
+ }
+ OS << "]\n";
+ }
+
template<typename T>
void printHex(StringRef Label, T Value) {
startLine() << Label << ": " << hex(Value) << "\n";