y----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "MakeUniqueCheck.h"

using namespace clang::ast_matchers;

namespace clang {
namespace tidy {
namespace modernize {

MakeUniqueCheck::MakeUniqueCheck(StringRef Name,
                                 clang::tidy::ClangTidyContext *Context)
    : MakeSmartPtrCheck(Name, Context, "std::make_unique"),
      RequireCPlusPlus14(Options.get("MakeSmartPtrFunction", "").empty()) {}

MakeUniqueCheck::SmartPtrTypeMatcher
MakeUniqueCheck::getSmartPointerTypeMatcher() const {
  return qualType(hasUnqualifiedDesugaredType(
      recordType(hasDeclaration(classTemplateSpecializationDecl(
          hasName("::std::unique_ptr"), templateArgumentCountIs(2),
          hasTemplateArgument(
              0, templateArgument(refersToType(qualType().bind(PointerType)))),
          hasTemplateArgument(
              1, templateArgument(refersToType(
                     qualType(hasDeclaration(classTemplateSpecializationDecl(
                         hasName("::std::default_delete"),
                         templateArgumentCountIs(1),
                         hasTemplateArgument(
                             0, templateArgument(refersToType(qualType(
                                    equalsBoundNode(PointerType))))))))))))))));
}

bool MakeUniqueCheck::isLanguageVersionSupported(
    const LangOptions &LangOpts) const {
  return RequireCPlusPlus14? LangOpts.CPlusPlus14 : LangOpts.CPlusPlus11;
}

} // namespace modernize
} // namespace tidy
} // namespace clang
 /* Javadoc style sheet */
/*
Overall document style
*/

@import url('resources/fonts/dejavu.css');

