[llvm-commits] [llvm] r47484 - in /llvm/trunk: include/llvm/Function.h include/llvm/Instructions.h include/llvm/ParameterAttributes.h include/llvm/Support/CallSite.h include/llvm/Target/TargetLowering.h lib/AsmParser/llvmAsmParser.y lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/VMCore/Function.cpp lib/VMCore/Instructions.cpp

Chris Lattner clattner at apple.com
Fri Feb 22 10:23:58 PST 2008


On Feb 22, 2008, at 9:49 AM, Dale Johannesen wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=47484&view=rev
> Log:
> Pass alignment on ByVal parameters, from FE, all
> the way through.  It is now used for codegen.

Nice.

> +++ llvm/trunk/include/llvm/Function.h Fri Feb 22 11:49:45 2008
> @@ -166,6 +166,9 @@
>   /// @brief Determine whether the function has the given attribute.
>   bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
>
> +  /// @brief Extract the alignment for a call or parameter  
> (0=unknown).
> +  uint16_t getParamAlignment(uint16_t i) const;

Does this apply just to byval, or to all arguments?  If just byval,  
howabout "getByvalParamAlignment" or something.  likewise for call/ 
invoke/callsite/paramattr.  If this applies to any argument, then no  
rename is needed obviously :)

> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/include/llvm/ParameterAttributes.h (original)
> +++ llvm/trunk/include/llvm/ParameterAttributes.h Fri Feb 22  
> 11:49:45 2008
> @@ -69,6 +69,12 @@
> /// @brief Which attributes cannot be applied to a type.
> Attributes typeIncompatible (const Type *Ty);
>
> +/// This turns an int alignment (a power of 2, normally) into the
> +/// form used internally in ParameterAttributes.
> +ParamAttr::Attributes inline constructAlignmentFromInt(uint32_t i) {

How about constructByValAlignmentFromInt?

Very nice Dale,

-Chris



More information about the llvm-commits mailing list