Mercurial > projects > ldc
comparison gen/tocall.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 | 5d2ac0c2dd46 |
children | 1b23aa1fb1b5 |
comparison
equal
deleted
inserted
replaced
796:6e7a4c3b64d2 | 797:340acf1535d0 |
---|---|
39 return llvm::CallingConv::C; | 39 return llvm::CallingConv::C; |
40 else if (l == LINKd || l == LINKdefault) | 40 else if (l == LINKd || l == LINKdefault) |
41 { | 41 { |
42 //TODO: StdCall is not a good base on Windows due to extra name mangling | 42 //TODO: StdCall is not a good base on Windows due to extra name mangling |
43 // applied there | 43 // applied there |
44 if (global.params.cpu == ARCHx86 && global.params.os != OSWindows) | 44 if (global.params.cpu == ARCHx86) |
45 return llvm::CallingConv::X86_StdCall; | 45 return (global.params.os != OSWindows) ? llvm::CallingConv::X86_StdCall : llvm::CallingConv::C; |
46 else | 46 else |
47 return llvm::CallingConv::Fast; | 47 return llvm::CallingConv::Fast; |
48 } | 48 } |
49 // on the other hand, here, it's exactly what we want!!! TODO: right? | |
49 else if (l == LINKwindows) | 50 else if (l == LINKwindows) |
50 return llvm::CallingConv::X86_StdCall; | 51 return llvm::CallingConv::X86_StdCall; |
51 else | 52 else |
52 assert(0 && "Unsupported calling convention"); | 53 assert(0 && "Unsupported calling convention"); |
53 } | 54 } |
153 argdst = DtoBitCast(argdst, getPtrToType(DtoType(argexp->type))); | 154 argdst = DtoBitCast(argdst, getPtrToType(DtoType(argexp->type))); |
154 DtoVariadicArgument(argexp, argdst); | 155 DtoVariadicArgument(argexp, argdst); |
155 } | 156 } |
156 | 157 |
157 // build type info array | 158 // build type info array |
158 assert(Type::typeinfo->ir.irStruct->constInit); | |
159 const LLType* typeinfotype = DtoType(Type::typeinfo->type); | 159 const LLType* typeinfotype = DtoType(Type::typeinfo->type); |
160 const LLArrayType* typeinfoarraytype = LLArrayType::get(typeinfotype,vtype->getNumElements()); | 160 const LLArrayType* typeinfoarraytype = LLArrayType::get(typeinfotype,vtype->getNumElements()); |
161 | 161 |
162 llvm::GlobalVariable* typeinfomem = | 162 llvm::GlobalVariable* typeinfomem = |
163 new llvm::GlobalVariable(typeinfoarraytype, true, llvm::GlobalValue::InternalLinkage, NULL, "._arguments.storage", gIR->module); | 163 new llvm::GlobalVariable(typeinfoarraytype, true, llvm::GlobalValue::InternalLinkage, NULL, "._arguments.storage", gIR->module); |