Enable response files in all tools. Patch by Liu, Yaxun (Sam). I have simplified
[oota-llvm.git] / include / llvm / Instructions.h
index 7a0379e371bd61bcac4dd84cbb581c4d6aaa9ad8..597eca5aa46b40961e284f74d5de44b51f19f1e5 100644 (file)
@@ -1267,13 +1267,24 @@ public:
   /// removeAttribute - removes the attribute from the list of attributes.
   void removeAttribute(unsigned i, Attributes attr);
 
-  /// \brief Return true if this call has the given attribute.
-  bool hasFnAttr(Attributes N) const {
-    return paramHasAttr(~0, N);
-  }
-
-  /// @brief Determine whether the call or the callee has the given attribute.
-  bool paramHasAttr(unsigned i, Attributes attr) const;
+  /// @brief Determine whether this call has the given attribute.
+  bool fnHasNoAliasAttr() const;
+  bool fnHasNoInlineAttr() const;
+  bool fnHasNoReturnAttr() const;
+  bool fnHasNoUnwindAttr() const;
+  bool fnHasReadNoneAttr() const;
+  bool fnHasReadOnlyAttr() const;
+  bool fnHasReturnsTwiceAttr() const;
+
+  /// @brief Determine whether the call or the callee has the given attributes.
+  bool paramHasByValAttr(unsigned i) const;
+  bool paramHasInRegAttr(unsigned i) const;
+  bool paramHasNestAttr(unsigned i) const;
+  bool paramHasNoAliasAttr(unsigned i) const;
+  bool paramHasNoCaptureAttr(unsigned i) const;
+  bool paramHasSExtAttr(unsigned i) const;
+  bool paramHasStructRetAttr(unsigned i) const;
+  bool paramHasZExtAttr(unsigned i) const;
 
   /// @brief Extract the alignment for a call or parameter (0=unknown).
   unsigned getParamAlignment(unsigned i) const {
@@ -1281,7 +1292,7 @@ public:
   }
 
   /// @brief Return true if the call should not be inlined.
-  bool isNoInline() const { return hasFnAttr(Attribute::NoInline); }
+  bool isNoInline() const { return fnHasNoInlineAttr(); }
   void setIsNoInline(bool Value = true) {
     if (Value) addAttribute(~0, Attribute::NoInline);
     else removeAttribute(~0, Attribute::NoInline);
@@ -1289,7 +1300,7 @@ public:
 
   /// @brief Return true if the call can return twice
   bool canReturnTwice() const {
-    return hasFnAttr(Attribute::ReturnsTwice);
+    return fnHasReturnsTwiceAttr();
   }
   void setCanReturnTwice(bool Value = true) {
     if (Value) addAttribute(~0, Attribute::ReturnsTwice);
@@ -1298,7 +1309,7 @@ public:
 
   /// @brief Determine if the call does not access memory.
   bool doesNotAccessMemory() const {
-    return hasFnAttr(Attribute::ReadNone);
+    return fnHasReadNoneAttr();
   }
   void setDoesNotAccessMemory(bool NotAccessMemory = true) {
     if (NotAccessMemory) addAttribute(~0, Attribute::ReadNone);
@@ -1307,7 +1318,7 @@ public:
 
   /// @brief Determine if the call does not access or only reads memory.
   bool onlyReadsMemory() const {
-    return doesNotAccessMemory() || hasFnAttr(Attribute::ReadOnly);
+    return doesNotAccessMemory() || fnHasReadOnlyAttr();
   }
   void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
     if (OnlyReadsMemory) addAttribute(~0, Attribute::ReadOnly);
@@ -1315,14 +1326,14 @@ public:
   }
 
   /// @brief Determine if the call cannot return.
-  bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); }
+  bool doesNotReturn() const { return fnHasNoReturnAttr(); }
   void setDoesNotReturn(bool DoesNotReturn = true) {
     if (DoesNotReturn) addAttribute(~0, Attribute::NoReturn);
     else removeAttribute(~0, Attribute::NoReturn);
   }
 
   /// @brief Determine if the call cannot unwind.
-  bool doesNotThrow() const { return hasFnAttr(Attribute::NoUnwind); }
+  bool doesNotThrow() const { return fnHasNoUnwindAttr(); }
   void setDoesNotThrow(bool DoesNotThrow = true) {
     if (DoesNotThrow) addAttribute(~0, Attribute::NoUnwind);
     else removeAttribute(~0, Attribute::NoUnwind);
@@ -1332,12 +1343,15 @@ public:
   /// pointer argument.
   bool hasStructRetAttr() const {
     // Be friendly and also check the callee.
-    return paramHasAttr(1, Attribute::StructRet);
+    return paramHasStructRetAttr(1);
   }
 
   /// @brief Determine if any call argument is an aggregate passed by value.
   bool hasByValArgument() const {
-    return AttributeList.hasAttrSomewhere(Attribute::ByVal);
+    for (unsigned I = 0, E = AttributeList.getNumAttrs(); I != E; ++I)
+      if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attributes::ByVal))
+        return true;
+    return false;
   }
 
   /// getCalledFunction - Return the function called, or null if this is an
