[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h

Reid Spencer reid at x10sys.com
Fri Jan 5 09:06:37 PST 2007



Changes in directory llvm/include/llvm:

DerivedTypes.h updated: 1.76 -> 1.77
---
Log message:

Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0. 
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but 
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for 
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but 
in each case bison's decision to choose the shift is correct so there 
shouldn't be any damage from these conflicts.


---
Diffs of the changes:  (+5 -4)

 DerivedTypes.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.76 llvm/include/llvm/DerivedTypes.h:1.77
--- llvm/include/llvm/DerivedTypes.h:1.76	Thu Jan  4 11:50:42 2007
+++ llvm/include/llvm/DerivedTypes.h	Fri Jan  5 11:06:19 2007
@@ -81,9 +81,10 @@
   /// set of possible attributes.
   /// @brief Function parameter attributes enumeration.
   enum ParameterAttributes {
-    NoAttributeSet = 0, ///< No attribute value has been set on the parameter
-    ZExtAttribute  = 1, ///< The parameter should be zero extended before call
-    SExtAttribute  = 2  ///< The parameter should be sign extended before call
+    NoAttributeSet    = 0,      ///< No attribute value has been set 
+    ZExtAttribute     = 1,      ///< zero extended before/after call
+    SExtAttribute     = 1 << 1, ///< sign extended before/after call
+    NoReturnAttribute = 1 << 2  ///< mark the function as not returning
   };
   typedef std::vector<ParameterAttributes> ParamAttrsList;
 private:
@@ -142,7 +143,7 @@
   }
 
   /// @brief Convert a ParameterAttribute into its assembly text
-  static const char * getParamAttrsText(ParameterAttributes Attr);
+  static std::string getParamAttrsText(ParameterAttributes Attr);
 
   // Implement the AbstractTypeUser interface.
   virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);






More information about the llvm-commits mailing list