comparison gen/rttibuilder.cpp @ 1375:63f4afd01036

Cleaned up TypeInfo_Struct. Fixed problem with DtoConstSize_t taking a size_t argument, this is not enough for cross compiling from 32bit host to a 64bit target. It now takes uint64_t. There's probably a lot of similar case around to code ...
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sun, 17 May 2009 04:41:10 +0200
parents e630ff79e10d
children a5d0e04298a8
comparison
equal deleted inserted replaced
1374:e630ff79e10d 1375:63f4afd01036
78 78
79 size_t dim = getTypePaddedSize(CI->getType()); 79 size_t dim = getTypePaddedSize(CI->getType());
80 push_void_array(dim, G); 80 push_void_array(dim, G);
81 } 81 }
82 82
83 void TypeInfoBuilder::push_uint(unsigned u)
84 {
85 inits.push_back(DtoConstUint(u));
86 }
87
88 void TypeInfoBuilder::push_size(uint64_t s)
89 {
90 inits.push_back(DtoConstSize_t(s));
91 }
92
93 void TypeInfoBuilder::push_funcptr(FuncDeclaration* fd)
94 {
95 if (fd)
96 {
97 fd->codegen(Type::sir);
98 LLConstant* F = fd->ir.irFunc->func;
99 inits.push_back(F);
100 }
101 else
102 {
103 push_null_vp();
104 }
105 }
106
83 void TypeInfoBuilder::finalize(IrGlobal* tid) 107 void TypeInfoBuilder::finalize(IrGlobal* tid)
84 { 108 {
85 // create the inititalizer 109 // create the inititalizer
86 LLConstant* tiInit = llvm::ConstantStruct::get(&inits[0], inits.size(), false); 110 LLConstant* tiInit = llvm::ConstantStruct::get(&inits[0], inits.size(), false);
87 111