Switch attribute macros to use 'LLVM_' as a prefix. We retain the old names
authorChandler Carruth <chandlerc@gmail.com>
Sat, 23 Oct 2010 08:10:43 +0000 (08:10 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 23 Oct 2010 08:10:43 +0000 (08:10 +0000)
until other LLVM projects using these are cleaned up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117200 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Function.h
include/llvm/Support/Compiler.h
lib/Target/ARM/ARMExpandPseudoInsts.cpp
lib/Target/X86/X86FloatingPoint.cpp
lib/Target/X86/X86JITInfo.cpp
lib/Transforms/Utils/LowerSwitch.cpp
unittests/ADT/SmallVectorTest.cpp

index 2b19fa5a7f38b8e8932cfd848fae2d7e1d8093b0..9a0825ab4a96cf28e004cc69a80bcbadb46156b8 100644 (file)
@@ -152,7 +152,7 @@ public:
   /// The particular intrinsic functions which correspond to this value are
   /// defined in llvm/Intrinsics.h.
   ///
-  unsigned getIntrinsicID() const ATTRIBUTE_READONLY;
+  unsigned getIntrinsicID() const LLVM_ATTRIBUTE_READONLY;
   bool isIntrinsic() const { return getIntrinsicID() != 0; }
 
   /// getCallingConv()/setCallingConv(CC) - These method get and set the
index 014e801282855329101647d233bca89c314cea8a..83facc395419bbe446215a639a447daaf8651574 100644 (file)
@@ -26,9 +26,9 @@
 #endif
 
 #if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
-#define ATTRIBUTE_USED __attribute__((__used__))
+#define LLVM_ATTRIBUTE_USED __attribute__((__used__))
 #else
-#define ATTRIBUTE_USED
+#define LLVM_ATTRIBUTE_USED
 #endif
 
 // Some compilers warn about unused functions. When a function is sometimes
 //   (void)unused_var_name;
 // Prefer cast-to-void wherever it is sufficient.
 #if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
-#define ATTRIBUTE_UNUSED __attribute__((__unused__))
+#define LLVM_ATTRIBUTE_UNUSED __attribute__((__unused__))
 #else
-#define ATTRIBUTE_UNUSED
+#define LLVM_ATTRIBUTE_UNUSED
 #endif
 
 #ifdef __GNUC__ // aka 'ATTRIBUTE_CONST' but following LLVM Conventions.
-#define ATTRIBUTE_READNONE __attribute__((__const__))
+#define LLVM_ATTRIBUTE_READNONE __attribute__((__const__))
 #else
-#define ATTRIBUTE_READNONE
+#define LLVM_ATTRIBUTE_READNONE
 #endif
 
 #ifdef __GNUC__  // aka 'ATTRIBUTE_PURE' but following LLVM Conventions.
-#define ATTRIBUTE_READONLY __attribute__((__pure__))
+#define LLVM_ATTRIBUTE_READONLY __attribute__((__pure__))
 #else
-#define ATTRIBUTE_READONLY
+#define LLVM_ATTRIBUTE_READONLY
 #endif
 
 #if (__GNUC__ >= 4)
 #define NORETURN
 #endif
 
+// We provide definitions without the LLVM_ prefix briefly while transitioning
+// to always-prefixed names. These will go away as soon as the migration is
+// complete.
+#define ATTRIBUTE_USED LLVM_ATTRIBUTE_USED
+#define ATTRIBUTE_UNUSED LLVM_ATTRIBUTE_UNUSED
+#define ATTRIBUTE_READNONE LLVM_ATTRIBUTE_READNONE
+#define ATTRIBUTE_READONLY LLVM_ATTRIBUTE_READONLY
+
 #endif
index 389fd19a8efc0c7392d0861456609524bb249677..4a7c7719e15051b4a60d03fc7234d90f7ee2a240 100644 (file)
@@ -102,8 +102,8 @@ namespace {
     friend bool operator<(const NEONLdStTableEntry &TE, unsigned PseudoOpc) {
       return TE.PseudoOpc < PseudoOpc;
     }
-    friend bool ATTRIBUTE_UNUSED operator<(unsigned PseudoOpc,
-                                           const NEONLdStTableEntry &TE) {
+    friend bool LLVM_ATTRIBUTE_UNUSED operator<(unsigned PseudoOpc,
+                                                const NEONLdStTableEntry &TE) {
       return PseudoOpc < TE.PseudoOpc;
     }
   };
index 05f0428db5639a3b4336b591009b3edcfe38f9e8..5da6d3ae5cba67c4e2f9747c153c050838f8f1f4 100644 (file)
@@ -575,7 +575,8 @@ namespace {
     friend bool operator<(const TableEntry &TE, unsigned V) {
       return TE.from < V;
     }
-    friend bool ATTRIBUTE_USED operator<(unsigned V, const TableEntry &TE) {
+    friend bool LLVM_ATTRIBUTE_USED operator<(unsigned V,
+                                              const TableEntry &TE) {
       return V < TE.from;
     }
   };
index 6f0a8d91cb58972da202ec3ba4095933f9174347..e83f3595852a443c17e095acb1cfc0b0e18fa0f2 100644 (file)
@@ -337,7 +337,7 @@ extern "C" {
  // no support for inline assembly
 static
 #endif
-void ATTRIBUTE_USED
+void LLVM_ATTRIBUTE_USED
 X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {
   intptr_t *RetAddrLoc = &StackPtr[1];
   assert(*RetAddrLoc == RetAddr &&
index 6db53f44d25c1ab670072b1937d9150108734cfb..914a439718d4438648e293d9c159d1e2ed4d8198 100644 (file)
@@ -109,7 +109,8 @@ bool LowerSwitch::runOnFunction(Function &F) {
 // operator<< - Used for debugging purposes.
 //
 static raw_ostream& operator<<(raw_ostream &O,
-                               const LowerSwitch::CaseVector &C) ATTRIBUTE_USED;
+                               const LowerSwitch::CaseVector &C)
+    LLVM_ATTRIBUTE_USED;
 static raw_ostream& operator<<(raw_ostream &O,
                                const LowerSwitch::CaseVector &C) {
   O << "[";
index 78dc393e5c18dfb9e70b47a46b8378d5f06ebe85..f4da54dbca1a639fe963d9950d4a6c28580dc417 100644 (file)
@@ -77,7 +77,7 @@ public:
     return c0.getValue() == c1.getValue();
   }
 
-  friend bool ATTRIBUTE_UNUSED
+  friend bool LLVM_ATTRIBUTE_UNUSED
   operator!=(const Constructable & c0, const Constructable & c1) {
     return c0.getValue() != c1.getValue();
   }