llvm.org GIT mirror llvm / 21c1304
Fix some display bugs in llvm-pdbdump. We were incorrectly reporting all non-64 bit integers as int64s. This is most evident when trying to print the "short" type, but in theory could happen with chars too (although usually chars use a different builtin type). Additionally, we were using the wrong check when deciding whether to print an enum definition as a global enum. We were checking whether or not the enum was "nested", and if so saving it until we print the class definition that it was nested in. But this is not correct in rare situations where the enum is nested, but the class that it's nested in does not have type information in the PDB. So instead we check if there is a class definition for the parent in the PDB. If so we save it for later, otherwise we print it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265993 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 4 years ago
3 changed file(s) with 26 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
88 ; The format is func [0x+ - 0x-]
99 ; SYM_FORMAT: ---SYMBOLS---
1010 ; SYM_FORMAT: symbolformat-fpo.obj
11 ; SYM_FORMAT-DAG: func [{{.*}}] (FPO) unsigned __cdecl fpo_func(unsigned n)
11 ; SYM_FORMAT-DAG: func [{{.*}}] (FPO) unsigned int __cdecl fpo_func(unsigned int n)
1212 ; SYM_FORMAT: symbolformat.obj
1313 ; SYM_FORMAT-DAG: func [{{.*}}] (EBP) int __cdecl _purecall()
1414 ; SYM_FORMAT-DAG: func [{{.*}}] (EBP) int __cdecl main(int argc, char** argv)
4343 ; TYPES_2: data +0x09 char m_char
4444 ; TYPES_2: data +0x0a wchar_t m_wchar_t
4545 ; TYPES_2: data +0x0c int m_int
46 ; TYPES_2: data +0x10 unsigned m_unsigned
46 ; TYPES_2: data +0x10 unsigned int m_unsigned
4747 ; TYPES_2: data +0x14 long m_long
4848 ; TYPES_2: data +0x18 unsigned long m_unsigned_long
4949 ; TYPES_2: data +0x20 __int64 m_int64
5454 ; TYPES_2: }
5555
5656 ; GLOBALS: ---GLOBALS---
57 ; GLOBALS-DAG: func [{{.*}}] (FPO) unsigned __cdecl fpo_func(unsigned n)
57 ; GLOBALS-DAG: func [{{.*}}] (FPO) unsigned int __cdecl fpo_func(unsigned int n)
5858 ; GLOBALS-DAG: data [{{.*}}] static void* g_global_pointer
5959 ; GLOBALS-DAG: data [{{.*}}] static int g_global_int
2929 return "float";
3030 return "double";
3131 case PDB_BuiltinType::UInt:
32 if (Symbol.getLength() == 8)
32 switch (Symbol.getLength()) {
33 case 8:
3334 return "unsigned __int64";
34 return "unsigned";
35 case 4:
36 return "unsigned int";
37 case 2:
38 return "unsigned short";
39 case 1:
40 return "unsigned char";
41 default:
42 return "unsigned";
43 }
3544 case PDB_BuiltinType::Int:
36 if (Symbol.getLength() == 4)
45 switch (Symbol.getLength()) {
46 case 8:
47 return "__int64";
48 case 4:
3749 return "int";
38 return "__int64";
50 case 2:
51 return "short";
52 case 1:
53 return "char";
54 default:
55 return "int";
56 }
3957 case PDB_BuiltinType::Char:
4058 return "char";
4159 case PDB_BuiltinType::WCharT:
6161 if (Printer.IsTypeExcluded(Symbol.getName()))
6262 return;
6363 // Dump member enums when dumping their class definition.
64 if (Symbol.isNested())
64 if (nullptr != Symbol.getClassParent())
6565 return;
6666
6767 Printer.NewLine();