summaryrefslogtreecommitdiff
path: root/tools/libclang
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-08-14 23:04:18 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-08-14 23:04:18 +0000
commit49a6b091014f0033829e099ea7ac50bc7b6e9c32 (patch)
tree5c9166fd03b75498e415a487c68e284f39784854 /tools/libclang
parent7410a82389827d6c4f3e9a209445a60f26c8be54 (diff)
downloadclang-49a6b091014f0033829e099ea7ac50bc7b6e9c32.tar.gz
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368942 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang')
-rw-r--r--tools/libclang/CIndex.cpp2
-rw-r--r--tools/libclang/CIndexDiagnostic.cpp6
-rw-r--r--tools/libclang/CIndexer.cpp2
-rw-r--r--tools/libclang/CXLoadedDiagnostic.cpp4
-rw-r--r--tools/libclang/Indexing.cpp8
5 files changed, 11 insertions, 11 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 30b71458c2..344d6f36d1 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -3792,7 +3792,7 @@ static const ExprEvalResult* evaluateExpr(Expr *expr, CXCursor C) {
QualType rettype;
CallExpr *callExpr;
- auto result = llvm::make_unique<ExprEvalResult>();
+ auto result = std::make_unique<ExprEvalResult>();
result->EvalType = CXEval_UnExposed;
result->IsUnsignedInt = false;
diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp
index 6dfdf2d2f9..624e926215 100644
--- a/tools/libclang/CIndexDiagnostic.cpp
+++ b/tools/libclang/CIndexDiagnostic.cpp
@@ -101,7 +101,7 @@ public:
if (Level != DiagnosticsEngine::Note)
CurrentSet = MainSet;
- auto Owner = llvm::make_unique<CXStoredDiagnostic>(*SD, LangOpts);
+ auto Owner = std::make_unique<CXStoredDiagnostic>(*SD, LangOpts);
CXStoredDiagnostic &CD = *Owner;
CurrentSet->appendDiagnostic(std::move(Owner));
@@ -122,7 +122,7 @@ public:
else
L = clang_getNullLocation();
CurrentSet->appendDiagnostic(
- llvm::make_unique<CXDiagnosticCustomNoteImpl>(Message, L));
+ std::make_unique<CXDiagnosticCustomNoteImpl>(Message, L));
}
void emitDiagnosticLoc(FullSourceLoc Loc, PresumedLoc PLoc,
@@ -140,7 +140,7 @@ public:
else
L = clang_getNullLocation();
CurrentSet->appendDiagnostic(
- llvm::make_unique<CXDiagnosticCustomNoteImpl>(Message, L));
+ std::make_unique<CXDiagnosticCustomNoteImpl>(Message, L));
}
CXDiagnosticSetImpl *CurrentSet;
diff --git a/tools/libclang/CIndexer.cpp b/tools/libclang/CIndexer.cpp
index e14bab2f24..f7840925ad 100644
--- a/tools/libclang/CIndexer.cpp
+++ b/tools/libclang/CIndexer.cpp
@@ -52,7 +52,7 @@ void getClangResourcesPathImplAIX(LibClangPathType &LibClangPath) {
size_t BufSize = 2048u;
std::unique_ptr<char[]> Buf;
while (true) {
- Buf = llvm::make_unique<char []>(BufSize);
+ Buf = std::make_unique<char []>(BufSize);
errno = 0;
int Ret = loadquery(L_GETXINFO, Buf.get(), (unsigned int)BufSize);
if (Ret != -1)
diff --git a/tools/libclang/CXLoadedDiagnostic.cpp b/tools/libclang/CXLoadedDiagnostic.cpp
index 3bc658c4cb..b3dcf977b9 100644
--- a/tools/libclang/CXLoadedDiagnostic.cpp
+++ b/tools/libclang/CXLoadedDiagnostic.cpp
@@ -247,7 +247,7 @@ public:
} // end anonymous namespace
CXDiagnosticSet DiagLoader::load(const char *file) {
- TopDiags = llvm::make_unique<CXLoadedDiagnosticSetImpl>();
+ TopDiags = std::make_unique<CXLoadedDiagnosticSetImpl>();
std::error_code EC = readDiagnostics(file);
if (EC) {
@@ -306,7 +306,7 @@ DiagLoader::readRange(const serialized_diags::Location &SDStart,
}
std::error_code DiagLoader::visitStartOfDiagnostic() {
- CurrentDiags.push_back(llvm::make_unique<CXLoadedDiagnostic>());
+ CurrentDiags.push_back(std::make_unique<CXLoadedDiagnostic>());
return std::error_code();
}
diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp
index 1d30bbf605..ad3be53047 100644
--- a/tools/libclang/Indexing.cpp
+++ b/tools/libclang/Indexing.cpp
@@ -368,16 +368,16 @@ public:
DataConsumer->setASTContext(CI.getASTContext());
Preprocessor &PP = CI.getPreprocessor();
- PP.addPPCallbacks(llvm::make_unique<IndexPPCallbacks>(PP, *DataConsumer));
+ PP.addPPCallbacks(std::make_unique<IndexPPCallbacks>(PP, *DataConsumer));
DataConsumer->setPreprocessor(CI.getPreprocessorPtr());
if (SKData) {
auto *PPRec = new PPConditionalDirectiveRecord(PP.getSourceManager());
PP.addPPCallbacks(std::unique_ptr<PPCallbacks>(PPRec));
- SKCtrl = llvm::make_unique<TUSkipBodyControl>(*SKData, *PPRec, PP);
+ SKCtrl = std::make_unique<TUSkipBodyControl>(*SKData, *PPRec, PP);
}
- return llvm::make_unique<IndexingConsumer>(*DataConsumer, SKCtrl.get());
+ return std::make_unique<IndexingConsumer>(*DataConsumer, SKCtrl.get());
}
TranslationUnitKind getTranslationUnitKind() override {
@@ -547,7 +547,7 @@ static CXErrorCode clang_indexSourceFile_Impl(
auto DataConsumer =
std::make_shared<CXIndexDataConsumer>(client_data, CB, index_options,
CXTU->getTU());
- auto InterAction = llvm::make_unique<IndexingFrontendAction>(DataConsumer,
+ auto InterAction = std::make_unique<IndexingFrontendAction>(DataConsumer,
SkipBodies ? IdxSession->SkipBodyData.get() : nullptr);
std::unique_ptr<FrontendAction> IndexAction;
IndexAction = createIndexingAction(DataConsumer,