comparison gen/runtime.cpp @ 797:340acf1535d0

Removed KDevelop3 project files, CMake can generate them just fine! Fixed function literals in static initializers. Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE. Changed errors to go to stderr instead of stdout. Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sat, 29 Nov 2008 21:25:43 +0100
parents 661384d6a936
children a8cb25d478c4
comparison
equal deleted inserted replaced
796:6e7a4c3b64d2 797:340acf1535d0
132 return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); 132 return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL);
133 } 133 }
134 134
135 static void LLVM_D_BuildRuntimeModule() 135 static void LLVM_D_BuildRuntimeModule()
136 { 136 {
137 Logger::println("building module");
137 M = new llvm::Module("ldc internal runtime"); 138 M = new llvm::Module("ldc internal runtime");
138 139
140 Logger::println("building basic types");
139 const LLType* voidTy = LLType::VoidTy; 141 const LLType* voidTy = LLType::VoidTy;
140 const LLType* boolTy = LLType::Int1Ty; 142 const LLType* boolTy = LLType::Int1Ty;
141 const LLType* byteTy = LLType::Int8Ty; 143 const LLType* byteTy = LLType::Int8Ty;
142 const LLType* shortTy = LLType::Int16Ty; 144 const LLType* shortTy = LLType::Int16Ty;
143 const LLType* intTy = LLType::Int32Ty; 145 const LLType* intTy = LLType::Int32Ty;
144 const LLType* longTy = LLType::Int64Ty; 146 const LLType* longTy = LLType::Int64Ty;
145 const LLType* sizeTy = DtoSize_t(); 147 const LLType* sizeTy = DtoSize_t();
146 148
149 Logger::println("building float types");
147 const LLType* floatTy = LLType::FloatTy; 150 const LLType* floatTy = LLType::FloatTy;
148 const LLType* doubleTy = LLType::DoubleTy; 151 const LLType* doubleTy = LLType::DoubleTy;
149 const LLType* realTy; 152 const LLType* realTy;
150 if ((global.params.cpu == ARCHx86) || (global.params.cpu == ARCHx86_64)) 153 if ((global.params.cpu == ARCHx86) || (global.params.cpu == ARCHx86_64))
151 realTy = LLType::X86_FP80Ty; 154 realTy = LLType::X86_FP80Ty;
154 157
155 const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, NULL); 158 const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, NULL);
156 const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, NULL); 159 const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, NULL);
157 const LLType* crealTy = llvm::StructType::get(realTy, realTy, NULL); 160 const LLType* crealTy = llvm::StructType::get(realTy, realTy, NULL);
158 161
162 Logger::println("building aggr types");
159 const LLType* voidPtrTy = rt_ptr(byteTy); 163 const LLType* voidPtrTy = rt_ptr(byteTy);
160 const LLType* stringTy = rt_array(byteTy); 164 const LLType* stringTy = rt_array(byteTy);
161 const LLType* wstringTy = rt_array(shortTy); 165 const LLType* wstringTy = rt_array(shortTy);
162 const LLType* dstringTy = rt_array(intTy); 166 const LLType* dstringTy = rt_array(intTy);
163 const LLType* objectTy = rt_ptr(ClassDeclaration::object->type->ir.type->get()); 167
164 const LLType* classInfoTy = rt_ptr(ClassDeclaration::classinfo->type->ir.type->get()); 168 Logger::println("building class types");
165 const LLType* typeInfoTy = rt_ptr(Type::typeinfo->type->ir.type->get()); 169 const LLType* objectTy = DtoType(ClassDeclaration::object->type);
170 const LLType* classInfoTy = DtoType(ClassDeclaration::classinfo->type);
171 const LLType* typeInfoTy = DtoType(Type::typeinfo->type);
172
173 Logger::println("building aa type");
166 const LLType* aaTy = rt_ptr(llvm::OpaqueType::get()); 174 const LLType* aaTy = rt_ptr(llvm::OpaqueType::get());
175
176 Logger::println("building functions");
167 177
168 ///////////////////////////////////////////////////////////////////////////////////// 178 /////////////////////////////////////////////////////////////////////////////////////
169 ///////////////////////////////////////////////////////////////////////////////////// 179 /////////////////////////////////////////////////////////////////////////////////////
170 ///////////////////////////////////////////////////////////////////////////////////// 180 /////////////////////////////////////////////////////////////////////////////////////
171 181