@@ -3029,13 +3043,24 @@ public:
   /// removeAttribute - removes the attribute from the list of attributes.
   void removeAttribute(unsigned i, Attributes attr);
 
-  /// \brief Return true if this call has the given attribute.
-  bool hasFnAttr(Attributes N) const {
-    return paramHasAttr(~0, N);
-  }
-
-  /// @brief Determine whether the call or the callee has the given attribute.
-  bool paramHasAttr(unsigned i, Attributes attr) const;
+  /// @brief Determine whether this call has the NoAlias attribute.
+  bool fnHasNoAliasAttr() const;
+  bool fnHasNoInlineAttr() const;
+  bool fnHasNoReturnAttr() const;
+  bool fnHasNoUnwindAttr() const;
+  bool fnHasReadNoneAttr() const;
+  bool fnHasReadOnlyAttr() const;
+  bool fnHasReturnsTwiceAttr() const;
+
+  /// @brief Determine whether the call or the callee has the given attributes.
+  bool paramHasSExtAttr(unsigned i) const;
+  bool paramHasZExtAttr(unsigned i) const;
+  bool paramHasInRegAttr(unsigned i) const;
+  bool paramHasStructRetAttr(unsigned i) const;
+  bool paramHasNestAttr(unsigned i) const;
+  bool paramHasByValAttr(unsigned i) const;
+  bool paramHasNoAliasAttr(unsigned i) const;
+  bool paramHasNoCaptureAttr(unsigned i) const;
 
   /// @brief Extract the alignment for a call or parameter (0=unknown).
   unsigned getParamAlignment(unsigned i) const {
@@ -3043,7 +3068,7 @@ public:
   }
 
   /// @brief Return true if the call should not be inlined.
-  bool isNoInline() const { return hasFnAttr(Attribute::NoInline); }
+  bool isNoInline() const { return fnHasNoInlineAttr(); }
   void setIsNoInline(bool Value = true) {
     if (Value) addAttribute(~0, Attribute::NoInline);
     else removeAttribute(~0, Attribute::NoInline);
@@ -3051,7 +3076,7 @@ public:
 
   /// @brief Determine if the call does not access memory.
   bool doesNotAccessMemory() const {
-    return hasFnAttr(Attribute::ReadNone);
+    return fnHasReadNoneAttr();
   }
   void setDoesNotAccessMemory(bool NotAccessMemory = true) {
     if (NotAccessMemory) addAttribute(~0, Attribute::ReadNone);
@@ -3060,7 +3085,7 @@ public:
 
   /// @brief Determine if the call does not access or only reads memory.
   bool onlyReadsMemory() const {
-    return doesNotAccessMemory() || hasFnAttr(Attribute::ReadOnly);
+    return doesNotAccessMemory() || fnHasReadOnlyAttr();
   }
   void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
     if (OnlyReadsMemory) addAttribute(~0, Attribute::ReadOnly);
@@ -3068,14 +3093,14 @@ public:
   }
 
   /// @brief Determine if the call cannot return.
-  bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); }
+  bool doesNotReturn() const { return fnHasNoReturnAttr(); }
   void setDoesNotReturn(bool DoesNotReturn = true) {
     if (DoesNotReturn) addAttribute(~0, Attribute::NoReturn);
     else removeAttribute(~0, Attribute::NoReturn);
   }
 
   /// @brief Determine if the call cannot unwind.
-  bool doesNotThrow() const { return hasFnAttr(Attribute::NoUnwind); }
+  bool doesNotThrow() const { return fnHasNoUnwindAttr(); }
   void setDoesNotThrow(bool DoesNotThrow = true) {
     if (DoesNotThrow) addAttribute(~0, Attribute::NoUnwind);
     else removeAttribute(~0, Attribute::NoUnwind);
@@ -3085,12 +3110,15 @@ public:
   /// pointer argument.
   bool hasStructRetAttr() const {
     // Be friendly and also check the callee.
-    return paramHasAttr(1, Attribute::StructRet);
+    return paramHasStructRetAttr(1);
   }
 
   /// @brief Determine if any call argument is an aggregate passed by value.
   bool hasByValArgument() const {
-    return AttributeList.hasAttrSomewhere(Attribute::ByVal);
+    for (unsigned I = 0, E = AttributeList.getNumAttrs(); I != E; ++I)
+      if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attributes::ByVal))
+        return true;
+    return false;
   }
 
   /// getCalledFunction - Return the function called, or null if this is an