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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Tue Feb 26 15:20:38 PST 2008


Author: alenhar2
Date: Tue Feb 26 17:20:38 2008
New Revision: 47643

URL: http://llvm.org/viewvc/llvm-project?rev=47643&view=rev
Log:
Backport this patch.  I know 4.0 is dead, but I still need it until 4.2 is a bit more stable.


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

Modified: llvm-gcc-4.0/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-abi.h?rev=47643&r1=47642&r2=47643&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-abi.h Tue Feb 26 17:20:38 2008
@@ -201,7 +201,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);
 
     if (isPassedByInvisibleReference(type)) { // variable size -> by-ref.

Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=47643&r1=47642&r2=47643&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Tue Feb 26 17:20:38 2008
@@ -34,7 +34,7 @@
 #include "llvm/InlineAsm.h"
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
-#include "llvm/ParameterAttributes.h"
+#include "llvm/ParamAttrsList.h"
 #include "llvm/Analysis/ConstantFolding.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Target/TargetAsmInfo.h"
@@ -2958,7 +2958,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.0/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=47643&r1=47642&r2=47643&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Tue Feb 26 17:20:38 2008
@@ -29,7 +29,7 @@
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
-#include "llvm/ParameterAttributes.h"
+#include "llvm/ParamAttrsList.h"
 #include "llvm/TypeSymbolTable.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
@@ -937,7 +937,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;
@@ -972,7 +972,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));
 
@@ -993,7 +993,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);
 
@@ -1029,7 +1029,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);
 
@@ -1105,7 +1105,7 @@
     }
     
     // Determine if there are any attributes for this param.
-    uint16_t Attributes = ParamAttr::None;
+    ParameterAttributes Attributes = ParamAttr::None;
     
     ABIConverter.HandleArgument(ArgTy, &Attributes);
 
@@ -1145,7 +1145,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