comparison gen/tollvm.cpp @ 137:ce7b81fb957f trunk

[svn r141] fixed more problems with classinfo moved more IR state out of the AST classes
author lindquist
date Fri, 18 Jan 2008 16:42:16 +0100
parents 0e28624814e8
children 8f43f5c43c95
comparison
equal deleted inserted replaced
136:0e28624814e8 137:ce7b81fb957f
114 } 114 }
115 115
116 TypeStruct* ts = (TypeStruct*)t; 116 TypeStruct* ts = (TypeStruct*)t;
117 assert(ts->sym); 117 assert(ts->sym);
118 DtoResolveDsymbol(ts->sym); 118 DtoResolveDsymbol(ts->sym);
119 return ts->sym->llvmIrStruct->recty.get();//t->llvmType->get(); 119 return ts->sym->irStruct->recty.get();//t->llvmType->get();
120 } 120 }
121 121
122 case Tclass: { 122 case Tclass: {
123 /*if (!t->llvmType || *t->llvmType == NULL) { 123 /*if (!t->llvmType || *t->llvmType == NULL) {
124 // recursive or cyclic declaration 124 // recursive or cyclic declaration
137 }*/ 137 }*/
138 138
139 TypeClass* tc = (TypeClass*)t; 139 TypeClass* tc = (TypeClass*)t;
140 assert(tc->sym); 140 assert(tc->sym);
141 DtoResolveDsymbol(tc->sym); 141 DtoResolveDsymbol(tc->sym);
142 return getPtrToType(tc->sym->llvmIrStruct->recty.get());//t->llvmType->get()); 142 return getPtrToType(tc->sym->irStruct->recty.get());//t->llvmType->get());
143 } 143 }
144 144
145 // functions 145 // functions
146 case Tfunction: 146 case Tfunction:
147 { 147 {
521 { 521 {
522 const llvm::StructType* structty = isaStruct(_type); 522 const llvm::StructType* structty = isaStruct(_type);
523 TypeStruct* ts = (TypeStruct*)t; 523 TypeStruct* ts = (TypeStruct*)t;
524 assert(ts); 524 assert(ts);
525 assert(ts->sym); 525 assert(ts->sym);
526 assert(ts->sym->llvmConstInit); 526 assert(ts->sym->irStruct->constInit);
527 _init = ts->sym->llvmConstInit; 527 _init = ts->sym->irStruct->constInit;
528 } 528 }
529 else if (t->ty == Tclass) 529 else if (t->ty == Tclass)
530 { 530 {
531 _init = llvm::Constant::getNullValue(_type); 531 _init = llvm::Constant::getNullValue(_type);
532 } 532 }
730 v = DtoLoad(v); 730 v = DtoLoad(v);
731 } 731 }
732 else if (ClassDeclaration* cd = fd->toParent2()->isClassDeclaration()) 732 else if (ClassDeclaration* cd = fd->toParent2()->isClassDeclaration())
733 { 733 {
734 size_t idx = 2; 734 size_t idx = 2;
735 idx += cd->llvmIrStruct->interfaces.size(); 735 idx += cd->irStruct->interfaces.size();
736 v = DtoGEPi(v,0,idx,"tmp"); 736 v = DtoGEPi(v,0,idx,"tmp");
737 v = DtoLoad(v); 737 v = DtoLoad(v);
738 } 738 }
739 else 739 else
740 { 740 {
1560 { 1560 {
1561 assert(_init->getType()->getContainedType(0) == _type); 1561 assert(_init->getType()->getContainedType(0) == _type);
1562 llvm::GlobalVariable* gv = llvm::cast<llvm::GlobalVariable>(_init); 1562 llvm::GlobalVariable* gv = llvm::cast<llvm::GlobalVariable>(_init);
1563 assert(t->ty == Tstruct); 1563 assert(t->ty == Tstruct);
1564 TypeStruct* ts = (TypeStruct*)t; 1564 TypeStruct* ts = (TypeStruct*)t;
1565 assert(ts->sym->llvmConstInit); 1565 assert(ts->sym->irStruct->constInit);
1566 _init = ts->sym->llvmConstInit; 1566 _init = ts->sym->irStruct->constInit;
1567 } 1567 }
1568 // array single value init 1568 // array single value init
1569 else if (isaArray(_type)) 1569 else if (isaArray(_type))
1570 { 1570 {
1571 _init = DtoConstStaticArray(_type, _init); 1571 _init = DtoConstStaticArray(_type, _init);