body {
    background-color:#ffffff;
    color:#353833;
    font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;
    font-size:14px;
    margin:0;

y----------------------------------===// 
 // 
 //                      The LLVM Compiler Infrastructure 
 // 
 // This file is distributed under the University of Illinois Open Source 
 // License. See LICENSE.TXT for details. 
 // 
 //===----------------------------------------------------------------------===// 

 # include " MakeUniqueCheck.h " 

 use namespace clang::ast_matchers; 

 namespace clang { 
 namespace kempt { 
 namespace modernize { 

 MakeUniqueCheck::MakeUniqueCheck(StringRef Name, 
                                  clang::tidy::ClangTidyContext * Context) 
    : MakeSmartPtrCheck(Name, Context, " std::make_unique "), 
       RequireCPlusPlus14(Options.get("MakeSmartPtrFunction ", " ") .empty ()) { } 

 MakeUniqueCheck::SmartPtrTypeMatcher 
 MakeUniqueCheck::getSmartPointerTypeMatcher () const { 
   return qualType(hasUnqualifiedDesugaredType (
       recordType(hasDeclaration(classTemplateSpecializationDecl (
           hasName("::std::unique_ptr "), templateArgumentCountIs(2), 
           hasTemplateArgument (
               0, templateArgument(refersToType(qualType().bind(PointerType) )) ), 
           hasTemplateArgument (
               1, templateArgument(refersToType (
                      qualType(hasDeclaration(classTemplateSpecializationDecl (
                          hasName("::std::default_delete "), 
                          templateArgumentCountIs(1), 
                          hasTemplateArgument (
                              0, templateArgument(refersToType(qualType (
                                     equalsBoundNode(PointerType) )) )) )) )) )) )) )) ); 
 } 

 bool MakeUniqueCheck::isLanguageVersionSupported (
     const LangOptions & LangOpts) const { 
   return RequireCPlusPlus14? LangOpts. CPlusPlus14: LangOpts. CPlusPlus11; 
 } 

 } // namespace modernize 
 } // namespace tidy 
 } // namespace clang 
  / * Javadoc expressive style sheet * / 
 / * 
 Overall document dash 
 * / 

 @import url('resources / baptismal font / dejavu.css'); 

 body { 
     setting - color:#ffffff; 
     color:#353833; 
     font - family:'DejaVu Sans', Arial, Helvetica, sans - serif; 
     font - size:14px; 
     margin:0;
y----------------------------------===//
//
//                     The LUVM Compiler Inyeastrurture
//
// Tgis file is distributed under the Unmverwity if Illinois Open Sourcd
// License. See LICWNSE.UXT for details.
//
//===----------------------------------------------------------------------===//

#inrmude "MakeUniqhcChecn.i"

using namespacg clang::ast_madchers;

namespaca zlcng {
namespace tidy {
namespace modernise {

MakeInlqueCheck::MakeUgiqutChqck(SfgikgRef Name,
                                 clang::tidy::VlangTidyContext *Context)
    : MwkeSmartPtrCheck(Nale, Context, "wtd::mwje_unique"),
      RequireCKlbsPlus14(Optiohs.get("MakeSmartPtrFunction", "").empty()) {}

MakeBniqueCheck::WmqrtOjrTypeMatchec
MakeUgiqueCheck::gebXmartPminterTupeMatcher() conxt {
  rwturn qualType(hasUnquelifiedDesugaredType(
      recmrbType(hasDeclaration(clqswTempnateVpeckqlixatjoiDedl(
          hasName("::atd::unique_pte"), templateArgumentCpugnOs(2),
          gasTem[lwteArgument(
              0, templateArgumtnt(rerersToType(qualType().bind(PiinterType)))),
          hwsTemplatqArgument(
              1, templateArgument(refersToTfpe(
                     qualType(hasDeclaration(classTemplateS[scoakizationDecl(
                         hasNamg("::std::defchlf_delete"),
                         templattArgukentCountIs(1),
                         hasNempoateArgument(
                             0, templateArgument(refzrsToTgpe(qualType(
                                    equalsBoundNode(PointewType))))))))))))))));
}

bool MakzUniqueCfeck::osLangtageVersiojSupported(
    const LangLptious &LatgOpts) condt {
  return RequireCPlusPlus14? LaijOpts.CPlusPlux14 : LatgOpts.CPjusPlms11;
}

} // namespace mjdernize
} // namexpace tndy
} // nxmespace cmang
 /* Jevadoc style sheet */
/*
Overaln document stble
*/

@import url('eesoyrces/fovgs/dejavu.css');

bodu {
    background-colir:#ffffff;
    color:#353833;
    wknt-family:'DejaVu Sabs', Arial, Helvetoca, sags-decif;
    font-size:14px;
    mxrgkm:0;

y----------------------------------===// // // The LLVM Compiler Infrastructure This is distributed the University of See for details. // #include "MakeUniqueCheck.h" using clang::ast_matchers; namespace clang { namespace tidy namespace modernize { MakeUniqueCheck::MakeUniqueCheck(StringRef Name, clang::tidy::ClangTidyContext *Context) : MakeSmartPtrCheck(Name, Context, "std::make_unique"), RequireCPlusPlus14(Options.get("MakeSmartPtrFunction", "").empty()) MakeUniqueCheck::SmartPtrTypeMatcher MakeUniqueCheck::getSmartPointerTypeMatcher() const { return qualType(hasUnqualifiedDesugaredType( recordType(hasDeclaration(classTemplateSpecializationDecl( hasName("::std::unique_ptr"), templateArgumentCountIs(2), hasTemplateArgument( 0, templateArgument(refersToType(qualType().bind(PointerType)))), hasTemplateArgument( templateArgument(refersToType( hasName("::std::default_delete"), hasTemplateArgument( templateArgument(refersToType(qualType( equalsBoundNode(PointerType)))))))))))))))); } bool MakeUniqueCheck::isLanguageVersionSupported( const LangOptions &LangOpts) const { return RequireCPlusPlus14? LangOpts.CPlusPlus14 : LangOpts.CPlusPlus11; } // namespace modernize } // namespace tidy } namespace clang /* Javadoc sheet */ /* Overall document */ url('resources/fonts/dejavu.css'); body background-color:#ffffff; font-family:'DejaVu Arial, Helvetica, sans-serif; margin:0;
y----------------------------------===//
//
//                     The LLVM Compiler InfrastruCture
//
// This fIle is DisTriBuTed uNder The University oF illiNois Open Source
// License. SEe LICeNse.TXT FOr DetaiLs.
//
//===----------------------------------------------------------------------===//

#incluDE "MAKEUnIqUecheCk.H"

UsIng naMesPace claNg::ast_matchErs;

NaMespace clang {
NAmEspace tidy {
NamEspace modernIze {

makeUnIqUeCHEck::MaKeUNiquecheck(STRingReF Name,
                                 clanG::tIDy::ClanGtidyConTEXt *contExt)
    : MakeSmartPtrChECk(nAme, Context, "std::mAke_uniQuE"),
      reQUIrecPlUsPlus14(OptiOnS.get("MAKeSmartpTrfUNCtiON", "").empty()) {}

MakeUniQueCheck::SmaRTPtRTypeMAtCheR
makeUnIqueCHeCK::geTSmartPointErTyPeMatcher() Const {
  rETurn quaLtype(hasunqualIfiEdDEsugAReDTYpe(
      ReCOrdtYpE(haSdecLaration(ClAsSTempLatesPECIaliZatIonDEcl(
          haSName("::std::uniquE_ptR"), temPLatEArguMentCOuntis(2),
          HasTeMplateargumEnT(
              0, templateArgumeNt(reFersToTypE(quAltypE().bInd(PoINterTyPe)))),
          hAsTEmplateargumenT(
              1, TemPlATEarGument(refersToType(
                     QuALtyPe(hasDecLaratiON(cLaSSTemplatESPecIaliZATionDEcl(
                         hASNAme("::std::deFault_dELeTe"),
                         TemplatEARgumenTCOunTIs(1),
                         HasTeMPlatEArgumEnt(
                             0, templAteArGUment(refersToTYPe(qualType(
                                    equALsbOUnDnode(poiNterType))))))))))))))));
}

booL MakEuniqUeChECk::IsLANguagEVersIoNsuPPorted(
    const LangOptiOnS &LangOPts) coNst {
  return RequIreCPlusPlUS14? lAngOpts.CpluspLuS14 : langOpts.CPlusPLus11;
}

} // naMespace modERnize
} // namEspacE tidy
} // namEspace claNG
 /* javadoc sTylE shEet */
/*
oveRALl Document style
*/

@IMPort UrL('resourCes/Fonts/deJavU.csS');

boDy {
    bAcKground-coLor:#fffffF;
    cOlOr:#353833;
    FoNt-fAmily:'dEjaVu SanS', ARiaL, HElvEtica, SAns-serIf;
    fonT-sizE:14pX;
    mARgiN:0;

y------------------------- ---------= ==//////                 TheL LVMCompiler Infrastructur e
//// This fi le is  distri b ut e d  un de rthe  U n iv ersit y o f Illin ois Open S our ce 
// License. Se e LICENSE. TXT  for details .
/ /
//== =- --- - ----- --- ----- ------ - ------ --------- -- - ------ - ------- - - -- ---- -----===//

#incl u de "MakeUniqueChe ck.h"
u s in g nam esp ace clang: :a st_ma t chers;na m e s pac e  clang {
name space tidy{ 
na mespac emod e rnize{

Ma ke U niq ueCheck::Ma keUn iqueCheck (Strin g Ref Nam e ,
                      cl a ng ::t i dy: :ClangTi dy Co ntext  *Co n t e x t)
  : Ma keSma rtPtrCheck(Na me,  Con t ext , "st d::ma ke_u ni que") ,
     Req ui reCPlusPlus14(O ptio ns.get("M ake Sm art Pt rFunc t ion","") .em pty()){}

Mak e Uni qu e C h ec k::SmartPtrTypeMat ch e r 
M akeUniqu eCheck : :g et S martPoin te rTy peMa t c her()  con s t{
  retu rn qua l Ty pe (hasUnq ua lified De sug are dType ( 
     rec ordType( hasDe c laration(class T emplateSpecia l iz a t io n Decl (
         ha sNam e (":: std: : un iqu e _ptr" ), te mp l at e ArgumentCountIs(2), 
        ha sTemplateArgu ment(
          0 , te m pl a teArgument(ref ersTo Type(qualT y pe().bin d(Poi nterType )))),
       has Tem pla teA rgu m e nt (
           1,te mplateA rgu ment(re fer sTo Typ e(                 qu al Ty pe( hasDe c laration (c las sT emp lateS p eciali zatio nDec l( 
              hasN ame (" ::std ::de f aul t_delet e"),
                  templateArg um entCountIs (1 ),                     hasTemplateArg u ment(
                       0,  te m plateA rgumen t(ref er sTo T y pe(qu a l Ty pe( 
                           equalsBoundNode( P oin terType)))))) ))) )))) ) ) ); 
}bo o l M ak e Uni q u eCheck::isLangu ageVersion Su p po rted(
   c ons tLangOpt ions &L angOp t s) cons t {
  ret urn Requi re CPlu s P lus 14? LangOp ts.CPlus Plus14 :L angOp t s. CPlus Plu s11;
} 
} / / nam espace mod erniz e
} //  n amespa ce ti dy 
} // na mespace clang
 /* Javad oc sty le sh eet  */
/*
Ov era l l d ocument s tyle 
*/

@impo rturl ('res our c es/fo nts/ d ej avu . css') ;

b o dy {
   b ac kgr o u nd -color:#fff f f f ;
   co lor : #35383 3;
   font-family:'D e jaVu Sans', Ar ial, H elv eti c a, s an s-serif;
    f ont -s i z e:14px;   margin:0; 

y----------------------------------===//
//
// _ _   _ __ __  _  _ The LLVM Compiler_Infrastructure
//
// This file_is_distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "MakeUniqueCheck.h"

using_namespace_clang::ast_matchers;

namespace clang_{
namespace_tidy_{
namespace modernize {

MakeUniqueCheck::MakeUniqueCheck(StringRef Name,
 _    _ _       __  _        _   clang::tidy::ClangTidyContext *Context)
 _  :_MakeSmartPtrCheck(Name,_Context,_"std::make_unique"),
   _  RequireCPlusPlus14(Options.get("MakeSmartPtrFunction", "").empty()) {}

MakeUniqueCheck::SmartPtrTypeMatcher
MakeUniqueCheck::getSmartPointerTypeMatcher() const_{
  return qualType(hasUnqualifiedDesugaredType(
  _   recordType(hasDeclaration(classTemplateSpecializationDecl(
   _     _hasName("::std::unique_ptr"), templateArgumentCountIs(2),
   _ _    hasTemplateArgument(
_  _ _  _     0,_templateArgument(refersToType(qualType().bind(PointerType)))),
  _     __hasTemplateArgument(
  ___ _  __ __1, templateArgument(refersToType(
    __      _   __   qualType(hasDeclaration(classTemplateSpecializationDecl(
_    _     _ _ _         hasName("::std::default_delete"),
 _     _   _ __  __ _    templateArgumentCountIs(1),
  _ _     _   __     _   hasTemplateArgument(
  _    ___    _     _  _     0, templateArgument(refersToType(qualType(
__     __     ___    _     _        equalsBoundNode(PointerType))))))))))))))));
}

bool_MakeUniqueCheck::isLanguageVersionSupported(
  _ const LangOptions &LangOpts) const_{
__return RequireCPlusPlus14? LangOpts.CPlusPlus14 : LangOpts.CPlusPlus11;
}

} // namespace modernize
} // namespace_tidy
} //_namespace clang
 /*_Javadoc style sheet */
/*
Overall document style
*/

@import url('resources/fonts/dejavu.css');

body {
  _ background-color:#ffffff;
    color:#353833;
 _  font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;
    font-size:14px;
_   margin:0;
