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/Format | |
| 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/Format')
| -rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/Format/Format.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 9f19e9e6d9b..61aeb853c41 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -1795,7 +1795,7 @@ ContinuationIndenter::createBreakableToken(const FormatToken &Current, unsigned UnbreakableTailLength = (State.NextToken && canBreak(State)) ? 0 : Current.UnbreakableTailLength; - return llvm::make_unique<BreakableStringLiteral>( + return std::make_unique<BreakableStringLiteral>( Current, StartColumn, Prefix, Postfix, UnbreakableTailLength, State.Line->InPPDirective, Encoding, Style); } @@ -1807,7 +1807,7 @@ ContinuationIndenter::createBreakableToken(const FormatToken &Current, switchesFormatting(Current)) { return nullptr; } - return llvm::make_unique<BreakableBlockComment>( + return std::make_unique<BreakableBlockComment>( Current, StartColumn, Current.OriginalColumn, !Current.Previous, State.Line->InPPDirective, Encoding, Style, Whitespaces.useCRLF()); } else if (Current.is(TT_LineComment) && @@ -1817,7 +1817,7 @@ ContinuationIndenter::createBreakableToken(const FormatToken &Current, CommentPragmasRegex.match(Current.TokenText.substr(2)) || switchesFormatting(Current)) return nullptr; - return llvm::make_unique<BreakableLineCommentSection>( + return std::make_unique<BreakableLineCommentSection>( Current, StartColumn, Current.OriginalColumn, !Current.Previous, /*InPPDirective=*/false, Encoding, Style); } diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index c15c00ec047..4fbaee470fa 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -2303,7 +2303,7 @@ reformat(const FormatStyle &Style, StringRef Code, }); auto Env = - llvm::make_unique<Environment>(Code, FileName, Ranges, FirstStartColumn, + std::make_unique<Environment>(Code, FileName, Ranges, FirstStartColumn, NextStartColumn, LastStartColumn); llvm::Optional<std::string> CurrentCode = None; tooling::Replacements Fixes; @@ -2317,7 +2317,7 @@ reformat(const FormatStyle &Style, StringRef Code, Penalty += PassFixes.second; if (I + 1 < E) { CurrentCode = std::move(*NewCode); - Env = llvm::make_unique<Environment>( + Env = std::make_unique<Environment>( *CurrentCode, FileName, tooling::calculateRangesAfterReplacements(Fixes, Ranges), FirstStartColumn, NextStartColumn, LastStartColumn); diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 9b3094b913e..bbb243dd329 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -145,7 +145,7 @@ public: else if (!Parser.Line->Tokens.empty()) Parser.CurrentLines = &Parser.Line->Tokens.back().Children; PreBlockLine = std::move(Parser.Line); - Parser.Line = llvm::make_unique<UnwrappedLine>(); + Parser.Line = std::make_unique<UnwrappedLine>(); Parser.Line->Level = PreBlockLine->Level; Parser.Line->InPPDirective = PreBlockLine->InPPDirective; } |

