[llvm-commits] [llvm-gcc-4.2] r47345 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-convert.cpp llvm-types.cpp

Dale Johannesen dalej at apple.com
Tue Feb 19 13:41:53 PST 2008


Author: johannes
Date: Tue Feb 19 15:41:53 2008
New Revision: 47345

URL: http://llvm.org/viewvc/llvm-project?rev=47345&view=rev
Log:
Cleanup of ParamAttrs interfaces to use
ParameterAttributes consistently.


Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-abi.h
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
    llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=47345&r1=47344&r2=47345&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Tue Feb 19 15:41:53 2008
@@ -228,7 +228,7 @@
   /// argument and invokes methods on the client that indicate how its pieces
   /// should be handled.  This handles things like decimating structures into
   /// their fields.
-  void HandleArgument(tree type, uint16_t *Attributes = NULL) {
+  void HandleArgument(tree type, ParameterAttributes *Attributes = NULL) {
     const Type *Ty = ConvertType(type);
     // Figure out if this field is zero bits wide, e.g. {} or [0 x int].  Do
     // not include variable sized fields here.

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=47345&r1=47344&r2=47345&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Feb 19 15:41:53 2008
@@ -2529,7 +2529,7 @@
       LValue LV = EmitLV(TREE_VALUE(arg));
       assert(!LV.isBitfield() && "Bitfields are first-class types!");
       Client.setLocation(LV.Ptr);
-      uint16_t Attributes = ParamAttr::None;
+      ParameterAttributes Attributes = ParamAttr::None;
       ABIConverter.HandleArgument(TREE_TYPE(TREE_VALUE(arg)), &Attributes);
       if (Attributes != ParamAttr::None)
         PAL= ParamAttrsList::includeAttrs(PAL, CallOperands.size(), Attributes);

Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=47345&r1=47344&r2=47345&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Feb 19 15:41:53 2008
@@ -1014,7 +1014,7 @@
 }
 
 
-static uint16_t HandleArgumentExtension(tree ArgTy) {
+static ParameterAttributes HandleArgumentExtension(tree ArgTy) {
   if (TREE_CODE(ArgTy) == BOOLEAN_TYPE) {
     if (TREE_INT_CST_LOW(TYPE_SIZE(ArgTy)) < INT_TYPE_SIZE)
       return ParamAttr::ZExt;
@@ -1049,7 +1049,7 @@
   ParamAttrsVector Attrs;
 
   // Compute whether the result needs to be zext or sext'd.
-  uint16_t RAttributes = HandleArgumentExtension(ReturnType);
+  ParameterAttributes RAttributes = HandleArgumentExtension(ReturnType);
   if (RAttributes != ParamAttr::None)
     Attrs.push_back(ParamAttrsWithIndex::get(0, RAttributes));
 
@@ -1071,7 +1071,7 @@
     tree ArgTy = TREE_TYPE(Args);
 
     // Determine if there are any attributes for this param.
-    uint16_t Attributes = ParamAttr::None;
+    ParameterAttributes Attributes = ParamAttr::None;
 
     ABIConverter.HandleArgument(ArgTy, &Attributes);
 
@@ -1107,7 +1107,7 @@
 
   // Compute attributes for return type (and function attributes).
   ParamAttrsVector Attrs;
-  uint16_t RAttributes = ParamAttr::None;
+  ParameterAttributes RAttributes = ParamAttr::None;
 
   int flags = flags_from_decl_or_type(decl ? decl : type);
 
@@ -1198,7 +1198,7 @@
     }
     
     // Determine if there are any attributes for this param.
-    uint16_t Attributes = ParamAttr::None;
+    ParameterAttributes Attributes = ParamAttr::None;
     
     ABIConverter.HandleArgument(ArgTy, &Attributes);
 
@@ -1239,7 +1239,7 @@
   // write through the byval pointer argument, which LLVM does not allow for
   // readonly/readnone functions.
   if (HasByVal && Attrs[0].index == 0) {
-    uint16_t &RAttrs = Attrs[0].attrs;
+    ParameterAttributes &RAttrs = Attrs[0].attrs;
     RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly);
     if (RAttrs == ParamAttr::None)
       Attrs.erase(Attrs.begin());





More information about the llvm-commits mailing list