[llvm-pdbdump] Add regex-based filtering.
llvm-svn: 230888
diff --git a/llvm/tools/llvm-pdbdump/CompilandDumper.cpp b/llvm/tools/llvm-pdbdump/CompilandDumper.cpp
index e15384c..14197a8 100644
--- a/llvm/tools/llvm-pdbdump/CompilandDumper.cpp
+++ b/llvm/tools/llvm-pdbdump/CompilandDumper.cpp
@@ -47,6 +47,9 @@
void CompilandDumper::start(const PDBSymbolCompiland &Symbol, raw_ostream &OS,
int Indent, bool Children) {
std::string FullName = Symbol.getName();
+ if (Printer.IsCompilandExcluded(FullName))
+ return;
+
Printer.NewLine();
WithColor(Printer, PDB_ColorItem::Path).get() << FullName;
if (!Children)
@@ -61,6 +64,9 @@
void CompilandDumper::dump(const PDBSymbolData &Symbol, raw_ostream &OS,
int Indent) {
+ if (Printer.IsSymbolExcluded(Symbol.getName()))
+ return;
+
Printer.NewLine();
switch (auto LocType = Symbol.getLocationType()) {
@@ -86,6 +92,8 @@
int Indent) {
if (Symbol.getLength() == 0)
return;
+ if (Printer.IsSymbolExcluded(Symbol.getName()))
+ return;
Printer.NewLine();
FunctionDumper Dumper(Printer);
@@ -94,6 +102,9 @@
void CompilandDumper::dump(const PDBSymbolLabel &Symbol, raw_ostream &OS,
int Indent) {
+ if (Printer.IsSymbolExcluded(Symbol.getName()))
+ return;
+
Printer.NewLine();
Printer << "label ";
WithColor(Printer, PDB_ColorItem::Address).get()
@@ -103,6 +114,9 @@
void CompilandDumper::dump(const PDBSymbolThunk &Symbol, raw_ostream &OS,
int Indent) {
+ if (Printer.IsSymbolExcluded(Symbol.getName()))
+ return;
+
Printer.NewLine();
Printer << "thunk ";
PDB_ThunkOrdinal Ordinal = Symbol.getThunkOrdinal();