[cfe-commits] r67969 - /cfe/trunk/lib/CodeGen/CGCall.cpp
Daniel Dunbar
daniel at zuster.org
Sun Mar 29 11:38:36 PDT 2009
On Sat, Mar 28, 2009 at 8:15 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
> Author: efriedma
> Date: Sat Mar 28 19:15:25 2009
> New Revision: 67969
>
> URL: http://llvm.org/viewvc/llvm-project?rev=67969&view=rev
> Log:
> Initial implementation of ARM ABI. Mostly untested. Note that I'm not
> really intending to take ownership of this; I wrote this mostly because
> I was curious about how the ARM ABI works. It should be a decent start,
> though.
Nice! I'd been having the same urge...
> + if {
> + ElemTy = llvm::Type::Int64Ty;
> + SizeRegs = (Context.getTypeSize(Ty) + 63) / 64;
> + } else {
> + ElemTy = llvm::Type::Int32Ty;
> + SizeRegs = (Context.getTypeSize(Ty) + 31) / 32;
> + }
Better as:
--
ElemTy = (Context.getTypeAlign(Ty) > 32) ? llvm::Type::Int64Ty :
llvm::Type::Int32Ty;
SizeRegs = llvm::RoundUpToAlignment(Context.getTypeSize(Ty),
Context.getTypeSize(ElemTy));
--
?
- Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090329/62fad45a/attachment.html>
More information about the cfe-commits
mailing list