From f25bbe3d09dc17a2e28820d8b196e0344dc1f451 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Tue, 3 Mar 2009 21:20:20 +0100 Subject: [PATCH] Fixed inreg attribute to no longer overwrite sign/zeroext. --- gen/abi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gen/abi.cpp b/gen/abi.cpp index 7529b5bb..43dfb4f5 100644 --- a/gen/abi.cpp +++ b/gen/abi.cpp @@ -183,7 +183,7 @@ struct X86TargetABI : TargetABI if (last->byref && !last->isByVal()) { - last->attrs = llvm::Attribute::InReg; + last->attrs |= llvm::Attribute::InReg; } else if (!lastTy->isfloating() && (sz == 1 || sz == 2 || sz == 4)) // right? { @@ -193,8 +193,10 @@ struct X86TargetABI : TargetABI last->rewrite = &structToReg; last->ltype = structToReg.type(last->type, last->ltype); last->byref = false; + // erase previous attributes + last->attrs = 0; } - last->attrs = llvm::Attribute::InReg; + last->attrs |= llvm::Attribute::InReg; } }