1 //===- LinePrinter.h ------------------------------------------ *- C++ --*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_LINEPRINTER_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_LINEPRINTER_H
13 #include "llvm/ADT/Twine.h"
14 #include "llvm/Support/raw_ostream.h"
15 #include "llvm/Support/Regex.h"
22 friend class WithColor;
25 LinePrinter(int Indent, raw_ostream &Stream);
27 template <typename Iter> void SetTypeFilters(Iter Begin, Iter End) {
28 TypeFilters.assign(Begin, End);
30 template <typename Iter> void SetSymbolFilters(Iter Begin, Iter End) {
31 SymbolFilters.assign(Begin, End);
33 template <typename Iter> void SetCompilandFilters(Iter Begin, Iter End) {
34 CompilandFilters.assign(Begin, End);
41 raw_ostream &getStream() { return OS; }
43 bool IsTypeExcluded(llvm::StringRef TypeName);
44 bool IsSymbolExcluded(llvm::StringRef SymbolName);
45 bool IsCompilandExcluded(llvm::StringRef CompilandName);
52 std::list<Regex> CompilandFilters;
53 std::list<Regex> TypeFilters;
54 std::list<Regex> SymbolFilters;
58 inline raw_ostream &operator<<(LinePrinter &Printer, const T &Item) {
59 Printer.getStream() << Item;
60 return Printer.getStream();
63 enum class PDB_ColorItem {
77 WithColor(LinePrinter &P, PDB_ColorItem C);
80 raw_ostream &get() { return OS; }
83 void translateColor(PDB_ColorItem C, raw_ostream::Colors &Color,