comparison gen/dwarftypes.cpp @ 1571:8d086d552909

IntegerType is now contextifed. Requires llvm >= 78969. resistor says this will be the last context API change :)
author Benjamin Kramer <benny.kra@gmail.com>
date Fri, 14 Aug 2009 00:39:18 +0200
parents 755abafbf25d
children
comparison
equal deleted inserted replaced
1570:ab03cfb3a212 1571:8d086d552909
19 19
20 void RegisterDwarfSymbols(llvm::Module* mod) { 20 void RegisterDwarfSymbols(llvm::Module* mod) {
21 using namespace llvm; 21 using namespace llvm;
22 // Type Definitions 22 // Type Definitions
23 std::vector<const Type*>StructTy_llvm_dbg_anchor_type_fields; 23 std::vector<const Type*>StructTy_llvm_dbg_anchor_type_fields;
24 StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(32)); 24 StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
25 StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(32)); 25 StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
26 StructType* StructTy_llvm_dbg_anchor_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_anchor_type_fields, /*isPacked=*/false); 26 StructType* StructTy_llvm_dbg_anchor_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_anchor_type_fields, /*isPacked=*/false);
27 mod->addTypeName("llvm.dbg.anchor.type", StructTy_llvm_dbg_anchor_type); 27 mod->addTypeName("llvm.dbg.anchor.type", StructTy_llvm_dbg_anchor_type);
28 28
29 std::vector<const Type*>StructTy_llvm_dbg_basictype_type_fields; 29 std::vector<const Type*>StructTy_llvm_dbg_basictype_type_fields;
30 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32)); 30 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
31 std::vector<const Type*>StructTy_1_fields; 31 std::vector<const Type*>StructTy_1_fields;
32 StructType* StructTy_1 = StructType::get(mod->getContext(), StructTy_1_fields, /*isPacked=*/false); 32 StructType* StructTy_1 = StructType::get(mod->getContext(), StructTy_1_fields, /*isPacked=*/false);
33 33
34 PointerType* PointerTy_0 = PointerType::get(StructTy_1,0); 34 PointerType* PointerTy_0 = PointerType::get(StructTy_1,0);
35 35
36 StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_0); 36 StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_0);
37 PointerType* PointerTy_2 = PointerType::get(IntegerType::get(8),0); 37 PointerType* PointerTy_2 = PointerType::get(IntegerType::get(mod->getContext(), 8),0);
38 38
39 StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_2); 39 StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_2);
40 StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_0); 40 StructTy_llvm_dbg_basictype_type_fields.push_back(PointerTy_0);
41 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32)); 41 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
42 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64)); 42 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
43 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64)); 43 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
44 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64)); 44 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
45 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32)); 45 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
46 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32)); 46 StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
47 StructType* StructTy_llvm_dbg_basictype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_basictype_type_fields, /*isPacked=*/false); 47 StructType* StructTy_llvm_dbg_basictype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_basictype_type_fields, /*isPacked=*/false);
48 mod->addTypeName("llvm.dbg.basictype.type", StructTy_llvm_dbg_basictype_type); 48 mod->addTypeName("llvm.dbg.basictype.type", StructTy_llvm_dbg_basictype_type);
49 49
50 std::vector<const Type*>StructTy_llvm_dbg_compile_unit_type_fields; 50 std::vector<const Type*>StructTy_llvm_dbg_compile_unit_type_fields;
51 StructTy_llvm_dbg_compile_unit_type_fields.push_back(IntegerType::get(32)); 51 StructTy_llvm_dbg_compile_unit_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
52 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_0); 52 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_0);
53 StructTy_llvm_dbg_compile_unit_type_fields.push_back(IntegerType::get(32)); 53 StructTy_llvm_dbg_compile_unit_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
54 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2); 54 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
55 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2); 55 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
56 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2); 56 StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
57 StructType* StructTy_llvm_dbg_compile_unit_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compile_unit_type_fields, /*isPacked=*/false); 57 StructType* StructTy_llvm_dbg_compile_unit_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compile_unit_type_fields, /*isPacked=*/false);
58 mod->addTypeName("llvm.dbg.compile_unit.type", StructTy_llvm_dbg_compile_unit_type); 58 mod->addTypeName("llvm.dbg.compile_unit.type", StructTy_llvm_dbg_compile_unit_type);
59 59
60 std::vector<const Type*>StructTy_llvm_dbg_compositetype_type_fields; 60 std::vector<const Type*>StructTy_llvm_dbg_compositetype_type_fields;
61 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(32)); 61 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
62 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); 62 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
63 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_2); 63 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_2);
64 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); 64 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
65 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(32)); 65 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
66 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(64)); 66 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
67 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(64)); 67 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
68 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(64)); 68 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
69 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(32)); 69 StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
70 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); 70 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
71 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0); 71 StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
72 StructType* StructTy_llvm_dbg_compositetype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compositetype_type_fields, /*isPacked=*/false); 72 StructType* StructTy_llvm_dbg_compositetype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compositetype_type_fields, /*isPacked=*/false);
73 mod->addTypeName("llvm.dbg.compositetype.type", StructTy_llvm_dbg_compositetype_type); 73 mod->addTypeName("llvm.dbg.compositetype.type", StructTy_llvm_dbg_compositetype_type);
74 74
75 std::vector<const Type*>StructTy_llvm_dbg_derivedtype_type_fields; 75 std::vector<const Type*>StructTy_llvm_dbg_derivedtype_type_fields;
76 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(32)); 76 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
77 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0); 77 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0);
78 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_2); 78 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_2);
79 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0); 79 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0);
80 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(32)); 80 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
81 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64)); 81 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
82 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64)); 82 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
83 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64)); 83 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 64));
84 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(32)); 84 StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
85 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0); 85 StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0);
86 StructType* StructTy_llvm_dbg_derivedtype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_derivedtype_type_fields, /*isPacked=*/false); 86 StructType* StructTy_llvm_dbg_derivedtype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_derivedtype_type_fields, /*isPacked=*/false);
87 mod->addTypeName("llvm.dbg.derivedtype.type", StructTy_llvm_dbg_derivedtype_type); 87 mod->addTypeName("llvm.dbg.derivedtype.type", StructTy_llvm_dbg_derivedtype_type);
88 88
89 std::vector<const Type*>StructTy_llvm_dbg_global_variable_type_fields; 89 std::vector<const Type*>StructTy_llvm_dbg_global_variable_type_fields;
90 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(32)); 90 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
91 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); 91 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0);
92 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); 92 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0);
93 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2); 93 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2);
94 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2); 94 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2);
95 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2); 95 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_2);
96 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); 96 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0);
97 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(32)); 97 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
98 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); 98 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0);
99 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1)); 99 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 1));
100 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1)); 100 StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 1));
101 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0); 101 StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0);
102 StructType* StructTy_llvm_dbg_global_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_global_variable_type_fields, /*isPacked=*/false); 102 StructType* StructTy_llvm_dbg_global_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_global_variable_type_fields, /*isPacked=*/false);
103 mod->addTypeName("llvm.dbg.global_variable.type", StructTy_llvm_dbg_global_variable_type); 103 mod->addTypeName("llvm.dbg.global_variable.type", StructTy_llvm_dbg_global_variable_type);
104 104
105 std::vector<const Type*>StructTy_llvm_dbg_subprogram_type_fields; 105 std::vector<const Type*>StructTy_llvm_dbg_subprogram_type_fields;
106 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(32)); 106 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
107 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); 107 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0);
108 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); 108 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0);
109 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2); 109 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2);
110 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2); 110 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2);
111 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2); 111 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_2);
112 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); 112 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0);
113 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(32)); 113 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
114 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0); 114 StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0);
115 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1)); 115 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 1));
116 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1)); 116 StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(mod->getContext(), 1));
117 StructType* StructTy_llvm_dbg_subprogram_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_subprogram_type_fields, /*isPacked=*/false); 117 StructType* StructTy_llvm_dbg_subprogram_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_subprogram_type_fields, /*isPacked=*/false);
118 mod->addTypeName("llvm.dbg.subprogram.type", StructTy_llvm_dbg_subprogram_type); 118 mod->addTypeName("llvm.dbg.subprogram.type", StructTy_llvm_dbg_subprogram_type);
119 119
120 std::vector<const Type*>StructTy_llvm_dbg_variable_type_fields; 120 std::vector<const Type*>StructTy_llvm_dbg_variable_type_fields;
121 StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(32)); 121 StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
122 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0); 122 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0);
123 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_2); 123 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_2);
124 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0); 124 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0);
125 StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(32)); 125 StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(mod->getContext(), 32));
126 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0); 126 StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0);
127 StructType* StructTy_llvm_dbg_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_variable_type_fields, /*isPacked=*/false); 127 StructType* StructTy_llvm_dbg_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_variable_type_fields, /*isPacked=*/false);
128 mod->addTypeName("llvm.dbg.variable.type", StructTy_llvm_dbg_variable_type); 128 mod->addTypeName("llvm.dbg.variable.type", StructTy_llvm_dbg_variable_type);
129 129
130 std::vector<const Type*>FuncTy_3_args; 130 std::vector<const Type*>FuncTy_3_args;
131 FuncTy_3_args.push_back(PointerTy_0); 131 FuncTy_3_args.push_back(PointerTy_0);
132 FunctionType* FuncTy_3 = FunctionType::get( 132 FunctionType* FuncTy_3 = FunctionType::get(
133 /*Result=*/Type::VoidTy, 133 /*Result=*/Type::getVoidTy(mod->getContext()),
134 /*Params=*/FuncTy_3_args, 134 /*Params=*/FuncTy_3_args,
135 /*isVarArg=*/false); 135 /*isVarArg=*/false);
136 136
137 std::vector<const Type*>FuncTy_4_args; 137 std::vector<const Type*>FuncTy_4_args;
138 FuncTy_4_args.push_back(IntegerType::get(32)); 138 FuncTy_4_args.push_back(IntegerType::get(mod->getContext(), 32));
139 FuncTy_4_args.push_back(IntegerType::get(32)); 139 FuncTy_4_args.push_back(IntegerType::get(mod->getContext(), 32));
140 FuncTy_4_args.push_back(PointerTy_0); 140 FuncTy_4_args.push_back(PointerTy_0);
141 FunctionType* FuncTy_4 = FunctionType::get( 141 FunctionType* FuncTy_4 = FunctionType::get(
142 /*Result=*/Type::VoidTy, 142 /*Result=*/Type::getVoidTy(mod->getContext()),
143 /*Params=*/FuncTy_4_args, 143 /*Params=*/FuncTy_4_args,
144 /*isVarArg=*/false); 144 /*isVarArg=*/false);
145 145
146 std::vector<const Type*>FuncTy_5_args; 146 std::vector<const Type*>FuncTy_5_args;
147 FuncTy_5_args.push_back(PointerTy_0); 147 FuncTy_5_args.push_back(PointerTy_0);
148 FuncTy_5_args.push_back(PointerTy_0); 148 FuncTy_5_args.push_back(PointerTy_0);
149 FunctionType* FuncTy_5 = FunctionType::get( 149 FunctionType* FuncTy_5 = FunctionType::get(
150 /*Result=*/Type::VoidTy, 150 /*Result=*/Type::getVoidTy(mod->getContext()),
151 /*Params=*/FuncTy_5_args, 151 /*Params=*/FuncTy_5_args,
152 /*isVarArg=*/false); 152 /*isVarArg=*/false);
153 153
154 154
155 // Function Declarations 155 // Function Declarations