[llvm-pdbdump] Fix dumping of function pointers and basic types.

Function pointers were not correctly handled by the dumper, and
they would print as "* name".  They now print as
"int (__cdecl *name)(int arg1, int arg2)" as they should.

Also, doubles were being printed as floats.  This fixes that bug
as well, and adds tests for all builtin types. as well as a test
for function pointers.

llvm-svn: 230703
diff --git a/llvm/tools/llvm-pdbdump/FunctionDumper.cpp b/llvm/tools/llvm-pdbdump/FunctionDumper.cpp
index e659830..1a1defe 100644
--- a/llvm/tools/llvm-pdbdump/FunctionDumper.cpp
+++ b/llvm/tools/llvm-pdbdump/FunctionDumper.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "FunctionDumper.h"
+#include "BuiltinDumper.h"
 #include "llvm-pdbdump.h"
 
 #include "llvm/DebugInfo/PDB/IPDBSession.h"
@@ -16,7 +17,6 @@
 #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
@@ -45,7 +45,8 @@
 FunctionDumper::FunctionDumper() : PDBSymDumper(true) {}
 
 void FunctionDumper::start(const PDBSymbolTypeFunctionSig &Symbol,
-                           PointerType Pointer, raw_ostream &OS) {
+                           const char *Name, PointerType Pointer,
+                           raw_ostream &OS) {
   auto ReturnType = Symbol.getReturnType();
   ReturnType->dump(OS, 0, *this);
   OS << " ";
@@ -70,13 +71,14 @@
     OS << "(";
     if (ShouldDumpCallingConvention)
       OS << CC << " ";
-    OS << Symbol.getCallingConvention() << " ";
     if (ClassParent)
       OS << ClassParent->getName() << "::";
     if (Pointer == PointerType::Reference)
       OS << "&";
     else
       OS << "*";
+    if (Name)
+      OS << Name;
     OS << ")";
   }
 
@@ -185,10 +187,8 @@
 
 void FunctionDumper::dump(const PDBSymbolTypeBuiltin &Symbol, raw_ostream &OS,
                           int Indent) {
-  PDB_BuiltinType Type = Symbol.getBuiltinType();
-  OS << Type;
-  if (Type == PDB_BuiltinType::UInt || Type == PDB_BuiltinType::Int)
-    OS << (8 * Symbol.getLength()) << "_t";
+  BuiltinDumper Dumper;
+  Dumper.start(Symbol, OS);
 }
 
 void FunctionDumper::dump(const PDBSymbolTypeEnum &Symbol, raw_ostream &OS,
@@ -226,7 +226,7 @@
     FunctionDumper NestedDumper;
     PointerType Pointer =
         Symbol.isReference() ? PointerType::Reference : PointerType::Pointer;
-    NestedDumper.start(*FuncSig, Pointer, OS);
+    NestedDumper.start(*FuncSig, nullptr, Pointer, OS);
   } else {
     if (Symbol.isConstType())
       OS << "const ";