[Orc] Include <system_error> in OrcTargetClient.
[oota-llvm.git] / tools / llvm-pdbdump / LinePrinter.h
index 0f66d1f7c85fbc526ee820a00439bc865a52b7fe..b0a9d2cfc4e82ad97c455292d3167e2f564573b3 100644 (file)
 #ifndef LLVM_TOOLS_LLVMPDBDUMP_LINEPRINTER_H
 #define LLVM_TOOLS_LLVMPDBDUMP_LINEPRINTER_H
 
+#include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Regex.h"
+
+#include <list>
 
 namespace llvm {
 
@@ -23,15 +27,34 @@ public:
 
   void Indent();
   void Unindent();
-
   void NewLine();
 
   raw_ostream &getStream() { return OS; }
+  int getIndentLevel() const { return CurrentIndent; }
+
+  bool IsTypeExcluded(llvm::StringRef TypeName);
+  bool IsSymbolExcluded(llvm::StringRef SymbolName);
+  bool IsCompilandExcluded(llvm::StringRef CompilandName);
 
 private:
+  template <typename Iter>
+  void SetFilters(std::list<Regex> &List, Iter Begin, Iter End) {
+    List.clear();
+    for (; Begin != End; ++Begin)
+      List.emplace_back(StringRef(*Begin));
+  }
+
   raw_ostream &OS;
   int IndentSpaces;
   int CurrentIndent;
+
+  std::list<Regex> ExcludeCompilandFilters;
+  std::list<Regex> ExcludeTypeFilters;
+  std::list<Regex> ExcludeSymbolFilters;
+
+  std::list<Regex> IncludeCompilandFilters;
+  std::list<Regex> IncludeTypeFilters;
+  std::list<Regex> IncludeSymbolFilters;
 };
 
 template <class T>
@@ -50,6 +73,7 @@ enum class PDB_ColorItem {
   Path,
   SectionHeader,
   LiteralValue,
+  Register,
 };
 
 class WithColor {
@@ -60,8 +84,7 @@ public:
   raw_ostream &get() { return OS; }
 
 private:
-  void translateColor(PDB_ColorItem C, raw_ostream::Colors &Color,
-                      bool &Bold) const;
+  void applyColor(PDB_ColorItem C);
   raw_ostream &OS;
 };
 }