Home | History | Annotate | Download | only in Support
      1 //===- Compiler.h ---------------------------------------------------------===//
      2 //
      3 //                     The MCLinker Project
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 #ifndef MCLD_SUPPORT_COMPILER_H_
     10 #define MCLD_SUPPORT_COMPILER_H_
     11 
     12 #include <llvm/Support/Compiler.h>
     13 
     14 // DISALLOW_COPY_AND_ASSIGN disallows the copy and operator= functions.  It goes
     15 // in the private: declarations in a class.
     16 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
     17   TypeName(const TypeName&) = delete;      \
     18   void operator=(const TypeName&) = delete
     19 
     20 // A macro to disallow all the implicit constructors, namely the default
     21 // constructor, copy constructor and operator= functions.
     22 //
     23 // This should be used in the private: declarations for a class that wants to
     24 // prevent anyone from instantiating it. This is especially useful for classes
     25 // containing only static methods.
     26 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
     27   TypeName() = delete;                           \
     28   DISALLOW_COPY_AND_ASSIGN(TypeName)
     29 
     30 #endif  // MCLD_SUPPORT_COMPILER_H_
     31