[llvm-commits] [llvm-gcc-4.2] r44272 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Duncan Sands baldrick at free.fr
Thu Nov 22 12:23:01 PST 2007


Author: baldrick
Date: Thu Nov 22 14:23:01 2007
New Revision: 44272

URL: http://llvm.org/viewvc/llvm-project?rev=44272&view=rev
Log:
Fix needed due to parameter attribute renaming:
const -> readnone; pure -> readonly.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

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=44272&r1=44271&r2=44272&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Thu Nov 22 14:23:01 2007
@@ -1025,13 +1025,6 @@
 
   int flags = flags_from_decl_or_type(decl ? decl : type);
 
-  // Check for 'const' function attribute.
-  if (flags & ECF_CONST)
-    // Since they write the return value through a pointer,
-    // 'sret' functions cannot be 'const'.
-    if (!ABIConverter.isStructReturn())
-      RAttributes |= ParamAttr::Const;
-
   // Check for 'noreturn' function attribute.
   if (flags & ECF_NORETURN)
     RAttributes |= ParamAttr::NoReturn;
@@ -1040,12 +1033,19 @@
   if (flags & ECF_NOTHROW)
     RAttributes |= ParamAttr::NoUnwind;
 
-  // Check for 'pure' function attribute.
+  // Check for 'readnone' function attribute.
+  if (flags & ECF_CONST)
+    // Since they write the return value through a pointer,
+    // 'sret' functions cannot be 'readnone'.
+    if (!ABIConverter.isStructReturn())
+      RAttributes |= ParamAttr::ReadNone;
+
+  // Check for 'readonly' function attribute.
   if (flags & ECF_PURE)
     // Since they write the return value through a pointer,
-    // 'sret' functions cannot be 'pure'.
+    // 'sret' functions cannot be 'readonly'.
     if (!ABIConverter.isStructReturn())
-      RAttributes |= ParamAttr::Pure;
+      RAttributes |= ParamAttr::ReadOnly;
 
   // Compute whether the result needs to be zext or sext'd.
   if (isa<IntegerType>(RetTy.get())) {





More information about the llvm-commits mailing list