summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/VariableDumper.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-03-04 06:09:53 +0000
committerZachary Turner <zturner@google.com>2015-03-04 06:09:53 +0000
commit653236596af12b89fd3701f86b160a850ddcff21 (patch)
tree189942c606d6e482acf91a3e87e215cca748b31e /llvm/tools/llvm-pdbdump/VariableDumper.cpp
parent90746340029f43ac3bfd53a08175b92082e26cfd (diff)
downloadbcm5719-llvm-653236596af12b89fd3701f86b160a850ddcff21.tar.gz
bcm5719-llvm-653236596af12b89fd3701f86b160a850ddcff21.zip
[llvm-pdbdump] Display full enum definitions.
This will now display enum definitions both at the global scope as well as nested inside of classes. Additionally, it will no longer display enums at the global scope if the enum is nested. Instead, it will omit the definition of the enum globally and instead emit it in the corresponding class definition. llvm-svn: 231215
Diffstat (limited to 'llvm/tools/llvm-pdbdump/VariableDumper.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/VariableDumper.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/tools/llvm-pdbdump/VariableDumper.cpp b/llvm/tools/llvm-pdbdump/VariableDumper.cpp
index a46e1b0c4e9..030610c8c58 100644
--- a/llvm/tools/llvm-pdbdump/VariableDumper.cpp
+++ b/llvm/tools/llvm-pdbdump/VariableDumper.cpp
@@ -17,6 +17,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
@@ -36,14 +37,12 @@ void VariableDumper::start(const PDBSymbolData &Var) {
if (Printer.IsSymbolExcluded(Var.getName()))
return;
- Printer.NewLine();
- Printer << "data ";
-
auto VarType = Var.getType();
switch (auto LocType = Var.getLocationType()) {
case PDB_LocType::Static:
- Printer << "[";
+ Printer.NewLine();
+ Printer << "data [";
WithColor(Printer, PDB_ColorItem::Address).get()
<< format_hex(Var.getRelativeVirtualAddress(), 10);
Printer << "] ";
@@ -51,17 +50,25 @@ void VariableDumper::start(const PDBSymbolData &Var) {
dumpSymbolTypeAndName(*VarType, Var.getName());
break;
case PDB_LocType::Constant:
+ if (isa<PDBSymbolTypeEnum>(*VarType))
+ break;
+ Printer.NewLine();
+ Printer << "data ";
WithColor(Printer, PDB_ColorItem::Keyword).get() << "const ";
dumpSymbolTypeAndName(*VarType, Var.getName());
Printer << " = ";
WithColor(Printer, PDB_ColorItem::LiteralValue).get() << Var.getValue();
break;
case PDB_LocType::ThisRel:
+ Printer.NewLine();
+ Printer << "data ";
WithColor(Printer, PDB_ColorItem::Offset).get()
<< "+" << format_hex(Var.getOffset(), 4) << " ";
dumpSymbolTypeAndName(*VarType, Var.getName());
break;
case PDB_LocType::BitField:
+ Printer.NewLine();
+ Printer << "data ";
WithColor(Printer, PDB_ColorItem::Offset).get()
<< "+" << format_hex(Var.getOffset(), 4) << " ";
dumpSymbolTypeAndName(*VarType, Var.getName());
@@ -69,6 +76,8 @@ void VariableDumper::start(const PDBSymbolData &Var) {
WithColor(Printer, PDB_ColorItem::LiteralValue).get() << Var.getLength();
break;
default:
+ Printer.NewLine();
+ Printer << "data ";
Printer << "unknown(" << LocType << ") ";
WithColor(Printer, PDB_ColorItem::Identifier).get() << Var.getName();
break;
OpenPOWER on IntegriCloud