summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/VariableDumper.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-03-01 06:51:29 +0000
committerZachary Turner <zturner@google.com>2015-03-01 06:51:29 +0000
commitb52d08d9dd04e6b9a488530d25c1be5f8d8de012 (patch)
treed84c73ba4956f3a40b1027c8f9b053f2ef9d646c /llvm/tools/llvm-pdbdump/VariableDumper.cpp
parentf5abda2a2f9213e1468c965a59b94382feaa9d9e (diff)
downloadbcm5719-llvm-b52d08d9dd04e6b9a488530d25c1be5f8d8de012.tar.gz
bcm5719-llvm-b52d08d9dd04e6b9a488530d25c1be5f8d8de012.zip
[llvm-pdbdump] Clean up method signatures.
llvm-svn: 230889
Diffstat (limited to 'llvm/tools/llvm-pdbdump/VariableDumper.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/VariableDumper.cpp47
1 files changed, 20 insertions, 27 deletions
diff --git a/llvm/tools/llvm-pdbdump/VariableDumper.cpp b/llvm/tools/llvm-pdbdump/VariableDumper.cpp
index ec72d16fef9..d520fd10099 100644
--- a/llvm/tools/llvm-pdbdump/VariableDumper.cpp
+++ b/llvm/tools/llvm-pdbdump/VariableDumper.cpp
@@ -30,8 +30,7 @@ using namespace llvm;
VariableDumper::VariableDumper(LinePrinter &P)
: PDBSymDumper(true), Printer(P) {}
-void VariableDumper::start(const PDBSymbolData &Var, raw_ostream &OS,
- int Indent) {
+void VariableDumper::start(const PDBSymbolData &Var) {
if (Printer.IsSymbolExcluded(Var.getName()))
return;
@@ -45,11 +44,11 @@ void VariableDumper::start(const PDBSymbolData &Var, raw_ostream &OS,
WithColor(Printer, PDB_ColorItem::Address).get()
<< "[" << format_hex(Var.getRelativeVirtualAddress(), 10) << "] ";
WithColor(Printer, PDB_ColorItem::Keyword).get() << "static ";
- dumpSymbolTypeAndName(*VarType, Var.getName(), OS);
+ dumpSymbolTypeAndName(*VarType, Var.getName());
break;
case PDB_LocType::Constant:
WithColor(Printer, PDB_ColorItem::Keyword).get() << "const ";
- dumpSymbolTypeAndName(*VarType, Var.getName(), OS);
+ dumpSymbolTypeAndName(*VarType, Var.getName());
Printer << "[";
WithColor(Printer, PDB_ColorItem::LiteralValue).get() << Var.getValue();
Printer << "]";
@@ -57,31 +56,27 @@ void VariableDumper::start(const PDBSymbolData &Var, raw_ostream &OS,
case PDB_LocType::ThisRel:
WithColor(Printer, PDB_ColorItem::Offset).get()
<< "+" << format_hex(Var.getOffset(), 4) << " ";
- dumpSymbolTypeAndName(*VarType, Var.getName(), OS);
+ dumpSymbolTypeAndName(*VarType, Var.getName());
break;
default:
- OS << "unknown(" << LocType << ") ";
+ Printer << "unknown(" << LocType << ") ";
WithColor(Printer, PDB_ColorItem::Identifier).get() << Var.getName();
break;
}
}
-void VariableDumper::dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
- int Indent) {
+void VariableDumper::dump(const PDBSymbolTypeBuiltin &Symbol) {
BuiltinDumper Dumper(Printer);
- Dumper.start(Symbol, OS);
+ Dumper.start(Symbol);
}
-void VariableDumper::dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
- int Indent) {
+void VariableDumper::dump(const PDBSymbolTypeEnum &Symbol) {
WithColor(Printer, PDB_ColorItem::Type).get() << Symbol.getName();
}
-void VariableDumper::dump(const PDBSymbolTypeFunctionSig &Symbol,
- raw_ostream &OS, int Indent) {}
+void VariableDumper::dump(const PDBSymbolTypeFunctionSig &Symbol) {}
-void VariableDumper::dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
- int Indent) {
+void VariableDumper::dump(const PDBSymbolTypePointer &Symbol) {
auto PointeeType = Symbol.getPointeeType();
if (!PointeeType)
return;
@@ -91,30 +86,28 @@ void VariableDumper::dump(const PDBSymbolTypePointer &Symbol, raw_ostream &OS,
FunctionDumper::PointerType Pointer =
Symbol.isReference() ? FunctionDumper::PointerType::Reference
: FunctionDumper::PointerType::Pointer;
- NestedDumper.start(*Func, Pointer, OS, Indent);
+ NestedDumper.start(*Func, Pointer);
} else {
if (Symbol.isConstType())
WithColor(Printer, PDB_ColorItem::Keyword).get() << "const ";
if (Symbol.isVolatileType())
WithColor(Printer, PDB_ColorItem::Keyword).get() << "volatile ";
- PointeeType->dump(OS, Indent, *this);
+ PointeeType->dump(*this);
Printer << (Symbol.isReference() ? "&" : "*");
}
}
-void VariableDumper::dump(const PDBSymbolTypeTypedef &Symbol, raw_ostream &OS,
- int Indent) {
+void VariableDumper::dump(const PDBSymbolTypeTypedef &Symbol) {
WithColor(Printer, PDB_ColorItem::Keyword).get() << "typedef ";
WithColor(Printer, PDB_ColorItem::Type).get() << Symbol.getName();
}
-void VariableDumper::dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,
- int Indent) {
+void VariableDumper::dump(const PDBSymbolTypeUDT &Symbol) {
WithColor(Printer, PDB_ColorItem::Type).get() << Symbol.getName();
}
void VariableDumper::dumpSymbolTypeAndName(const PDBSymbol &Type,
- StringRef Name, raw_ostream &OS) {
+ StringRef Name) {
if (auto *ArrayType = dyn_cast<PDBSymbolTypeArray>(&Type)) {
std::string IndexSpec;
raw_string_ostream IndexStream(IndexSpec);
@@ -126,19 +119,19 @@ void VariableDumper::dumpSymbolTypeAndName(const PDBSymbol &Type,
ElementType = NestedArray->getElementType();
}
IndexStream << "[" << ArrayType->getCount() << "]";
- ElementType->dump(OS, 0, *this);
+ ElementType->dump(*this);
WithColor(Printer, PDB_ColorItem::Identifier).get() << " " << Name;
Printer << IndexStream.str();
} else {
- if (!tryDumpFunctionPointer(Type, Name, OS)) {
- Type.dump(OS, 0, *this);
+ if (!tryDumpFunctionPointer(Type, Name)) {
+ Type.dump(*this);
WithColor(Printer, PDB_ColorItem::Identifier).get() << " " << Name;
}
}
}
bool VariableDumper::tryDumpFunctionPointer(const PDBSymbol &Type,
- StringRef Name, raw_ostream &OS) {
+ StringRef Name) {
// Function pointers come across as pointers to function signatures. But the
// signature carries no name, so we have to handle this case separately.
if (auto *PointerType = dyn_cast<PDBSymbolTypePointer>(&Type)) {
@@ -150,7 +143,7 @@ bool VariableDumper::tryDumpFunctionPointer(const PDBSymbol &Type,
if (PointerType->isReference())
PT = FunctionDumper::PointerType::Reference;
std::string NameStr(Name.begin(), Name.end());
- Dumper.start(*FunctionSig, NameStr.c_str(), PT, OS);
+ Dumper.start(*FunctionSig, NameStr.c_str(), PT);
return true;
}
}
OpenPOWER on IntegriCloud