From 0eaee545eef49ff9498234d3a51a5cbde59bf976 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 15 Aug 2019 15:54:37 +0000 Subject: [llvm] Migrate llvm::make_unique to std::make_unique Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013 --- llvm/lib/TableGen/Record.cpp | 2 +- llvm/lib/TableGen/SetTheory.cpp | 22 +++++++++++----------- llvm/lib/TableGen/TGLexer.cpp | 4 ++-- llvm/lib/TableGen/TGParser.cpp | 18 +++++++++--------- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'llvm/lib/TableGen') diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index 27d1bdc7f4c..e4ab39df087 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -1616,7 +1616,7 @@ void VarDefInit::Profile(FoldingSetNodeID &ID) const { DefInit *VarDefInit::instantiate() { if (!Def) { RecordKeeper &Records = Class->getRecords(); - auto NewRecOwner = make_unique(Records.getNewAnonymousName(), + auto NewRecOwner = std::make_unique(Records.getNewAnonymousName(), Class->getLoc(), Records, /*IsAnonymous=*/true); Record *NewRec = NewRecOwner.get(); diff --git a/llvm/lib/TableGen/SetTheory.cpp b/llvm/lib/TableGen/SetTheory.cpp index a870e41d58f..5a30ee98cce 100644 --- a/llvm/lib/TableGen/SetTheory.cpp +++ b/llvm/lib/TableGen/SetTheory.cpp @@ -255,16 +255,16 @@ void SetTheory::Operator::anchor() {} void SetTheory::Expander::anchor() {} SetTheory::SetTheory() { - addOperator("add", llvm::make_unique()); - addOperator("sub", llvm::make_unique()); - addOperator("and", llvm::make_unique()); - addOperator("shl", llvm::make_unique()); - addOperator("trunc", llvm::make_unique()); - addOperator("rotl", llvm::make_unique(false)); - addOperator("rotr", llvm::make_unique(true)); - addOperator("decimate", llvm::make_unique()); - addOperator("interleave", llvm::make_unique()); - addOperator("sequence", llvm::make_unique()); + addOperator("add", std::make_unique()); + addOperator("sub", std::make_unique()); + addOperator("and", std::make_unique()); + addOperator("shl", std::make_unique()); + addOperator("trunc", std::make_unique()); + addOperator("rotl", std::make_unique(false)); + addOperator("rotr", std::make_unique(true)); + addOperator("decimate", std::make_unique()); + addOperator("interleave", std::make_unique()); + addOperator("sequence", std::make_unique()); } void SetTheory::addOperator(StringRef Name, std::unique_ptr Op) { @@ -276,7 +276,7 @@ void SetTheory::addExpander(StringRef ClassName, std::unique_ptr E) { } void SetTheory::addFieldExpander(StringRef ClassName, StringRef FieldName) { - addExpander(ClassName, llvm::make_unique(FieldName)); + addExpander(ClassName, std::make_unique(FieldName)); } void SetTheory::evaluate(Init *Expr, RecSet &Elts, ArrayRef Loc) { diff --git a/llvm/lib/TableGen/TGLexer.cpp b/llvm/lib/TableGen/TGLexer.cpp index d28c62b3133..da2286e41fe 100644 --- a/llvm/lib/TableGen/TGLexer.cpp +++ b/llvm/lib/TableGen/TGLexer.cpp @@ -51,7 +51,7 @@ TGLexer::TGLexer(SourceMgr &SM, ArrayRef Macros) : SrcMgr(SM) { // Pretend that we enter the "top-level" include file. PrepIncludeStack.push_back( - make_unique>()); + std::make_unique>()); // Put all macros defined in the command line into the DefinedMacros set. std::for_each(Macros.begin(), Macros.end(), @@ -393,7 +393,7 @@ bool TGLexer::LexInclude() { CurPtr = CurBuf.begin(); PrepIncludeStack.push_back( - make_unique>()); + std::make_unique>()); return false; } diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index a9ace152d59..a076966aff0 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -378,7 +378,7 @@ bool TGParser::resolve(const ForeachLoop &Loop, SubstStack &Substs, auto LI = dyn_cast(List); if (!LI) { if (!Final) { - Dest->emplace_back(make_unique(Loop.Loc, Loop.IterVar, + Dest->emplace_back(std::make_unique(Loop.Loc, Loop.IterVar, List)); return resolve(Loop.Entries, Substs, Final, &Dest->back().Loop->Entries, Loc); @@ -413,7 +413,7 @@ bool TGParser::resolve(const std::vector &Source, if (E.Loop) { Error = resolve(*E.Loop, Substs, Final, Dest); } else { - auto Rec = make_unique(*E.Rec); + auto Rec = std::make_unique(*E.Rec); if (Loc) Rec->appendLoc(*Loc); @@ -1330,7 +1330,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { std::unique_ptr ParseRecTmp; Record *ParseRec = CurRec; if (!ParseRec) { - ParseRecTmp = make_unique(".parse", ArrayRef{}, Records); + ParseRecTmp = std::make_unique(".parse", ArrayRef{}, Records); ParseRec = ParseRecTmp.get(); } @@ -1597,7 +1597,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { std::unique_ptr ParseRecTmp; Record *ParseRec = CurRec; if (!ParseRec) { - ParseRecTmp = make_unique(".parse", ArrayRef{}, Records); + ParseRecTmp = std::make_unique(".parse", ArrayRef{}, Records); ParseRec = ParseRecTmp.get(); } @@ -2702,10 +2702,10 @@ bool TGParser::ParseDef(MultiClass *CurMultiClass) { return true; if (isa(Name)) - CurRec = make_unique(Records.getNewAnonymousName(), DefLoc, Records, + CurRec = std::make_unique(Records.getNewAnonymousName(), DefLoc, Records, /*Anonymous=*/true); else - CurRec = make_unique(Name, DefLoc, Records); + CurRec = std::make_unique(Name, DefLoc, Records); if (ParseObjectBody(CurRec.get())) return true; @@ -2783,7 +2783,7 @@ bool TGParser::ParseForeach(MultiClass *CurMultiClass) { Lex.Lex(); // Eat the in // Create a loop object and remember it. - Loops.push_back(llvm::make_unique(Loc, IterName, ListValue)); + Loops.push_back(std::make_unique(Loc, IterName, ListValue)); if (Lex.getCode() != tgtok::l_brace) { // FOREACH Declaration IN Object @@ -2834,7 +2834,7 @@ bool TGParser::ParseClass() { } else { // If this is the first reference to this class, create and add it. auto NewRec = - llvm::make_unique(Lex.getCurStrVal(), Lex.getLoc(), Records, + std::make_unique(Lex.getCurStrVal(), Lex.getLoc(), Records, /*Class=*/true); CurRec = NewRec.get(); Records.addClass(std::move(NewRec)); @@ -2963,7 +2963,7 @@ bool TGParser::ParseMultiClass() { auto Result = MultiClasses.insert(std::make_pair(Name, - llvm::make_unique(Name, Lex.getLoc(),Records))); + std::make_unique(Name, Lex.getLoc(),Records))); if (!Result.second) return TokError("multiclass '" + Name + "' already defined"); -- cgit v1.2.3