tools: introduce StreamWriter::printBoolean
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 4 Jun 2014 15:47:11 +0000 (15:47 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 4 Jun 2014 15:47:11 +0000 (15:47 +0000)
Add a helper print method to print a boolean value as "Yes" or "No".  This is
intended to be used by the Windows ARM EH printer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210191 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-readobj/StreamWriter.h

index 9282dcc91a8b01bd933b954cec499b61f7e4a006..04b38fbe25ea087d901748f89384341a8d4d6bf2 100644 (file)
@@ -169,6 +169,10 @@ public:
     startLine() << Label << ": " << int(Value) << "\n";
   }
 
+  void printBoolean(StringRef Label, bool Value) {
+    startLine() << Label << ": " << (Value ? "Yes" : "No") << '\n';
+  }
+
   template <typename T_>
   void printList(StringRef Label, const SmallVectorImpl<T_> &List) {
     startLine() << Label << ": [";