comparison gen/aa.cpp @ 133:44a95ac7368a trunk

[svn r137] Many fixes towards tango.io.Console working, but not quite there yet... In particular, assertions has been fixed to include file/line info, and much more!
author lindquist
date Mon, 14 Jan 2008 05:11:54 +0100
parents facc562f5674
children 0e28624814e8
comparison
equal deleted inserted replaced
132:1700239cab2e 133:44a95ac7368a
84 // pkey param 84 // pkey param
85 llvm::Value* pkey = to_pkey(key); 85 llvm::Value* pkey = to_pkey(key);
86 pkey = DtoBitCast(pkey, funcTy->getParamType(2)); 86 pkey = DtoBitCast(pkey, funcTy->getParamType(2));
87 87
88 // valuesize param 88 // valuesize param
89 llvm::Value* valsize = DtoConstSize_t(gTargetData->getTypeSize(DtoType(type))); 89 llvm::Value* valsize = DtoConstSize_t(getABITypeSize(DtoType(type)));
90 90
91 // build arg vector 91 // build arg vector
92 std::vector<llvm::Value*> args; 92 std::vector<llvm::Value*> args;
93 args.push_back(aaval); 93 args.push_back(aaval);
94 args.push_back(keyti); 94 args.push_back(keyti);
97 97
98 // call runtime 98 // call runtime
99 llvm::Value* ret = gIR->ir->CreateCall(func, args.begin(), args.end(), "aa.index"); 99 llvm::Value* ret = gIR->ir->CreateCall(func, args.begin(), args.end(), "aa.index");
100 100
101 // cast return value 101 // cast return value
102 const llvm::Type* targettype = llvm::PointerType::get(DtoType(type)); 102 const llvm::Type* targettype = getPtrToType(DtoType(type));
103 if (ret->getType() != targettype) 103 if (ret->getType() != targettype)
104 ret = DtoBitCast(ret, targettype); 104 ret = DtoBitCast(ret, targettype);
105 105
106 return new DVarValue(type, ret, true); 106 return new DVarValue(type, ret, true);
107 } 107 }