diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-14 23:04:18 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-14 23:04:18 +0000 |
commit | 2b3d49b610bd2a45884115edcb21110bfa325f51 (patch) | |
tree | 4c64632086b8cf0a8d7ee68306f564532a5ea78f /clang/lib/Lex | |
parent | 5cd312d352dc663aec3b658e2bf5da347f365eb1 (diff) | |
download | bcm5719-llvm-2b3d49b610bd2a45884115edcb21110bfa325f51.tar.gz bcm5719-llvm-2b3d49b610bd2a45884115edcb21110bfa325f51.zip |
[Clang] 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.
Differential revision: https://reviews.llvm.org/D66259
llvm-svn: 368942
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Lex/PPLexerChange.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/Pragma.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index cc5f72e0c95..876090136d5 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1023,7 +1023,7 @@ void Preprocessor::HandleDirective(Token &Result) { // various pseudo-ops. Just return the # token and push back the following // token to be lexed next time. if (getLangOpts().AsmPreprocessor) { - auto Toks = llvm::make_unique<Token[]>(2); + auto Toks = std::make_unique<Token[]>(2); // Return the # and the token after it. Toks[0] = SavedHash; Toks[1] = Result; @@ -1513,7 +1513,7 @@ void Preprocessor::EnterAnnotationToken(SourceRange Range, void *AnnotationVal) { // FIXME: Produce this as the current token directly, rather than // allocating a new token for it. - auto Tok = llvm::make_unique<Token[]>(1); + auto Tok = std::make_unique<Token[]>(1); Tok[0].startToken(); Tok[0].setKind(Kind); Tok[0].setLocation(Range.getBegin()); diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index c520521da5c..dddfe089fe8 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/lib/Lex/PPLexerChange.cpp @@ -128,7 +128,7 @@ void Preprocessor::EnterMacro(Token &Tok, SourceLocation ILEnd, MacroInfo *Macro, MacroArgs *Args) { std::unique_ptr<TokenLexer> TokLexer; if (NumCachedTokenLexers == 0) { - TokLexer = llvm::make_unique<TokenLexer>(Tok, ILEnd, Macro, Args, *this); + TokLexer = std::make_unique<TokenLexer>(Tok, ILEnd, Macro, Args, *this); } else { TokLexer = std::move(TokenLexerCache[--NumCachedTokenLexers]); TokLexer->Init(Tok, ILEnd, Macro, Args); @@ -180,7 +180,7 @@ void Preprocessor::EnterTokenStream(const Token *Toks, unsigned NumToks, // Create a macro expander to expand from the specified token stream. std::unique_ptr<TokenLexer> TokLexer; if (NumCachedTokenLexers == 0) { - TokLexer = llvm::make_unique<TokenLexer>( + TokLexer = std::make_unique<TokenLexer>( Toks, NumToks, DisableMacroExpansion, OwnsTokens, IsReinject, *this); } else { TokLexer = std::move(TokenLexerCache[--NumCachedTokenLexers]); diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 743206b1897..41fa2b0133c 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -804,7 +804,7 @@ MacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, return nullptr; } // Do not lose the EOF/EOD. - auto Toks = llvm::make_unique<Token[]>(1); + auto Toks = std::make_unique<Token[]>(1); Toks[0] = Tok; EnterTokenStream(std::move(Toks), 1, true, /*IsReinject*/ false); break; diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 4e4db668551..8317e99a4f6 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -183,7 +183,7 @@ void Preprocessor::Handle_Pragma(Token &Tok) { assert(!Tokens.empty() && "collected unexpected number of tokens"); // Push the ( "string" ) tokens into the token stream. - auto Toks = llvm::make_unique<Token[]>(Tokens.size()); + auto Toks = std::make_unique<Token[]>(Tokens.size()); std::copy(Tokens.begin() + 1, Tokens.end(), Toks.get()); Toks[Tokens.size() - 1] = Tok; Self.EnterTokenStream(std::move(Toks), Tokens.size(), diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index bdc5fbcd2be..6579319cb3f 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -209,7 +209,7 @@ void Preprocessor::InitializeForModelFile() { // Reset pragmas PragmaHandlersBackup = std::move(PragmaHandlers); - PragmaHandlers = llvm::make_unique<PragmaNamespace>(StringRef()); + PragmaHandlers = std::make_unique<PragmaNamespace>(StringRef()); RegisterBuiltinPragmas(); // Reset PredefinesFileID @@ -1129,7 +1129,7 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) { // Allocate a holding buffer for a sequence of tokens and introduce it into // the token stream. auto EnterTokens = [this](ArrayRef<Token> Toks) { - auto ToksCopy = llvm::make_unique<Token[]>(Toks.size()); + auto ToksCopy = std::make_unique<Token[]>(Toks.size()); std::copy(Toks.begin(), Toks.end(), ToksCopy.get()); EnterTokenStream(std::move(ToksCopy), Toks.size(), /*DisableMacroExpansion*/ true, /*IsReinject*/ false); |