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.

llvm-svn: 210191

llvm/tools/llvm-readobj/StreamWriter.h

index 9282dcc..04b38fb 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 << ": [";