Add ATTRIBUTE_UNUSED to methods that are not supposed to be used.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 14 Aug 2010 21:35:10 +0000 (21:35 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 14 Aug 2010 21:35:10 +0000 (21:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111082 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InstCount.cpp
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Linker/LinkModules.cpp
lib/Target/X86/X86MCCodeEmitter.cpp
lib/VMCore/Verifier.cpp
utils/unittest/googletest/include/gtest/internal/gtest-port.h

index dcbcac005a2fc1c1a0bdbc214cd1993ac082725d..32febd6ef055831fd7fb5a4dccf43cd8611de2c9 100644 (file)
@@ -45,7 +45,7 @@ namespace {
 
 #include "llvm/Instruction.def"
 
-    void visitInstruction(Instruction &I) {
+    void visitInstruction(Instruction &I) ATTRIBUTE_UNUSED {
       errs() << "Instruction Count does not know about " << I;
       llvm_unreachable(0);
     }
index 8f999a687586ae6043c391f787243810bb602acb..be2c1ce98627d486071a70c8310b496f7fd889ae 100644 (file)
@@ -135,8 +135,8 @@ namespace {
   /// @brief A class for maintaining the slot number definition
   /// as a placeholder for the actual definition for forward constants defs.
   class ConstantPlaceHolder : public ConstantExpr {
-    ConstantPlaceHolder();                       // DO NOT IMPLEMENT
-    void operator=(const ConstantPlaceHolder &); // DO NOT IMPLEMENT
+    ConstantPlaceHolder() ATTRIBUTE_UNUSED;      // DO NOT IMPLEMENT
+    void operator=(const ConstantPlaceHolder &) ATTRIBUTE_UNUSED;//NOT IMPLEMENT
   public:
     // allocate space for exactly one operand
     void *operator new(size_t s) {
index 4891631bc9c12dcc790c11f4fa9a4875ef9b6b36..4984d934bb313e4f91679588573c6ef615ef6f3d 100644 (file)
@@ -78,8 +78,8 @@ class LinkerTypeMap : public AbstractTypeUser {
   typedef DenseMap<const Type*, PATypeHolder> TheMapTy;
   TheMapTy TheMap;
 
-  LinkerTypeMap(const LinkerTypeMap&); // DO NOT IMPLEMENT
-  void operator=(const LinkerTypeMap&); // DO NOT IMPLEMENT
+  LinkerTypeMap(const LinkerTypeMap&) ATTRIBUTE_UNUSED; // DO NOT IMPLEMENT
+  void operator=(const LinkerTypeMap&) ATTRIBUTE_UNUSED; // DO NOT IMPLEMENT
 public:
   LinkerTypeMap() {}
   ~LinkerTypeMap() {
index b39fce1f79c17b54af9d98a6493a84d89eeb4449..063de1998ee3772626e45080091b0ad9015363e2 100644 (file)
 #include "llvm/MC/MCExpr.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Compiler.h"
 using namespace llvm;
 
 namespace {
 class X86MCCodeEmitter : public MCCodeEmitter {
-  X86MCCodeEmitter(const X86MCCodeEmitter &); // DO NOT IMPLEMENT
-  void operator=(const X86MCCodeEmitter &); // DO NOT IMPLEMENT
+  X86MCCodeEmitter(const X86MCCodeEmitter &) ATTRIBUTE_UNUSED; // DONT IMPLEMENT
+  void operator=(const X86MCCodeEmitter &) ATTRIBUTE_UNUSED; // DO NOT IMPLEMENT
   const TargetMachine &TM;
   const TargetInstrInfo &TII;
   MCContext &Ctx;
index 8ff1551424352faec241fe43f68cb887f78b80d3..3aaf8cbe8107673c4674c26199e93eb71c8f6718 100644 (file)
@@ -151,8 +151,8 @@ namespace {
     SmallSetVector<const Type *, 16> Types;
 
     // Disallow copying.
-    TypeSet(const TypeSet &);
-    TypeSet &operator=(const TypeSet &);
+    TypeSet(const TypeSet &) ATTRIBUTE_UNUSED;
+    TypeSet &operator=(const TypeSet &) ATTRIBUTE_UNUSED;
   };
 
   struct Verifier : public FunctionPass, public InstVisitor<Verifier> {
index 9683271e48f0f3ed1150eae5c0255f4758364815..fb936199f68fb930cb412fbd3ef3cae73801c60b 100644 (file)
 // A macro to disallow operator=
 // This should be used in the private: declarations for a class.
 #define GTEST_DISALLOW_ASSIGN_(type)\
-  void operator=(type const &)
+  void operator=(type const &) GTEST_ATTRIBUTE_UNUSED_
 
 // A macro to disallow copy constructor and operator=
 // This should be used in the private: declarations for a class.
 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
-  type(type const &);\
+  type(type const &) GTEST_ATTRIBUTE_UNUSED_;\
   GTEST_DISALLOW_ASSIGN_(type)
 
 // Tell the compiler to warn about unused return values for functions declared