[svn r177] moved variable for interface info type from being local static to being within IRState

This commit is contained in:
Christian Kamm 2008-05-04 21:25:48 +02:00
parent a522719b85
commit db2b3d1937
3 changed files with 8 additions and 5 deletions

View file

@ -47,6 +47,7 @@ IRLoopScope::IRLoopScope(Statement* s, TryFinallyStatement* enclosingtryfinally,
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
IRState::IRState() IRState::IRState()
{ {
interfaceInfoType = NULL;
dmodule = 0; dmodule = 0;
module = 0; module = 0;
emitMain = false; emitMain = false;

View file

@ -77,6 +77,9 @@ struct IRState
Module* dmodule; Module* dmodule;
llvm::Module* module; llvm::Module* module;
// interface info type, used in DtoInterfaceInfoType
llvm::StructType* interfaceInfoType;
// ir data associated with DMD Dsymbol nodes // ir data associated with DMD Dsymbol nodes
std::map<Dsymbol*, IrDsymbol> irDsymbol; std::map<Dsymbol*, IrDsymbol> irDsymbol;

View file

@ -1789,9 +1789,8 @@ void DtoAnnotation(const char* str)
const llvm::StructType* DtoInterfaceInfoType() const llvm::StructType* DtoInterfaceInfoType()
{ {
static const llvm::StructType* t = NULL; if (gIR->interfaceInfoType)
if (t) return gIR->interfaceInfoType;
return t;
// build interface info type // build interface info type
std::vector<const llvm::Type*> types; std::vector<const llvm::Type*> types;
@ -1808,7 +1807,7 @@ const llvm::StructType* DtoInterfaceInfoType()
// int offset // int offset
types.push_back(llvm::Type::Int32Ty); types.push_back(llvm::Type::Int32Ty);
// create type // create type
t = llvm::StructType::get(types); gIR->interfaceInfoType = llvm::StructType::get(types);
return t; return gIR->interfaceInfoType;
} }