[llvm-commits] [llvm] r44273 - in /llvm/trunk: docs/LangRef.html include/llvm/ParameterAttributes.h lib/AsmParser/LLLexer.cpp lib/AsmParser/llvmAsmParser.y lib/VMCore/Function.cpp lib/VMCore/Verifier.cpp

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


Author: baldrick
Date: Thu Nov 22 14:23:04 2007
New Revision: 44273

URL: http://llvm.org/viewvc/llvm-project?rev=44273&view=rev
Log:
Rename the 'const' parameter attribute to 'readnone',
and the 'pure' parameter attribute to 'readonly'.
Names suggested by DannyB.

Modified:
    llvm/trunk/docs/LangRef.html
    llvm/trunk/include/llvm/ParameterAttributes.h
    llvm/trunk/lib/AsmParser/LLLexer.cpp
    llvm/trunk/lib/AsmParser/llvmAsmParser.y
    llvm/trunk/lib/VMCore/Function.cpp
    llvm/trunk/lib/VMCore/Verifier.cpp

Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=44273&r1=44272&r2=44273&view=diff

==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Thu Nov 22 14:23:04 2007
@@ -813,13 +813,13 @@
     <dt><tt>nest</tt></dt>
     <dd>This indicates that the parameter can be excised using the
     <a href="#int_trampoline">trampoline intrinsics</a>.</dd>
-    <dt><tt>pure</tt></dt>
+    <dt><tt>readonly</tt></dt>
     <dd>This function attribute indicates that the function has no side-effects
-    except for producing a return value.  The value returned must only depend on
-    the function arguments and/or global variables.  It may use values obtained
-    by dereferencing pointers.</dd>
-    <dt><tt>const</tt></dt>
-    <dd>A <tt>const</tt> function has the same restrictions as a <tt>pure</tt>
+    except for producing a return value or throwing an exception.  The value
+    returned must only depend on the function arguments and/or global variables.
+    It may use values obtained by dereferencing pointers.</dd>
+    <dt><tt>readnone</tt></dt>
+    <dd>A <tt>readnone</tt> function has the same restrictions as a <tt>readonly</tt>
     function, but in addition it is not allowed to dereference any pointer arguments
     or global variables.
   </dl>

Modified: llvm/trunk/include/llvm/ParameterAttributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ParameterAttributes.h?rev=44273&r1=44272&r2=44273&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ParameterAttributes.h (original)
+++ llvm/trunk/include/llvm/ParameterAttributes.h Thu Nov 22 14:23:04 2007
@@ -39,8 +39,8 @@
   NoAlias    = 1 << 6,  ///< Considered to not alias after call
   ByVal      = 1 << 7,  ///< Pass structure by value
   Nest       = 1 << 8,  ///< Nested function static chain
-  Pure       = 1 << 9,  ///< Function is pure
-  Const      = 1 << 10  ///< Function is const
+  ReadNone   = 1 << 9,  ///< Function does not access memory
+  ReadOnly   = 1 << 10  ///< Function only reads from memory
 };
 
 }

Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=44273&r1=44272&r2=44273&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Thu Nov 22 14:23:04 2007
@@ -484,8 +484,8 @@
   KEYWORD("noalias", NOALIAS);
   KEYWORD("byval", BYVAL);
   KEYWORD("nest", NEST);
-  KEYWORD("pure", PURE);
-  KEYWORD("const", CONST);
+  KEYWORD("readnone", READNONE);
+  KEYWORD("readonly", READONLY);
   
   KEYWORD("type", TYPE);
   KEYWORD("opaque", OPAQUE);

Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=44273&r1=44272&r2=44273&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Thu Nov 22 14:23:04 2007
@@ -1090,7 +1090,7 @@
 
 // Function Attributes
 %token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
-%token CONST PURE
+%token READNONE READONLY
 
 // Visibility Styles
 %token DEFAULT HIDDEN PROTECTED
@@ -1234,8 +1234,8 @@
               | NOUNWIND { $$ = ParamAttr::NoUnwind; }
               | ZEROEXT  { $$ = ParamAttr::ZExt;     }
               | SIGNEXT  { $$ = ParamAttr::SExt;     }
-              | PURE     { $$ = ParamAttr::Pure;     }
-              | CONST    { $$ = ParamAttr::Const;    }
+              | READNONE { $$ = ParamAttr::ReadNone; }
+              | READONLY { $$ = ParamAttr::ReadOnly; }
               ;
 
 OptFuncAttrs  : /* empty */ { $$ = ParamAttr::None; }

Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=44273&r1=44272&r2=44273&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Thu Nov 22 14:23:04 2007
@@ -108,10 +108,10 @@
     Result += "byval ";
   if (Attrs & ParamAttr::Nest)
     Result += "nest ";
-  if (Attrs & ParamAttr::Pure)
-    Result += "pure ";
-  if (Attrs & ParamAttr::Const)
-    Result += "const ";  
+  if (Attrs & ParamAttr::ReadNone)
+    Result += "readnone ";
+  if (Attrs & ParamAttr::ReadOnly)
+    Result += "readonly ";
   return Result;
 }
 

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=44273&r1=44272&r2=44273&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Thu Nov 22 14:23:04 2007
@@ -399,7 +399,7 @@
 
   const uint16_t ParameterIncompatible =
     ParamAttr::NoReturn | ParamAttr::NoUnwind |
-    ParamAttr::Const    | ParamAttr::Pure;
+    ParamAttr::ReadNone | ParamAttr::ReadOnly;
 
   const uint16_t MutuallyIncompatible[3] = {
     ParamAttr::ByVal | ParamAttr::InReg |
@@ -407,7 +407,7 @@
 
     ParamAttr::ZExt | ParamAttr::SExt,
 
-    ParamAttr::Pure | ParamAttr::Const
+    ParamAttr::ReadNone | ParamAttr::ReadOnly
   };
 
   const uint16_t IntegerTypeOnly =





More information about the llvm-commits mailing list