Mercurial > projects > ldc
comparison gen/runtime.cpp @ 1569:755abafbf25d
Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Thu, 06 Aug 2009 01:47:39 +0200 |
parents | 259b031f3d22 |
children | 8d086d552909 |
comparison
equal
deleted
inserted
replaced
1568:a591aa6bd6dc | 1569:755abafbf25d |
---|---|
122 return getPtrToType(t); | 122 return getPtrToType(t); |
123 } | 123 } |
124 | 124 |
125 static const LLType* rt_array(const LLType* elemty) | 125 static const LLType* rt_array(const LLType* elemty) |
126 { | 126 { |
127 return llvm::StructType::get(DtoSize_t(), rt_ptr(elemty), NULL); | 127 return llvm::StructType::get(gIR->context(), DtoSize_t(), rt_ptr(elemty), NULL); |
128 } | 128 } |
129 | 129 |
130 static const LLType* rt_dg1() | 130 static const LLType* rt_dg1() |
131 { | 131 { |
132 std::vector<const LLType*> types; | 132 std::vector<const LLType*> types; |
133 types.push_back(rt_ptr(LLType::Int8Ty)); | 133 types.push_back(rt_ptr(LLType::Int8Ty)); |
134 types.push_back(rt_ptr(LLType::Int8Ty)); | 134 types.push_back(rt_ptr(LLType::Int8Ty)); |
135 const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); | 135 const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); |
136 return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); | 136 return llvm::StructType::get(gIR->context(), rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); |
137 } | 137 } |
138 | 138 |
139 static const LLType* rt_dg2() | 139 static const LLType* rt_dg2() |
140 { | 140 { |
141 std::vector<const LLType*> types; | 141 std::vector<const LLType*> types; |
142 types.push_back(rt_ptr(LLType::Int8Ty)); | 142 types.push_back(rt_ptr(LLType::Int8Ty)); |
143 types.push_back(rt_ptr(LLType::Int8Ty)); | 143 types.push_back(rt_ptr(LLType::Int8Ty)); |
144 types.push_back(rt_ptr(LLType::Int8Ty)); | 144 types.push_back(rt_ptr(LLType::Int8Ty)); |
145 const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); | 145 const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); |
146 return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); | 146 return llvm::StructType::get(gIR->context(), rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); |
147 } | 147 } |
148 | 148 |
149 static void LLVM_D_BuildRuntimeModule() | 149 static void LLVM_D_BuildRuntimeModule() |
150 { | 150 { |
151 Logger::println("building module"); | 151 Logger::println("building module"); |
167 if ((global.params.cpu == ARCHx86) || (global.params.cpu == ARCHx86_64)) | 167 if ((global.params.cpu == ARCHx86) || (global.params.cpu == ARCHx86_64)) |
168 realTy = LLType::X86_FP80Ty; | 168 realTy = LLType::X86_FP80Ty; |
169 else | 169 else |
170 realTy = LLType::DoubleTy; | 170 realTy = LLType::DoubleTy; |
171 | 171 |
172 const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, NULL); | 172 const LLType* cfloatTy = llvm::StructType::get(gIR->context(), floatTy, floatTy, NULL); |
173 const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, NULL); | 173 const LLType* cdoubleTy = llvm::StructType::get(gIR->context(), doubleTy, doubleTy, NULL); |
174 const LLType* crealTy = llvm::StructType::get(realTy, realTy, NULL); | 174 const LLType* crealTy = llvm::StructType::get(gIR->context(), realTy, realTy, NULL); |
175 | 175 |
176 Logger::println("building aggr types"); | 176 Logger::println("building aggr types"); |
177 const LLType* voidPtrTy = rt_ptr(byteTy); | 177 const LLType* voidPtrTy = rt_ptr(byteTy); |
178 const LLType* stringTy = rt_array(byteTy); | 178 const LLType* stringTy = rt_array(byteTy); |
179 const LLType* wstringTy = rt_array(shortTy); | 179 const LLType* wstringTy = rt_array(shortTy); |