Mercurial > projects > ldc
changeset 1040:0477f98d357e
Fixed inreg attribute to no longer overwrite sign/zeroext.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 03 Mar 2009 21:20:20 +0100 |
parents | 21691e437c95 |
children | 9dca7182aa75 |
files | gen/abi.cpp |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/abi.cpp Tue Mar 03 19:47:39 2009 +0100 +++ b/gen/abi.cpp Tue Mar 03 21:20:20 2009 +0100 @@ -183,7 +183,7 @@ 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 @@ 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; } }