+ if (!tryDumpFunctionPointer(Type, Name)) {
+ Type.dump(*this);
+ WithColor(Printer, PDB_ColorItem::Identifier).get() << " " << Name;
+ }
+ }
+}
+
+bool VariableDumper::tryDumpFunctionPointer(const PDBSymbol &Type,
+ 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)) {
+ auto PointeeType = PointerType->getPointeeType();
+ if (auto *FunctionSig =
+ dyn_cast<PDBSymbolTypeFunctionSig>(PointeeType.get())) {
+ FunctionDumper Dumper(Printer);
+ FunctionDumper::PointerType PT = FunctionDumper::PointerType::Pointer;
+ if (PointerType->isReference())
+ PT = FunctionDumper::PointerType::Reference;
+ std::string NameStr(Name.begin(), Name.end());
+ Dumper.start(*FunctionSig, NameStr.c_str(), PT);
+ return true;
+ }