Added inreg attribute where appropriate on x86 to follow ABI docs.

Removed now unnecessary temporary variable in StringExp.
This commit is contained in:
Tomas Lindquist Olsen
2008-10-23 00:34:46 +02:00
parent a52f0330d0
commit f71b7ac284
5 changed files with 51 additions and 3 deletions

View File

@@ -373,9 +373,7 @@ DValue* StringExp::toElem(IRState* p)
if (dtype->ty == Tarray) {
LLConstant* clen = llvm::ConstantInt::get(DtoSize_t(),len,false);
LLValue* tmpmem = DtoAlloca(DtoType(dtype),"tempstring");
DtoSetArray(tmpmem, clen, arrptr);
return new DVarValue(type, tmpmem);
return new DImValue(type, DtoConstSlice(clen, arrptr));
}
else if (dtype->ty == Tsarray) {
const LLType* dstType = getPtrToType(LLArrayType::get(ct, len));