Mercurial > projects > ldc
comparison gen/toobj.cpp @ 94:61615fa85940 trunk
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
Added support for array .sort and .reverse properties.
Fixed some bugs with pointer arithmetic.
Disabled some DMD AST optimizations that was messing things up, destroying valuable information.
Added a KDevelop project file, this is what I use for coding LLVMDC now :)
Other minor stuff.
author | lindquist |
---|---|
date | Mon, 12 Nov 2007 06:32:46 +0100 |
parents | ccca1c13e13a |
children | ce7ed8f59b99 |
comparison
equal
deleted
inserted
replaced
93:08508eebbb3e | 94:61615fa85940 |
---|---|
79 gTargetData = targetMachine.getTargetData(); | 79 gTargetData = targetMachine.getTargetData(); |
80 | 80 |
81 // debug info | 81 // debug info |
82 if (global.params.symdebug) { | 82 if (global.params.symdebug) { |
83 RegisterDwarfSymbols(ir.module); | 83 RegisterDwarfSymbols(ir.module); |
84 ir.dwarfCompileUnit = DtoDwarfCompileUnit(this); | 84 ir.dmodule->llvmCompileUnit = DtoDwarfCompileUnit(this,true); |
85 } | 85 } |
86 | 86 |
87 // process module members | 87 // process module members |
88 for (int k=0; k < members->dim; k++) { | 88 for (int k=0; k < members->dim; k++) { |
89 Dsymbol* dsym = (Dsymbol*)(members->data[k]); | 89 Dsymbol* dsym = (Dsymbol*)(members->data[k]); |
160 } | 160 } |
161 if (vmoduleinfo) { | 161 if (vmoduleinfo) { |
162 Logger::println("vmoduleinfo"); | 162 Logger::println("vmoduleinfo"); |
163 } | 163 } |
164 if (needModuleInfo()) { | 164 if (needModuleInfo()) { |
165 Logger::println("**** ATTENTION: module info is needed but skipped"); | 165 Logger::attention("module info is needed but skipped"); |
166 } | 166 } |
167 | 167 |
168 | 168 |
169 /* | 169 /* |
170 Symbol *msym = toSymbol(); | 170 Symbol *msym = toSymbol(); |
903 llvmValue = LLVM_D_GetRuntimeFunction(gIR->module, toChars()); | 903 llvmValue = LLVM_D_GetRuntimeFunction(gIR->module, toChars()); |
904 return; | 904 return; |
905 } | 905 } |
906 | 906 |
907 if (isUnitTestDeclaration()) { | 907 if (isUnitTestDeclaration()) { |
908 Logger::println("*** ATTENTION: ignoring unittest declaration: %s", toChars()); | 908 Logger::attention("ignoring unittest declaration: %s", toChars()); |
909 return; | 909 return; |
910 } | 910 } |
911 | 911 |
912 Type* t = DtoDType(type); | 912 Type* t = DtoDType(type); |
913 TypeFunction* f = (TypeFunction*)t; | 913 TypeFunction* f = (TypeFunction*)t; |
946 return; // we wait with the definition as they might invoke a virtual method and the vtable is not yet complete | 946 return; // we wait with the definition as they might invoke a virtual method and the vtable is not yet complete |
947 } | 947 } |
948 | 948 |
949 // debug info | 949 // debug info |
950 if (global.params.symdebug) { | 950 if (global.params.symdebug) { |
951 llvmDwarfSubProgram = DtoDwarfSubProgram(this); | 951 Module* mo = getModule(); |
952 if (!mo->llvmCompileUnit) { | |
953 mo->llvmCompileUnit = DtoDwarfCompileUnit(mo,false); | |
954 } | |
955 llvmDwarfSubProgram = DtoDwarfSubProgram(this, mo->llvmCompileUnit); | |
952 } | 956 } |
953 | 957 |
954 assert(f->llvmType); | 958 assert(f->llvmType); |
955 const llvm::FunctionType* functype = llvm::cast<llvm::FunctionType>(llvmValue->getType()->getContainedType(0)); | 959 const llvm::FunctionType* functype = llvm::cast<llvm::FunctionType>(llvmValue->getType()->getContainedType(0)); |
956 | 960 |
1031 llvm::Value* v = new llvm::AllocaInst(a->getType(),s,f->llvmAllocaPoint); | 1035 llvm::Value* v = new llvm::AllocaInst(a->getType(),s,f->llvmAllocaPoint); |
1032 gIR->ir->CreateStore(a,v); | 1036 gIR->ir->CreateStore(a,v); |
1033 vd->llvmValue = v; | 1037 vd->llvmValue = v; |
1034 } | 1038 } |
1035 else { | 1039 else { |
1036 Logger::println("*** ATTENTION: some unknown argument: %s", arg ? arg->toChars() : 0); | 1040 Logger::attention("some unknown argument: %s", arg ? arg->toChars() : 0); |
1037 } | 1041 } |
1038 } | 1042 } |
1039 | 1043 |
1040 // debug info | 1044 // debug info |
1041 if (global.params.symdebug) DtoDwarfFuncStart(this); | 1045 if (global.params.symdebug) DtoDwarfFuncStart(this); |