comparison gen/tollvm.cpp @ 161:3a891cfcd249 trunk

[svn r177] moved variable for interface info type from being local static to being within IRState
author ChristianK
date Sun, 04 May 2008 21:25:48 +0200
parents b77664331d06
children a8cd9bc1021a
comparison
equal deleted inserted replaced
160:b77664331d06 161:3a891cfcd249
1787 gIR->ir->CreateAnd(DtoConstSize_t(0),DtoConstSize_t(0),s.c_str()); 1787 gIR->ir->CreateAnd(DtoConstSize_t(0),DtoConstSize_t(0),s.c_str());
1788 } 1788 }
1789 1789
1790 const llvm::StructType* DtoInterfaceInfoType() 1790 const llvm::StructType* DtoInterfaceInfoType()
1791 { 1791 {
1792 static const llvm::StructType* t = NULL; 1792 if (gIR->interfaceInfoType)
1793 if (t) 1793 return gIR->interfaceInfoType;
1794 return t;
1795 1794
1796 // build interface info type 1795 // build interface info type
1797 std::vector<const llvm::Type*> types; 1796 std::vector<const llvm::Type*> types;
1798 // ClassInfo classinfo 1797 // ClassInfo classinfo
1799 ClassDeclaration* cd2 = ClassDeclaration::classinfo; 1798 ClassDeclaration* cd2 = ClassDeclaration::classinfo;
1806 vtbltypes.push_back(byteptrptrty); 1805 vtbltypes.push_back(byteptrptrty);
1807 types.push_back(llvm::StructType::get(vtbltypes)); 1806 types.push_back(llvm::StructType::get(vtbltypes));
1808 // int offset 1807 // int offset
1809 types.push_back(llvm::Type::Int32Ty); 1808 types.push_back(llvm::Type::Int32Ty);
1810 // create type 1809 // create type
1811 t = llvm::StructType::get(types); 1810 gIR->interfaceInfoType = llvm::StructType::get(types);
1812 1811
1813 return t; 1812 return gIR->interfaceInfoType;
1814 } 1813 }