[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
This commit is contained in:
Jonas Devlieghere 2019-08-14 23:04:18 +00:00
parent 5cd312d352
commit 2b3d49b610
259 changed files with 831 additions and 831 deletions

View file

@ -41,7 +41,7 @@ class AnnotateFunctionsAction : public PluginASTAction {
public:
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
llvm::StringRef) override {
return llvm::make_unique<AnnotateFunctionsConsumer>();
return std::make_unique<AnnotateFunctionsConsumer>();
}
bool ParseArgs(const CompilerInstance &CI,

View file

@ -81,7 +81,7 @@ class PrintFunctionNamesAction : public PluginASTAction {
protected:
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
llvm::StringRef) override {
return llvm::make_unique<PrintFunctionsConsumer>(CI, ParsedTemplates);
return std::make_unique<PrintFunctionsConsumer>(CI, ParsedTemplates);
}
bool ParseArgs(const CompilerInstance &CI,

View file

@ -58,7 +58,7 @@ private:
IRCompileLayer CompileLayer{ES, ObjectLayer, SimpleCompiler(*TM)};
static std::unique_ptr<SectionMemoryManager> createMemMgr() {
return llvm::make_unique<SectionMemoryManager>();
return std::make_unique<SectionMemoryManager>();
}
SimpleJIT(

View file

@ -47,7 +47,7 @@ public:
ASTImporterSharedState() = default;
ASTImporterSharedState(TranslationUnitDecl &ToTU) {
LookupTable = llvm::make_unique<ASTImporterLookupTable>(ToTU);
LookupTable = std::make_unique<ASTImporterLookupTable>(ToTU);
}
ASTImporterLookupTable *getLookupTable() { return LookupTable.get(); }

View file

@ -144,7 +144,7 @@ AtomicScopeModel::create(AtomicScopeModelKind K) {
case AtomicScopeModelKind::None:
return std::unique_ptr<AtomicScopeModel>{};
case AtomicScopeModelKind::OpenCL:
return llvm::make_unique<AtomicScopeOpenCLModel>();
return std::make_unique<AtomicScopeOpenCLModel>();
}
llvm_unreachable("Invalid atomic scope model kind");
}

View file

@ -315,7 +315,7 @@ public:
CodeCompletionTUInfo &getCodeCompletionTUInfo() {
if (!CCTUInfo)
CCTUInfo = llvm::make_unique<CodeCompletionTUInfo>(
CCTUInfo = std::make_unique<CodeCompletionTUInfo>(
std::make_shared<GlobalCodeCompletionAllocator>());
return *CCTUInfo;
}

View file

@ -994,7 +994,7 @@ public:
PPCallbacks *getPPCallbacks() const { return Callbacks.get(); }
void addPPCallbacks(std::unique_ptr<PPCallbacks> C) {
if (Callbacks)
C = llvm::make_unique<PPChainedCallbacks>(std::move(C),
C = std::make_unique<PPChainedCallbacks>(std::move(C),
std::move(Callbacks));
Callbacks = std::move(C);
}
@ -1471,7 +1471,7 @@ public:
if (LexLevel) {
// It's not correct in general to enter caching lex mode while in the
// middle of a nested lexing action.
auto TokCopy = llvm::make_unique<Token[]>(1);
auto TokCopy = std::make_unique<Token[]>(1);
TokCopy[0] = Tok;
EnterTokenStream(std::move(TokCopy), 1, true, IsReinject);
} else {

View file

@ -97,7 +97,7 @@ public:
bool EnteringContext)
: Typo(TypoName.getName().getAsIdentifierInfo()), CurrentTCIndex(0),
SavedTCIndex(0), SemaRef(SemaRef), S(S),
SS(SS ? llvm::make_unique<CXXScopeSpec>(*SS) : nullptr),
SS(SS ? std::make_unique<CXXScopeSpec>(*SS) : nullptr),
CorrectionValidator(std::move(CCC)), MemberContext(MemberContext),
Result(SemaRef, TypoName, LookupKind),
Namespaces(SemaRef.Context, SemaRef.CurContext, SS),

View file

@ -356,7 +356,7 @@ public:
: CorrectionCandidateCallback(Typo, TypoNNS) {}
std::unique_ptr<CorrectionCandidateCallback> clone() override {
return llvm::make_unique<DefaultFilterCCC>(*this);
return std::make_unique<DefaultFilterCCC>(*this);
}
};
@ -369,7 +369,7 @@ public:
return candidate.getCorrectionDeclAs<C>();
}
std::unique_ptr<CorrectionCandidateCallback> clone() override {
return llvm::make_unique<DeclFilterCCC>(*this);
return std::make_unique<DeclFilterCCC>(*this);
}
};
@ -384,7 +384,7 @@ public:
bool ValidateCandidate(const TypoCorrection &candidate) override;
std::unique_ptr<CorrectionCandidateCallback> clone() override {
return llvm::make_unique<FunctionCallFilterCCC>(*this);
return std::make_unique<FunctionCallFilterCCC>(*this);
}
private:
@ -409,7 +409,7 @@ public:
return false;
}
std::unique_ptr<CorrectionCandidateCallback> clone() override {
return llvm::make_unique<NoTypoCorrectionCCC>(*this);
return std::make_unique<NoTypoCorrectionCCC>(*this);
}
};

View file

@ -1578,7 +1578,7 @@ public:
/// Takes ownership of \p L.
void addListener(std::unique_ptr<ASTReaderListener> L) {
if (Listener)
L = llvm::make_unique<ChainedASTReaderListener>(std::move(L),
L = std::make_unique<ChainedASTReaderListener>(std::move(L),
std::move(Listener));
Listener = std::move(L);
}
@ -1594,7 +1594,7 @@ public:
auto Old = Reader.takeListener();
if (Old) {
Chained = true;
L = llvm::make_unique<ChainedASTReaderListener>(std::move(L),
L = std::make_unique<ChainedASTReaderListener>(std::move(L),
std::move(Old));
}
Reader.setListener(std::move(L));

View file

@ -646,7 +646,7 @@ public:
public:
const NoteTag *makeNoteTag(Callback &&Cb, bool IsPrunable = false) {
// We cannot use make_unique because we cannot access the private
// We cannot use std::make_unique because we cannot access the private
// constructor from inside it.
std::unique_ptr<NoteTag> T(new NoteTag(std::move(Cb), IsPrunable));
Tags.push_back(std::move(T));

View file

@ -337,7 +337,7 @@ public:
bool IsSink = false);
std::unique_ptr<ExplodedGraph> MakeEmptyGraph() const {
return llvm::make_unique<ExplodedGraph>();
return std::make_unique<ExplodedGraph>();
}
/// addRoot - Add an untyped node to the set of roots.

View file

@ -71,7 +71,7 @@ public:
/// Constructs a tree from any AST node.
template <class T>
SyntaxTree(T *Node, ASTContext &AST)
: TreeImpl(llvm::make_unique<Impl>(this, Node, AST)) {}
: TreeImpl(std::make_unique<Impl>(this, Node, AST)) {}
SyntaxTree(SyntaxTree &&Other) = default;
~SyntaxTree();

View file

@ -148,7 +148,7 @@ createRefactoringActionRule(const RequirementTypes &... Requirements) {
std::tuple<RequirementTypes...> Requirements;
};
return llvm::make_unique<Rule>(std::make_tuple(Requirements...));
return std::make_unique<Rule>(std::make_tuple(Requirements...));
}
} // end namespace tooling

View file

@ -453,8 +453,8 @@ public:
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override {
CI.getPreprocessor().addPPCallbacks(
llvm::make_unique<ARCMTMacroTrackerPPCallbacks>(ARCMTMacroLocs));
return llvm::make_unique<ASTConsumer>();
std::make_unique<ARCMTMacroTrackerPPCallbacks>(ARCMTMacroLocs));
return std::make_unique<ASTConsumer>();
}
};

View file

@ -208,10 +208,10 @@ ObjCMigrateAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
CI.getPreprocessor().addPPCallbacks(std::unique_ptr<PPCallbacks>(PPRec));
std::vector<std::unique_ptr<ASTConsumer>> Consumers;
Consumers.push_back(WrapperFrontendAction::CreateASTConsumer(CI, InFile));
Consumers.push_back(llvm::make_unique<ObjCMigrateASTConsumer>(
Consumers.push_back(std::make_unique<ObjCMigrateASTConsumer>(
MigrateDir, ObjCMigAction, Remapper, CompInst->getFileManager(), PPRec,
CompInst->getPreprocessor(), false, None));
return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
return std::make_unique<MultiplexConsumer>(std::move(Consumers));
}
bool ObjCMigrateAction::BeginInvocation(CompilerInstance &CI) {
@ -2034,7 +2034,7 @@ MigrateSourceAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
CI.getPreprocessor().addPPCallbacks(std::unique_ptr<PPCallbacks>(PPRec));
std::vector<std::string> WhiteList =
getWhiteListFilenames(CI.getFrontendOpts().ObjCMTWhiteListPath);
return llvm::make_unique<ObjCMigrateASTConsumer>(
return std::make_unique<ObjCMigrateASTConsumer>(
CI.getFrontendOpts().OutputFile, ObjCMTAction, Remapper,
CI.getFileManager(), PPRec, CI.getPreprocessor(),
/*isOutputFile=*/true, WhiteList);

View file

@ -10472,7 +10472,7 @@ ASTContext::getParents(const ast_type_traits::DynTypedNode &Node) {
if (!Parents)
// We build the parent map for the traversal scope (usually whole TU), as
// hasAncestor can escape any subtree.
Parents = llvm::make_unique<ParentMap>(*this);
Parents = std::make_unique<ParentMap>(*this);
return Parents->getParents(Node);
}

View file

@ -44,7 +44,7 @@ void CXXBasePaths::ComputeDeclsFound() {
Decls.insert(Path->Decls.front());
NumDeclsFound = Decls.size();
DeclsFound = llvm::make_unique<NamedDecl *[]>(NumDeclsFound);
DeclsFound = std::make_unique<NamedDecl *[]>(NumDeclsFound);
std::copy(Decls.begin(), Decls.end(), DeclsFound.get());
}

View file

@ -320,7 +320,7 @@ ExternalASTMerger::ExternalASTMerger(const ImporterTarget &Target,
void ExternalASTMerger::AddSources(llvm::ArrayRef<ImporterSource> Sources) {
for (const ImporterSource &S : Sources) {
assert(&S.AST != &Target.AST);
Importers.push_back(llvm::make_unique<LazyASTImporter>(
Importers.push_back(std::make_unique<LazyASTImporter>(
*this, Target.AST, Target.FM, S.AST, S.FM, S.OM));
}
}

View file

@ -218,7 +218,7 @@ public:
std::unique_ptr<MangleNumberingContext>
createMangleNumberingContext() const override {
return llvm::make_unique<ItaniumNumberingContext>();
return std::make_unique<ItaniumNumberingContext>();
}
};
}

View file

@ -470,7 +470,7 @@ private:
};
ASTNameGenerator::ASTNameGenerator(ASTContext &Ctx)
: Impl(llvm::make_unique<Implementation>(Ctx)) {}
: Impl(std::make_unique<Implementation>(Ctx)) {}
ASTNameGenerator::~ASTNameGenerator() {}

View file

@ -132,7 +132,7 @@ public:
std::unique_ptr<MangleNumberingContext>
createMangleNumberingContext() const override {
return llvm::make_unique<MicrosoftNumberingContext>();
return std::make_unique<MicrosoftNumberingContext>();
}
};
}

View file

@ -2268,7 +2268,7 @@ CreateVTableLayout(const ItaniumVTableBuilder &Builder) {
SmallVector<VTableLayout::VTableThunkTy, 1>
VTableThunks(Builder.vtable_thunks_begin(), Builder.vtable_thunks_end());
return llvm::make_unique<VTableLayout>(
return std::make_unique<VTableLayout>(
Builder.VTableIndices, Builder.vtable_components(), VTableThunks,
Builder.getAddressPoints());
}
@ -3253,7 +3253,7 @@ void MicrosoftVTableContext::computeVTablePaths(bool ForVBTables,
// Base case: this subobject has its own vptr.
if (ForVBTables ? Layout.hasOwnVBPtr() : Layout.hasOwnVFPtr())
Paths.push_back(llvm::make_unique<VPtrInfo>(RD));
Paths.push_back(std::make_unique<VPtrInfo>(RD));
// Recursive case: get all the vbtables from our bases and remove anything
// that shares a virtual base.
@ -3276,7 +3276,7 @@ void MicrosoftVTableContext::computeVTablePaths(bool ForVBTables,
continue;
// Copy the path and adjust it as necessary.
auto P = llvm::make_unique<VPtrInfo>(*BaseInfo);
auto P = std::make_unique<VPtrInfo>(*BaseInfo);
// We mangle Base into the path if the path would've been ambiguous and it
// wasn't already extended with Base.
@ -3562,7 +3562,7 @@ void MicrosoftVTableContext::computeVTableRelatedInformation(
const VTableLayout::AddressPointsMapTy EmptyAddressPointsMap;
{
auto VFPtrs = llvm::make_unique<VPtrInfoVector>();
auto VFPtrs = std::make_unique<VPtrInfoVector>();
computeVTablePaths(/*ForVBTables=*/false, RD, *VFPtrs);
computeFullPathsForVFTables(Context, RD, *VFPtrs);
VFPtrLocations[RD] = std::move(VFPtrs);
@ -3576,7 +3576,7 @@ void MicrosoftVTableContext::computeVTableRelatedInformation(
assert(VFTableLayouts.count(id) == 0);
SmallVector<VTableLayout::VTableThunkTy, 1> VTableThunks(
Builder.vtable_thunks_begin(), Builder.vtable_thunks_end());
VFTableLayouts[id] = llvm::make_unique<VTableLayout>(
VFTableLayouts[id] = std::make_unique<VTableLayout>(
ArrayRef<size_t>{0}, Builder.vtable_components(), VTableThunks,
EmptyAddressPointsMap);
Thunks.insert(Builder.thunks_begin(), Builder.thunks_end());
@ -3668,7 +3668,7 @@ const VirtualBaseInfo &MicrosoftVTableContext::computeVBTableRelatedInformation(
std::unique_ptr<VirtualBaseInfo> &Entry = VBaseInfo[RD];
if (Entry)
return *Entry;
Entry = llvm::make_unique<VirtualBaseInfo>();
Entry = std::make_unique<VirtualBaseInfo>();
VBI = Entry.get();
}

View file

@ -1078,7 +1078,7 @@ bool MatchFinder::addDynamicMatcher(const internal::DynTypedMatcher &NodeMatch,
}
std::unique_ptr<ASTConsumer> MatchFinder::newASTConsumer() {
return llvm::make_unique<internal::MatchASTConsumer>(this, ParsingDone);
return std::make_unique<internal::MatchASTConsumer>(this, ParsingDone);
}
void MatchFinder::match(const clang::ast_type_traits::DynTypedNode &Node,

View file

@ -729,7 +729,7 @@ std::unique_ptr<MatcherDescriptor>
makeMatcherAutoMarshall(ReturnType (*Func)(), StringRef MatcherName) {
std::vector<ast_type_traits::ASTNodeKind> RetTypes;
BuildReturnTypeVector<ReturnType>::build(RetTypes);
return llvm::make_unique<FixedArgCountMatcherDescriptor>(
return std::make_unique<FixedArgCountMatcherDescriptor>(
matcherMarshall0<ReturnType>, reinterpret_cast<void (*)()>(Func),
MatcherName, RetTypes, None);
}
@ -741,7 +741,7 @@ makeMatcherAutoMarshall(ReturnType (*Func)(ArgType1), StringRef MatcherName) {
std::vector<ast_type_traits::ASTNodeKind> RetTypes;
BuildReturnTypeVector<ReturnType>::build(RetTypes);
ArgKind AK = ArgTypeTraits<ArgType1>::getKind();
return llvm::make_unique<FixedArgCountMatcherDescriptor>(
return std::make_unique<FixedArgCountMatcherDescriptor>(
matcherMarshall1<ReturnType, ArgType1>,
reinterpret_cast<void (*)()>(Func), MatcherName, RetTypes, AK);
}
@ -755,7 +755,7 @@ makeMatcherAutoMarshall(ReturnType (*Func)(ArgType1, ArgType2),
BuildReturnTypeVector<ReturnType>::build(RetTypes);
ArgKind AKs[] = { ArgTypeTraits<ArgType1>::getKind(),
ArgTypeTraits<ArgType2>::getKind() };
return llvm::make_unique<FixedArgCountMatcherDescriptor>(
return std::make_unique<FixedArgCountMatcherDescriptor>(
matcherMarshall2<ReturnType, ArgType1, ArgType2>,
reinterpret_cast<void (*)()>(Func), MatcherName, RetTypes, AKs);
}
@ -766,7 +766,7 @@ template <typename ResultT, typename ArgT,
std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::VariadicFunction<ResultT, ArgT, Func> VarFunc,
StringRef MatcherName) {
return llvm::make_unique<VariadicFuncMatcherDescriptor>(VarFunc, MatcherName);
return std::make_unique<VariadicFuncMatcherDescriptor>(VarFunc, MatcherName);
}
/// Overload for VariadicDynCastAllOfMatchers.
@ -778,7 +778,7 @@ std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::VariadicDynCastAllOfMatcher<BaseT, DerivedT>
VarFunc,
StringRef MatcherName) {
return llvm::make_unique<DynCastAllOfMatcherDescriptor>(VarFunc, MatcherName);
return std::make_unique<DynCastAllOfMatcherDescriptor>(VarFunc, MatcherName);
}
/// Argument adaptative overload.
@ -791,7 +791,7 @@ std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
std::vector<std::unique_ptr<MatcherDescriptor>> Overloads;
AdaptativeOverloadCollector<ArgumentAdapterT, FromTypes, ToTypes>(MatcherName,
Overloads);
return llvm::make_unique<OverloadedMatcherDescriptor>(Overloads);
return std::make_unique<OverloadedMatcherDescriptor>(Overloads);
}
template <template <typename ToArg, typename FromArg> class ArgumentAdapterT,
@ -810,7 +810,7 @@ std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::VariadicOperatorMatcherFunc<MinCount, MaxCount>
Func,
StringRef MatcherName) {
return llvm::make_unique<VariadicOperatorMatcherDescriptor>(
return std::make_unique<VariadicOperatorMatcherDescriptor>(
MinCount, MaxCount, Func.Op, MatcherName);
}

View file

@ -71,7 +71,7 @@ void RegistryMaps::registerMatcher(
#define REGISTER_MATCHER_OVERLOAD(name) \
registerMatcher(#name, \
llvm::make_unique<internal::OverloadedMatcherDescriptor>(name##Callbacks))
std::make_unique<internal::OverloadedMatcherDescriptor>(name##Callbacks))
#define SPECIFIC_MATCHER_OVERLOAD(name, Id) \
static_cast<::clang::ast_matchers::name##_Type##Id>( \

View file

@ -302,7 +302,7 @@ AnalysisDeclContext *AnalysisDeclContextManager::getContext(const Decl *D) {
std::unique_ptr<AnalysisDeclContext> &AC = Contexts[D];
if (!AC)
AC = llvm::make_unique<AnalysisDeclContext>(this, D, cfgBuildOptions);
AC = std::make_unique<AnalysisDeclContext>(this, D, cfgBuildOptions);
return AC.get();
}

View file

@ -166,7 +166,7 @@ CallGraphNode *CallGraph::getOrInsertNode(Decl *F) {
if (Node)
return Node.get();
Node = llvm::make_unique<CallGraphNode>(F);
Node = std::make_unique<CallGraphNode>(F);
// Make Root node a parent of all functions to make sure all are reachable.
if (F)
Root->addCallee(Node.get());

View file

@ -1026,7 +1026,7 @@ void ConsumedBlockInfo::addInfo(
} else if (OwnedStateMap)
Entry = std::move(OwnedStateMap);
else
Entry = llvm::make_unique<ConsumedStateMap>(*StateMap);
Entry = std::make_unique<ConsumedStateMap>(*StateMap);
}
void ConsumedBlockInfo::addInfo(const CFGBlock *Block,
@ -1058,7 +1058,7 @@ ConsumedBlockInfo::getInfo(const CFGBlock *Block) {
assert(Block && "Block pointer must not be NULL");
auto &Entry = StateMapsArray[Block->getBlockID()];
return isBackEdgeTarget(Block) ? llvm::make_unique<ConsumedStateMap>(*Entry)
return isBackEdgeTarget(Block) ? std::make_unique<ConsumedStateMap>(*Entry)
: std::move(Entry);
}
@ -1317,7 +1317,7 @@ void ConsumedAnalyzer::run(AnalysisDeclContext &AC) {
BlockInfo = ConsumedBlockInfo(CFGraph->getNumBlockIDs(), SortedGraph);
CurrStates = llvm::make_unique<ConsumedStateMap>();
CurrStates = std::make_unique<ConsumedStateMap>();
ConsumedStmtVisitor Visitor(*this, CurrStates.get());
// Add all trackable parameters to the state map.

View file

@ -882,7 +882,7 @@ public:
StringRef DiagKind) const override {
FSet.removeLock(FactMan, Cp);
if (!Cp.negative()) {
FSet.addLock(FactMan, llvm::make_unique<LockableFactEntry>(
FSet.addLock(FactMan, std::make_unique<LockableFactEntry>(
!Cp, LK_Exclusive, UnlockLoc));
}
}
@ -987,7 +987,7 @@ private:
} else {
FSet.removeLock(FactMan, !Cp);
FSet.addLock(FactMan,
llvm::make_unique<LockableFactEntry>(Cp, kind, loc));
std::make_unique<LockableFactEntry>(Cp, kind, loc));
}
}
@ -996,7 +996,7 @@ private:
StringRef DiagKind) const {
if (FSet.findLock(FactMan, Cp)) {
FSet.removeLock(FactMan, Cp);
FSet.addLock(FactMan, llvm::make_unique<LockableFactEntry>(
FSet.addLock(FactMan, std::make_unique<LockableFactEntry>(
!Cp, LK_Exclusive, loc));
} else if (Handler) {
Handler->handleUnmatchedUnlock(DiagKind, Cp.toString(), loc);
@ -1551,11 +1551,11 @@ void ThreadSafetyAnalyzer::getEdgeLockset(FactSet& Result,
// Add and remove locks.
SourceLocation Loc = Exp->getExprLoc();
for (const auto &ExclusiveLockToAdd : ExclusiveLocksToAdd)
addLock(Result, llvm::make_unique<LockableFactEntry>(ExclusiveLockToAdd,
addLock(Result, std::make_unique<LockableFactEntry>(ExclusiveLockToAdd,
LK_Exclusive, Loc),
CapDiagKind);
for (const auto &SharedLockToAdd : SharedLocksToAdd)
addLock(Result, llvm::make_unique<LockableFactEntry>(SharedLockToAdd,
addLock(Result, std::make_unique<LockableFactEntry>(SharedLockToAdd,
LK_Shared, Loc),
CapDiagKind);
}
@ -1840,7 +1840,7 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
Analyzer->getMutexIDs(AssertLocks, A, Exp, D, VD);
for (const auto &AssertLock : AssertLocks)
Analyzer->addLock(FSet,
llvm::make_unique<LockableFactEntry>(
std::make_unique<LockableFactEntry>(
AssertLock, LK_Exclusive, Loc, false, true),
ClassifyDiagnostic(A));
break;
@ -1852,7 +1852,7 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
Analyzer->getMutexIDs(AssertLocks, A, Exp, D, VD);
for (const auto &AssertLock : AssertLocks)
Analyzer->addLock(FSet,
llvm::make_unique<LockableFactEntry>(
std::make_unique<LockableFactEntry>(
AssertLock, LK_Shared, Loc, false, true),
ClassifyDiagnostic(A));
break;
@ -1864,7 +1864,7 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
Analyzer->getMutexIDs(AssertLocks, A, Exp, D, VD);
for (const auto &AssertLock : AssertLocks)
Analyzer->addLock(FSet,
llvm::make_unique<LockableFactEntry>(
std::make_unique<LockableFactEntry>(
AssertLock,
A->isShared() ? LK_Shared : LK_Exclusive, Loc,
false, true),
@ -1928,11 +1928,11 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
// Add locks.
for (const auto &M : ExclusiveLocksToAdd)
Analyzer->addLock(FSet, llvm::make_unique<LockableFactEntry>(
Analyzer->addLock(FSet, std::make_unique<LockableFactEntry>(
M, LK_Exclusive, Loc, isScopedVar),
CapDiagKind);
for (const auto &M : SharedLocksToAdd)
Analyzer->addLock(FSet, llvm::make_unique<LockableFactEntry>(
Analyzer->addLock(FSet, std::make_unique<LockableFactEntry>(
M, LK_Shared, Loc, isScopedVar),
CapDiagKind);
@ -1944,7 +1944,7 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
// FIXME: does this store a pointer to DRE?
CapabilityExpr Scp = Analyzer->SxBuilder.translateAttrExpr(&DRE, nullptr);
auto ScopedEntry = llvm::make_unique<ScopedLockableFactEntry>(Scp, MLoc);
auto ScopedEntry = std::make_unique<ScopedLockableFactEntry>(Scp, MLoc);
for (const auto &M : ExclusiveLocksToAdd)
ScopedEntry->addExclusiveLock(M);
for (const auto &M : ScopedExclusiveReqs)
@ -2349,12 +2349,12 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
// FIXME -- Loc can be wrong here.
for (const auto &Mu : ExclusiveLocksToAdd) {
auto Entry = llvm::make_unique<LockableFactEntry>(Mu, LK_Exclusive, Loc);
auto Entry = std::make_unique<LockableFactEntry>(Mu, LK_Exclusive, Loc);
Entry->setDeclared(true);
addLock(InitialLockset, std::move(Entry), CapDiagKind, true);
}
for (const auto &Mu : SharedLocksToAdd) {
auto Entry = llvm::make_unique<LockableFactEntry>(Mu, LK_Shared, Loc);
auto Entry = std::make_unique<LockableFactEntry>(Mu, LK_Shared, Loc);
Entry->setDeclared(true);
addLock(InitialLockset, std::move(Entry), CapDiagKind, true);
}
@ -2523,10 +2523,10 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
// issue the appropriate warning.
// FIXME: the location here is not quite right.
for (const auto &Lock : ExclusiveLocksAcquired)
ExpectedExitSet.addLock(FactMan, llvm::make_unique<LockableFactEntry>(
ExpectedExitSet.addLock(FactMan, std::make_unique<LockableFactEntry>(
Lock, LK_Exclusive, D->getLocation()));
for (const auto &Lock : SharedLocksAcquired)
ExpectedExitSet.addLock(FactMan, llvm::make_unique<LockableFactEntry>(
ExpectedExitSet.addLock(FactMan, std::make_unique<LockableFactEntry>(
Lock, LK_Shared, D->getLocation()));
for (const auto &Lock : LocksReleased)
ExpectedExitSet.removeLock(FactMan, Lock);

View file

@ -37,7 +37,7 @@ void MainCallChecker::checkPreStmt(const CallExpr *CE,
BT.reset(new BugType(this, "call to main", "example analyzer plugin"));
std::unique_ptr<BugReport> report =
llvm::make_unique<BugReport>(*BT, BT->getName(), N);
std::make_unique<BugReport>(*BT, BT->getName(), N);
report->addRange(Callee->getSourceRange());
C.emitReport(std::move(report));
}

View file

@ -98,7 +98,7 @@ void FileManager::addAncestorsAsVirtualDirs(StringRef Path) {
return;
// Add the virtual directory to the cache.
auto UDE = llvm::make_unique<DirectoryEntry>();
auto UDE = std::make_unique<DirectoryEntry>();
UDE->Name = NamedDirEnt.first();
NamedDirEnt.second = *UDE.get();
VirtualDirectoryEntries.push_back(std::move(UDE));
@ -345,7 +345,7 @@ FileManager::getVirtualFile(StringRef Filename, off_t Size,
UFE->IsNamedPipe = Status.getType() == llvm::sys::fs::file_type::fifo_file;
fillRealPathName(UFE, Status.getName());
} else {
VirtualFileEntries.push_back(llvm::make_unique<FileEntry>());
VirtualFileEntries.push_back(std::make_unique<FileEntry>());
UFE = VirtualFileEntries.back().get();
NamedFileEnt.second = *UFE;
}

View file

@ -505,7 +505,7 @@ llvm::MemoryBuffer *SourceManager::getFakeBufferForRecovery() const {
const SrcMgr::ContentCache *
SourceManager::getFakeContentCacheForRecovery() const {
if (!FakeContentCacheForRecovery) {
FakeContentCacheForRecovery = llvm::make_unique<SrcMgr::ContentCache>();
FakeContentCacheForRecovery = std::make_unique<SrcMgr::ContentCache>();
FakeContentCacheForRecovery->replaceBuffer(getFakeBufferForRecovery(),
/*DoNotFree=*/true);
}
@ -1927,7 +1927,7 @@ SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const {
std::unique_ptr<MacroArgsMap> &MacroArgsCache = MacroArgsCacheMap[FID];
if (!MacroArgsCache) {
MacroArgsCache = llvm::make_unique<MacroArgsMap>();
MacroArgsCache = std::make_unique<MacroArgsMap>();
computeMacroArgsCache(*MacroArgsCache, FID);
}
@ -2256,13 +2256,13 @@ SourceManagerForFile::SourceManagerForFile(StringRef FileName,
// This is passed to `SM` as reference, so the pointer has to be referenced
// in `Environment` so that `FileMgr` can out-live this function scope.
FileMgr =
llvm::make_unique<FileManager>(FileSystemOptions(), InMemoryFileSystem);
std::make_unique<FileManager>(FileSystemOptions(), InMemoryFileSystem);
// This is passed to `SM` as reference, so the pointer has to be referenced
// by `Environment` due to the same reason above.
Diagnostics = llvm::make_unique<DiagnosticsEngine>(
Diagnostics = std::make_unique<DiagnosticsEngine>(
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs),
new DiagnosticOptions);
SourceMgr = llvm::make_unique<SourceManager>(*Diagnostics, *FileMgr);
SourceMgr = std::make_unique<SourceManager>(*Diagnostics, *FileMgr);
FileID ID = SourceMgr->createFileID(*FileMgr->getFile(FileName),
SourceLocation(), clang::SrcMgr::C_User);
assert(ID.isValid());

View file

@ -119,7 +119,7 @@ class EmitAssemblyHelper {
std::unique_ptr<llvm::ToolOutputFile> openOutputFile(StringRef Path) {
std::error_code EC;
auto F = llvm::make_unique<llvm::ToolOutputFile>(Path, EC,
auto F = std::make_unique<llvm::ToolOutputFile>(Path, EC,
llvm::sys::fs::OF_None);
if (EC) {
Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message();
@ -1424,7 +1424,7 @@ static void runThinLTOBackend(ModuleSummaryIndex *CombinedIndex, Module *M,
OwnedImports.push_back(std::move(*MBOrErr));
}
auto AddStream = [&](size_t Task) {
return llvm::make_unique<lto::NativeObjectStream>(std::move(OS));
return std::make_unique<lto::NativeObjectStream>(std::move(OS));
};
lto::Config Conf;
if (CGOpts.SaveTempsFilePrefix != "") {
@ -1536,7 +1536,7 @@ void clang::EmitBackendOutput(DiagnosticsEngine &Diags,
// trying to read it. Also for some features, like CFI, we must skip
// the compilation as CombinedIndex does not contain all required
// information.
EmptyModule = llvm::make_unique<llvm::Module>("empty", M->getContext());
EmptyModule = std::make_unique<llvm::Module>("empty", M->getContext());
EmptyModule->setTargetTriple(M->getTargetTriple());
M = EmptyModule.get();
}

View file

@ -903,7 +903,7 @@ struct NoExpansion : TypeExpansion {
static std::unique_ptr<TypeExpansion>
getTypeExpansion(QualType Ty, const ASTContext &Context) {
if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) {
return llvm::make_unique<ConstantArrayExpansion>(
return std::make_unique<ConstantArrayExpansion>(
AT->getElementType(), AT->getSize().getZExtValue());
}
if (const RecordType *RT = Ty->getAs<RecordType>()) {
@ -947,13 +947,13 @@ getTypeExpansion(QualType Ty, const ASTContext &Context) {
Fields.push_back(FD);
}
}
return llvm::make_unique<RecordExpansion>(std::move(Bases),
return std::make_unique<RecordExpansion>(std::move(Bases),
std::move(Fields));
}
if (const ComplexType *CT = Ty->getAs<ComplexType>()) {
return llvm::make_unique<ComplexExpansion>(CT->getElementType());
return std::make_unique<ComplexExpansion>(CT->getElementType());
}
return llvm::make_unique<NoExpansion>();
return std::make_unique<NoExpansion>();
}
static int getExpansionSize(QualType Ty, const ASTContext &Context) {

View file

@ -2030,7 +2030,7 @@ llvm::Function *CGOpenMPRuntimeNVPTX::emitTeamsOutlinedFunction(
auto I = Rt.FunctionGlobalizedDecls.try_emplace(CGF.CurFn).first;
I->getSecond().GlobalRecord = GlobalizedRD;
I->getSecond().MappedParams =
llvm::make_unique<CodeGenFunction::OMPMapVars>();
std::make_unique<CodeGenFunction::OMPMapVars>();
DeclToAddrMapTy &Data = I->getSecond().LocalVarData;
for (const auto &Pair : MappedDeclsFields) {
assert(Pair.getFirst()->isCanonicalDecl() &&
@ -4637,7 +4637,7 @@ void CGOpenMPRuntimeNVPTX::emitFunctionProlog(CodeGenFunction &CGF,
return;
auto I = FunctionGlobalizedDecls.try_emplace(CGF.CurFn).first;
I->getSecond().MappedParams =
llvm::make_unique<CodeGenFunction::OMPMapVars>();
std::make_unique<CodeGenFunction::OMPMapVars>();
I->getSecond().GlobalRecord = GlobalizedVarsRecord;
I->getSecond().EscapedParameters.insert(
VarChecker.getEscapedParameters().begin(),

View file

@ -261,7 +261,7 @@ namespace clang {
std::unique_ptr<DiagnosticHandler> OldDiagnosticHandler =
Ctx.getDiagnosticHandler();
Ctx.setDiagnosticHandler(llvm::make_unique<ClangDiagnosticHandler>(
Ctx.setDiagnosticHandler(std::make_unique<ClangDiagnosticHandler>(
CodeGenOpts, this));
Expected<std::unique_ptr<llvm::ToolOutputFile>> OptRecordFileOrErr =
@ -915,7 +915,7 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
if (CI.getCodeGenOpts().getDebugInfo() != codegenoptions::NoDebugInfo &&
CI.getCodeGenOpts().MacroDebugInfo) {
std::unique_ptr<PPCallbacks> Callbacks =
llvm::make_unique<MacroPPCallbacks>(BEConsumer->getCodeGenerator(),
std::make_unique<MacroPPCallbacks>(BEConsumer->getCodeGenerator(),
CI.getPreprocessor());
CI.getPreprocessor().addPPCallbacks(std::move(Callbacks));
}
@ -976,7 +976,7 @@ CodeGenAction::loadModule(MemoryBufferRef MBRef) {
// the file was already processed by indexing and will be passed to the
// linker using merged object file.
if (!Bm) {
auto M = llvm::make_unique<llvm::Module>("empty", *VMContext);
auto M = std::make_unique<llvm::Module>("empty", *VMContext);
M->setTargetTriple(CI.getTargetOpts().Triple);
return M;
}

View file

@ -5815,7 +5815,7 @@ void CodeGenModule::getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
llvm::SanitizerStatReport &CodeGenModule::getSanStats() {
if (!SanStats)
SanStats = llvm::make_unique<llvm::SanitizerStatReport>(&getModule());
SanStats = std::make_unique<llvm::SanitizerStatReport>(&getModule());
return *SanStats;
}

View file

@ -980,7 +980,7 @@ void CodeGenPGO::loadRegionCounts(llvm::IndexedInstrProfReader *PGOReader,
return;
}
ProfRecord =
llvm::make_unique<llvm::InstrProfRecord>(std::move(RecordExpected.get()));
std::make_unique<llvm::InstrProfRecord>(std::move(RecordExpected.get()));
RegionCounts = ProfRecord->Counts;
}

View file

@ -297,7 +297,7 @@ public:
Diags, HeaderSearchOpts, CodeGenOpts, TargetOpts, LangOpts,
Ctx.getTargetInfo().getDataLayout(), M.get(),
BackendAction::Backend_EmitLL,
llvm::make_unique<llvm::raw_svector_ostream>(Buffer));
std::make_unique<llvm::raw_svector_ostream>(Buffer));
llvm::dbgs() << Buffer;
});
@ -321,7 +321,7 @@ ObjectFilePCHContainerWriter::CreatePCHContainerGenerator(
const std::string &OutputFileName,
std::unique_ptr<llvm::raw_pwrite_stream> OS,
std::shared_ptr<PCHBuffer> Buffer) const {
return llvm::make_unique<PCHContainerGenerator>(
return std::make_unique<PCHContainerGenerator>(
CI, MainFileName, OutputFileName, std::move(OS), Buffer);
}

View file

@ -186,7 +186,7 @@ void DirectoryWatcherLinux::InotifyPollingLoop() {
struct Buffer {
alignas(struct inotify_event) char buffer[EventBufferLength];
};
auto ManagedBuffer = llvm::make_unique<Buffer>();
auto ManagedBuffer = std::make_unique<Buffer>();
char *const Buf = ManagedBuffer->buffer;
const int EpollFD = epoll_create1(EPOLL_CLOEXEC);
@ -354,7 +354,7 @@ llvm::Expected<std::unique_ptr<DirectoryWatcher>> clang::DirectoryWatcher::creat
std::string("SemaphorePipe::create() error: ") + strerror(errno),
llvm::inconvertibleErrorCode());
return llvm::make_unique<DirectoryWatcherLinux>(
return std::make_unique<DirectoryWatcherLinux>(
Path, Receiver, WaitForInitialSync, InotifyFD, InotifyWD,
std::move(*InotifyPollingStopper));
}

View file

@ -217,7 +217,7 @@ llvm::Expected<std::unique_ptr<DirectoryWatcher>> clang::DirectoryWatcher::creat
assert(EventStream && "EventStream expected to be non-null");
std::unique_ptr<DirectoryWatcher> Result =
llvm::make_unique<DirectoryWatcherMac>(EventStream, Receiver, Path);
std::make_unique<DirectoryWatcherMac>(EventStream, Receiver, Path);
// We need to copy the data so the lifetime is ok after a const copy is made
// for the block.

View file

@ -626,7 +626,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
// because the device toolchain we create depends on both.
auto &CudaTC = ToolChains[CudaTriple.str() + "/" + HostTriple.str()];
if (!CudaTC) {
CudaTC = llvm::make_unique<toolchains::CudaToolChain>(
CudaTC = std::make_unique<toolchains::CudaToolChain>(
*this, CudaTriple, *HostTC, C.getInputArgs(), OFK);
}
C.addOffloadDeviceToolChain(CudaTC.get(), OFK);
@ -641,7 +641,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
// because the device toolchain we create depends on both.
auto &HIPTC = ToolChains[HIPTriple.str() + "/" + HostTriple.str()];
if (!HIPTC) {
HIPTC = llvm::make_unique<toolchains::HIPToolChain>(
HIPTC = std::make_unique<toolchains::HIPToolChain>(
*this, HIPTriple, *HostTC, C.getInputArgs());
}
C.addOffloadDeviceToolChain(HIPTC.get(), OFK);
@ -699,7 +699,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
auto &CudaTC =
ToolChains[TT.str() + "/" + HostTC->getTriple().normalize()];
if (!CudaTC)
CudaTC = llvm::make_unique<toolchains::CudaToolChain>(
CudaTC = std::make_unique<toolchains::CudaToolChain>(
*this, TT, *HostTC, C.getInputArgs(), Action::OFK_OpenMP);
TC = CudaTC.get();
} else
@ -760,7 +760,7 @@ bool Driver::readConfigFile(StringRef FileName) {
llvm::sys::path::native(CfgFileName);
ConfigFile = CfgFileName.str();
bool ContainErrors;
CfgOptions = llvm::make_unique<InputArgList>(
CfgOptions = std::make_unique<InputArgList>(
ParseArgStrings(NewCfgArgs, IsCLMode(), ContainErrors));
if (ContainErrors) {
CfgOptions.reset();
@ -954,7 +954,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// Arguments specified in command line.
bool ContainsError;
CLOptions = llvm::make_unique<InputArgList>(
CLOptions = std::make_unique<InputArgList>(
ParseArgStrings(ArgList.slice(1), IsCLMode(), ContainsError));
// Try parsing configuration file.
@ -1000,7 +1000,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
if (!CLModePassThroughArgList.empty()) {
// Parse any pass through args using default clang processing rather
// than clang-cl processing.
auto CLModePassThroughOptions = llvm::make_unique<InputArgList>(
auto CLModePassThroughOptions = std::make_unique<InputArgList>(
ParseArgStrings(CLModePassThroughArgList, false, ContainsError));
if (!ContainsError)
@ -1093,7 +1093,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
}
std::unique_ptr<llvm::opt::InputArgList> UArgs =
llvm::make_unique<InputArgList>(std::move(Args));
std::make_unique<InputArgList>(std::move(Args));
// Perform the default argument translations.
DerivedArgList *TranslatedArgs = TranslateInputArgs(*UArgs);
@ -4605,152 +4605,152 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
if (!TC) {
switch (Target.getOS()) {
case llvm::Triple::Haiku:
TC = llvm::make_unique<toolchains::Haiku>(*this, Target, Args);
TC = std::make_unique<toolchains::Haiku>(*this, Target, Args);
break;
case llvm::Triple::Ananas:
TC = llvm::make_unique<toolchains::Ananas>(*this, Target, Args);
TC = std::make_unique<toolchains::Ananas>(*this, Target, Args);
break;
case llvm::Triple::CloudABI:
TC = llvm::make_unique<toolchains::CloudABI>(*this, Target, Args);
TC = std::make_unique<toolchains::CloudABI>(*this, Target, Args);
break;
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
case llvm::Triple::IOS:
case llvm::Triple::TvOS:
case llvm::Triple::WatchOS:
TC = llvm::make_unique<toolchains::DarwinClang>(*this, Target, Args);
TC = std::make_unique<toolchains::DarwinClang>(*this, Target, Args);
break;
case llvm::Triple::DragonFly:
TC = llvm::make_unique<toolchains::DragonFly>(*this, Target, Args);
TC = std::make_unique<toolchains::DragonFly>(*this, Target, Args);
break;
case llvm::Triple::OpenBSD:
TC = llvm::make_unique<toolchains::OpenBSD>(*this, Target, Args);
TC = std::make_unique<toolchains::OpenBSD>(*this, Target, Args);
break;
case llvm::Triple::NetBSD:
TC = llvm::make_unique<toolchains::NetBSD>(*this, Target, Args);
TC = std::make_unique<toolchains::NetBSD>(*this, Target, Args);
break;
case llvm::Triple::FreeBSD:
TC = llvm::make_unique<toolchains::FreeBSD>(*this, Target, Args);
TC = std::make_unique<toolchains::FreeBSD>(*this, Target, Args);
break;
case llvm::Triple::Minix:
TC = llvm::make_unique<toolchains::Minix>(*this, Target, Args);
TC = std::make_unique<toolchains::Minix>(*this, Target, Args);
break;
case llvm::Triple::Linux:
case llvm::Triple::ELFIAMCU:
if (Target.getArch() == llvm::Triple::hexagon)
TC = llvm::make_unique<toolchains::HexagonToolChain>(*this, Target,
TC = std::make_unique<toolchains::HexagonToolChain>(*this, Target,
Args);
else if ((Target.getVendor() == llvm::Triple::MipsTechnologies) &&
!Target.hasEnvironment())
TC = llvm::make_unique<toolchains::MipsLLVMToolChain>(*this, Target,
TC = std::make_unique<toolchains::MipsLLVMToolChain>(*this, Target,
Args);
else if (Target.getArch() == llvm::Triple::ppc ||
Target.getArch() == llvm::Triple::ppc64 ||
Target.getArch() == llvm::Triple::ppc64le)
TC = llvm::make_unique<toolchains::PPCLinuxToolChain>(*this, Target,
TC = std::make_unique<toolchains::PPCLinuxToolChain>(*this, Target,
Args);
else
TC = llvm::make_unique<toolchains::Linux>(*this, Target, Args);
TC = std::make_unique<toolchains::Linux>(*this, Target, Args);
break;
case llvm::Triple::NaCl:
TC = llvm::make_unique<toolchains::NaClToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::NaClToolChain>(*this, Target, Args);
break;
case llvm::Triple::Fuchsia:
TC = llvm::make_unique<toolchains::Fuchsia>(*this, Target, Args);
TC = std::make_unique<toolchains::Fuchsia>(*this, Target, Args);
break;
case llvm::Triple::Solaris:
TC = llvm::make_unique<toolchains::Solaris>(*this, Target, Args);
TC = std::make_unique<toolchains::Solaris>(*this, Target, Args);
break;
case llvm::Triple::AMDHSA:
case llvm::Triple::AMDPAL:
case llvm::Triple::Mesa3D:
TC = llvm::make_unique<toolchains::AMDGPUToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::AMDGPUToolChain>(*this, Target, Args);
break;
case llvm::Triple::Win32:
switch (Target.getEnvironment()) {
default:
if (Target.isOSBinFormatELF())
TC = llvm::make_unique<toolchains::Generic_ELF>(*this, Target, Args);
TC = std::make_unique<toolchains::Generic_ELF>(*this, Target, Args);
else if (Target.isOSBinFormatMachO())
TC = llvm::make_unique<toolchains::MachO>(*this, Target, Args);
TC = std::make_unique<toolchains::MachO>(*this, Target, Args);
else
TC = llvm::make_unique<toolchains::Generic_GCC>(*this, Target, Args);
TC = std::make_unique<toolchains::Generic_GCC>(*this, Target, Args);
break;
case llvm::Triple::GNU:
TC = llvm::make_unique<toolchains::MinGW>(*this, Target, Args);
TC = std::make_unique<toolchains::MinGW>(*this, Target, Args);
break;
case llvm::Triple::Itanium:
TC = llvm::make_unique<toolchains::CrossWindowsToolChain>(*this, Target,
TC = std::make_unique<toolchains::CrossWindowsToolChain>(*this, Target,
Args);
break;
case llvm::Triple::MSVC:
case llvm::Triple::UnknownEnvironment:
if (Args.getLastArgValue(options::OPT_fuse_ld_EQ)
.startswith_lower("bfd"))
TC = llvm::make_unique<toolchains::CrossWindowsToolChain>(
TC = std::make_unique<toolchains::CrossWindowsToolChain>(
*this, Target, Args);
else
TC =
llvm::make_unique<toolchains::MSVCToolChain>(*this, Target, Args);
std::make_unique<toolchains::MSVCToolChain>(*this, Target, Args);
break;
}
break;
case llvm::Triple::PS4:
TC = llvm::make_unique<toolchains::PS4CPU>(*this, Target, Args);
TC = std::make_unique<toolchains::PS4CPU>(*this, Target, Args);
break;
case llvm::Triple::Contiki:
TC = llvm::make_unique<toolchains::Contiki>(*this, Target, Args);
TC = std::make_unique<toolchains::Contiki>(*this, Target, Args);
break;
case llvm::Triple::Hurd:
TC = llvm::make_unique<toolchains::Hurd>(*this, Target, Args);
TC = std::make_unique<toolchains::Hurd>(*this, Target, Args);
break;
default:
// Of these targets, Hexagon is the only one that might have
// an OS of Linux, in which case it got handled above already.
switch (Target.getArch()) {
case llvm::Triple::tce:
TC = llvm::make_unique<toolchains::TCEToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::TCEToolChain>(*this, Target, Args);
break;
case llvm::Triple::tcele:
TC = llvm::make_unique<toolchains::TCELEToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::TCELEToolChain>(*this, Target, Args);
break;
case llvm::Triple::hexagon:
TC = llvm::make_unique<toolchains::HexagonToolChain>(*this, Target,
TC = std::make_unique<toolchains::HexagonToolChain>(*this, Target,
Args);
break;
case llvm::Triple::lanai:
TC = llvm::make_unique<toolchains::LanaiToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::LanaiToolChain>(*this, Target, Args);
break;
case llvm::Triple::xcore:
TC = llvm::make_unique<toolchains::XCoreToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::XCoreToolChain>(*this, Target, Args);
break;
case llvm::Triple::wasm32:
case llvm::Triple::wasm64:
TC = llvm::make_unique<toolchains::WebAssembly>(*this, Target, Args);
TC = std::make_unique<toolchains::WebAssembly>(*this, Target, Args);
break;
case llvm::Triple::avr:
TC = llvm::make_unique<toolchains::AVRToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::AVRToolChain>(*this, Target, Args);
break;
case llvm::Triple::msp430:
TC =
llvm::make_unique<toolchains::MSP430ToolChain>(*this, Target, Args);
std::make_unique<toolchains::MSP430ToolChain>(*this, Target, Args);
break;
case llvm::Triple::riscv32:
case llvm::Triple::riscv64:
TC = llvm::make_unique<toolchains::RISCVToolChain>(*this, Target, Args);
TC = std::make_unique<toolchains::RISCVToolChain>(*this, Target, Args);
break;
default:
if (Target.getVendor() == llvm::Triple::Myriad)
TC = llvm::make_unique<toolchains::MyriadToolChain>(*this, Target,
TC = std::make_unique<toolchains::MyriadToolChain>(*this, Target,
Args);
else if (toolchains::BareMetal::handlesTarget(Target))
TC = llvm::make_unique<toolchains::BareMetal>(*this, Target, Args);
TC = std::make_unique<toolchains::BareMetal>(*this, Target, Args);
else if (Target.isOSBinFormatELF())
TC = llvm::make_unique<toolchains::Generic_ELF>(*this, Target, Args);
TC = std::make_unique<toolchains::Generic_ELF>(*this, Target, Args);
else if (Target.isOSBinFormatMachO())
TC = llvm::make_unique<toolchains::MachO>(*this, Target, Args);
TC = std::make_unique<toolchains::MachO>(*this, Target, Args);
else
TC = llvm::make_unique<toolchains::Generic_GCC>(*this, Target, Args);
TC = std::make_unique<toolchains::Generic_GCC>(*this, Target, Args);
}
}
}

View file

@ -40,7 +40,7 @@ public:
}
std::unique_ptr<OptTable> clang::driver::createDriverOptTable() {
auto Result = llvm::make_unique<DriverOptTable>();
auto Result = std::make_unique<DriverOptTable>();
// Options.inc is included in DriverOptions.cpp, and calls OptTable's
// addValues function.
// Opt is a variable used in the code fragment in Options.inc.

View file

@ -31,7 +31,7 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-shared");
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
CmdArgs, Inputs));
}

View file

@ -144,7 +144,7 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(Args.MakeArgString(std::string("-m") + *FamilyName));
}
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
CmdArgs, Inputs));
}

View file

@ -39,7 +39,7 @@ void ananas::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void ananas::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -123,7 +123,7 @@ void ananas::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// Ananas - Ananas tool chain which can call as(1) and ld(1) directly.

View file

@ -191,7 +191,7 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
C.addCommand(llvm::make_unique<Command>(JA, *this,
C.addCommand(std::make_unique<Command>(JA, *this,
Args.MakeArgString(TC.GetLinkerPath()),
CmdArgs, Inputs));
}

View file

@ -2003,7 +2003,7 @@ void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename,
if (!CompilationDatabase) {
std::error_code EC;
auto File = llvm::make_unique<llvm::raw_fd_ostream>(Filename, EC,
auto File = std::make_unique<llvm::raw_fd_ostream>(Filename, EC,
llvm::sys::fs::OF_Text);
if (EC) {
D.Diag(clang::diag::err_drv_compilationdatabase) << Filename
@ -3804,7 +3804,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
II.getInputArg().renderAsInput(Args, CmdArgs);
}
C.addCommand(llvm::make_unique<Command>(JA, *this, D.getClangProgramPath(),
C.addCommand(std::make_unique<Command>(JA, *this, D.getClangProgramPath(),
CmdArgs, Inputs));
return;
}
@ -5524,16 +5524,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(InputType == types::TY_C || InputType == types::TY_CXX)) {
auto CLCommand =
getCLFallback()->GetCommand(C, JA, Output, Inputs, Args, LinkingOutput);
C.addCommand(llvm::make_unique<FallbackCommand>(
C.addCommand(std::make_unique<FallbackCommand>(
JA, *this, Exec, CmdArgs, Inputs, std::move(CLCommand)));
} else if (Args.hasArg(options::OPT__SLASH_fallback) &&
isa<PrecompileJobAction>(JA)) {
// In /fallback builds, run the main compilation even if the pch generation
// fails, so that the main compilation's fallback to cl.exe runs.
C.addCommand(llvm::make_unique<ForceSuccessCommand>(JA, *this, Exec,
C.addCommand(std::make_unique<ForceSuccessCommand>(JA, *this, Exec,
CmdArgs, Inputs));
} else {
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// Make the compile command echo its inputs for /showFilenames.
@ -6260,7 +6260,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(Input.getFilename());
const char *Exec = getToolChain().getDriver().getClangProgramPath();
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// Begin OffloadBundler
@ -6343,7 +6343,7 @@ void OffloadBundler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(TCArgs.MakeArgString(UB));
// All the inputs are encoded as commands.
C.addCommand(llvm::make_unique<Command>(
C.addCommand(std::make_unique<Command>(
JA, *this,
TCArgs.MakeArgString(getToolChain().GetProgramPath(getShortName())),
CmdArgs, None));
@ -6409,7 +6409,7 @@ void OffloadBundler::ConstructJobMultipleOutputs(
CmdArgs.push_back("-unbundle");
// All the inputs are encoded as commands.
C.addCommand(llvm::make_unique<Command>(
C.addCommand(std::make_unique<Command>(
JA, *this,
TCArgs.MakeArgString(getToolChain().GetProgramPath(getShortName())),
CmdArgs, None));

View file

@ -92,7 +92,7 @@ void cloudabi::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// CloudABI - CloudABI tool chain which can call ld(1) directly.

View file

@ -822,10 +822,10 @@ void tools::SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T,
InputInfo II(types::TY_Object, Output.getFilename(), Output.getFilename());
// First extract the dwo sections.
C.addCommand(llvm::make_unique<Command>(JA, T, Exec, ExtractArgs, II));
C.addCommand(std::make_unique<Command>(JA, T, Exec, ExtractArgs, II));
// Then remove them from the original .o file.
C.addCommand(llvm::make_unique<Command>(JA, T, Exec, StripArgs, II));
C.addCommand(std::make_unique<Command>(JA, T, Exec, StripArgs, II));
}
// Claim options we don't want to warn if they are unused. We do this for

View file

@ -57,7 +57,7 @@ void tools::CrossWindows::Assembler::ConstructJob(
const std::string Assembler = TC.GetProgramPath("as");
Exec = Args.MakeArgString(Assembler);
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void tools::CrossWindows::Linker::ConstructJob(
@ -202,7 +202,7 @@ void tools::CrossWindows::Linker::ConstructJob(
Exec = Args.MakeArgString(TC.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
CrossWindowsToolChain::CrossWindowsToolChain(const Driver &D,

View file

@ -422,7 +422,7 @@ void NVPTX::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
Exec = A->getValue();
else
Exec = Args.MakeArgString(TC.GetProgramPath("ptxas"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
static bool shouldIncludePTX(const ArgList &Args, const char *gpu_arch) {
@ -488,7 +488,7 @@ void NVPTX::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(Args.MakeArgString(A));
const char *Exec = Args.MakeArgString(TC.GetProgramPath("fatbinary"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void NVPTX::OpenMPLinker::ConstructJob(Compilation &C, const JobAction &JA,
@ -567,7 +567,7 @@ void NVPTX::OpenMPLinker::ConstructJob(Compilation &C, const JobAction &JA,
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("nvlink"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// CUDA toolchain. Our assembler is ptxas, and our "linker" is fatbinary,

View file

@ -146,7 +146,7 @@ void darwin::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
// asm_final spec is empty.
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void darwin::MachOTool::anchor() {}
@ -451,7 +451,7 @@ void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("touch"));
CmdArgs.push_back(Output.getFilename());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, None));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, None));
return;
}
@ -653,7 +653,7 @@ void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
std::unique_ptr<Command> Cmd =
llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs);
std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs);
Cmd->setInputFileList(std::move(InputFileList));
C.addCommand(std::move(Cmd));
}
@ -677,7 +677,7 @@ void darwin::Lipo::ConstructJob(Compilation &C, const JobAction &JA,
}
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("lipo"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void darwin::Dsymutil::ConstructJob(Compilation &C, const JobAction &JA,
@ -697,7 +697,7 @@ void darwin::Dsymutil::ConstructJob(Compilation &C, const JobAction &JA,
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("dsymutil"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void darwin::VerifyDebug::ConstructJob(Compilation &C, const JobAction &JA,
@ -720,7 +720,7 @@ void darwin::VerifyDebug::ConstructJob(Compilation &C, const JobAction &JA,
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("dwarfdump"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
MachO::MachO(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)

View file

@ -45,7 +45,7 @@ void dragonfly::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -169,7 +169,7 @@ void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA,
getToolChain().addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.

View file

@ -112,7 +112,7 @@ void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -339,7 +339,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
ToolChain.addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// FreeBSD - FreeBSD tool chain which can call as(1) and ld(1) directly.

View file

@ -156,7 +156,7 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-lc");
}
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// Fuchsia - Fuchsia tool chain which can call as(1) and ld(1) directly.

View file

@ -189,7 +189,7 @@ void tools::gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
GCCName = "gcc";
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void tools::gcc::Preprocessor::RenderExtraToolArgs(
@ -627,7 +627,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
*this);
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void tools::gnutools::Assembler::ConstructJob(Compilation &C,
@ -878,7 +878,7 @@ void tools::gnutools::Assembler::ConstructJob(Compilation &C,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
// Handle the debug info splitting at object creation time if we're
// creating an object.

View file

@ -69,7 +69,7 @@ const char *AMDGCN::Linker::constructLLVMLinkCommand(
SmallString<128> ExecPath(C.getDriver().Dir);
llvm::sys::path::append(ExecPath, "llvm-link");
const char *Exec = Args.MakeArgString(ExecPath);
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
return OutputFileName;
}
@ -117,7 +117,7 @@ const char *AMDGCN::Linker::constructOptCommand(
SmallString<128> OptPath(C.getDriver().Dir);
llvm::sys::path::append(OptPath, "opt");
const char *OptExec = Args.MakeArgString(OptPath);
C.addCommand(llvm::make_unique<Command>(JA, *this, OptExec, OptArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, OptExec, OptArgs, Inputs));
return OutputFileName;
}
@ -159,7 +159,7 @@ const char *AMDGCN::Linker::constructLlcCommand(
SmallString<128> LlcPath(C.getDriver().Dir);
llvm::sys::path::append(LlcPath, "llc");
const char *Llc = Args.MakeArgString(LlcPath);
C.addCommand(llvm::make_unique<Command>(JA, *this, Llc, LlcArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Llc, LlcArgs, Inputs));
return LlcOutputFile;
}
@ -175,7 +175,7 @@ void AMDGCN::Linker::constructLldCommand(Compilation &C, const JobAction &JA,
SmallString<128> LldPath(C.getDriver().Dir);
llvm::sys::path::append(LldPath, "lld");
const char *Lld = Args.MakeArgString(LldPath);
C.addCommand(llvm::make_unique<Command>(JA, *this, Lld, LldArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Lld, LldArgs, Inputs));
}
// Construct a clang-offload-bundler command to bundle code objects for
@ -209,7 +209,7 @@ void AMDGCN::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
SmallString<128> BundlerPath(C.getDriver().Dir);
llvm::sys::path::append(BundlerPath, "clang-offload-bundler");
const char *Bundler = Args.MakeArgString(BundlerPath);
C.addCommand(llvm::make_unique<Command>(JA, T, Bundler, BundlerArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, T, Bundler, BundlerArgs, Inputs));
}
// For amdgcn the inputs of the linker job are device bitcode and output is

View file

@ -183,7 +183,7 @@ void hexagon::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
}
auto *Exec = Args.MakeArgString(HTC.GetProgramPath(AsName));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void hexagon::Linker::RenderExtraToolArgs(const JobAction &JA,
@ -370,7 +370,7 @@ void hexagon::Linker::ConstructJob(Compilation &C, const JobAction &JA,
LinkingOutput);
const char *Exec = Args.MakeArgString(HTC.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// Hexagon tools end.

View file

@ -227,6 +227,6 @@ void msp430::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
CmdArgs, Inputs));
}

View file

@ -565,7 +565,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
linkPath = TC.GetProgramPath(Linker.str().c_str());
}
auto LinkCmd = llvm::make_unique<Command>(
auto LinkCmd = std::make_unique<Command>(
JA, *this, Args.MakeArgString(linkPath), CmdArgs, Inputs);
if (!Environment.empty())
LinkCmd->setEnvironment(Environment);
@ -695,7 +695,7 @@ std::unique_ptr<Command> visualstudio::Compiler::GetCommand(
CmdArgs.push_back(Fo);
std::string Exec = FindVisualStudioExecutable(getToolChain(), "cl.exe");
return llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
return std::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
CmdArgs, Inputs);
}

View file

@ -49,7 +49,7 @@ void tools::MinGW::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
if (Args.hasArg(options::OPT_gsplit_dwarf))
SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
@ -294,7 +294,7 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
}
const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple.

View file

@ -36,7 +36,7 @@ void tools::minix::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void tools::minix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -88,7 +88,7 @@ void tools::minix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// Minix - Minix tool chain which can call as(1) and ld(1) directly.

View file

@ -77,7 +77,7 @@ void tools::SHAVE::Compiler::ConstructJob(Compilation &C, const JobAction &JA,
std::string Exec =
Args.MakeArgString(getToolChain().GetProgramPath("moviCompile"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
CmdArgs, Inputs));
}
@ -112,7 +112,7 @@ void tools::SHAVE::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
std::string Exec =
Args.MakeArgString(getToolChain().GetProgramPath("moviAsm"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
CmdArgs, Inputs));
}
@ -198,7 +198,7 @@ void tools::Myriad::Linker::ConstructJob(Compilation &C, const JobAction &JA,
std::string Exec =
Args.MakeArgString(TC.GetProgramPath("sparc-myriad-rtems-ld"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
CmdArgs, Inputs));
}

View file

@ -193,7 +193,7 @@ void nacltools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// NaCl Toolchain

View file

@ -103,7 +103,7 @@ void netbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString((getToolChain().GetProgramPath("as")));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -333,7 +333,7 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
ToolChain.addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly.

View file

@ -89,7 +89,7 @@ void openbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -227,7 +227,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
SanitizerMask OpenBSD::getSupportedSanitizers() const {

View file

@ -62,7 +62,7 @@ void tools::PS4cpu::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("orbis-as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
static void AddPS4SanitizerArgs(const ToolChain &TC, ArgStringList &CmdArgs) {
@ -141,7 +141,7 @@ static void ConstructPS4LinkJob(const Tool &T, Compilation &C,
const char *Exec = Args.MakeArgString(ToolChain.GetProgramPath("orbis-ld"));
C.addCommand(llvm::make_unique<Command>(JA, T, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, T, Exec, CmdArgs, Inputs));
}
static void ConstructGoldLinkJob(const Tool &T, Compilation &C,
@ -319,7 +319,7 @@ static void ConstructGoldLinkJob(const Tool &T, Compilation &C,
Args.MakeArgString(ToolChain.GetProgramPath("orbis-ld"));
#endif
C.addCommand(llvm::make_unique<Command>(JA, T, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, T, Exec, CmdArgs, Inputs));
}
void tools::PS4cpu::Link::ConstructJob(Compilation &C, const JobAction &JA,

View file

@ -134,7 +134,7 @@ void RISCV::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
C.addCommand(std::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
CmdArgs, Inputs));
}
// RISCV tools end.

View file

@ -41,7 +41,7 @@ void solaris::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -150,7 +150,7 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
getToolChain().addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
static StringRef getSolarisLibSuffix(const llvm::Triple &Triple) {

View file

@ -89,7 +89,7 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
C.addCommand(llvm::make_unique<Command>(JA, *this, Linker, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Linker, CmdArgs, Inputs));
}
WebAssembly::WebAssembly(const Driver &D, const llvm::Triple &Triple,

View file

@ -52,7 +52,7 @@ void tools::XCore::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("xcc"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void tools::XCore::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@ -80,7 +80,7 @@ void tools::XCore::Linker::ConstructJob(Compilation &C, const JobAction &JA,
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("xcc"));
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// XCore tool chain

View file

@ -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);
}

View file

@ -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);

View file

@ -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;
}

View file

@ -139,7 +139,7 @@ namespace {
std::unique_ptr<ASTConsumer>
clang::CreateASTPrinter(std::unique_ptr<raw_ostream> Out,
StringRef FilterString) {
return llvm::make_unique<ASTPrinter>(std::move(Out), ASTPrinter::Print,
return std::make_unique<ASTPrinter>(std::move(Out), ASTPrinter::Print,
ADOF_Default, FilterString);
}
@ -148,7 +148,7 @@ clang::CreateASTDumper(std::unique_ptr<raw_ostream> Out, StringRef FilterString,
bool DumpDecls, bool Deserialize, bool DumpLookups,
ASTDumpOutputFormat Format) {
assert((DumpDecls || Deserialize || DumpLookups) && "nothing to dump");
return llvm::make_unique<ASTPrinter>(std::move(Out),
return std::make_unique<ASTPrinter>(std::move(Out),
Deserialize ? ASTPrinter::DumpFull :
DumpDecls ? ASTPrinter::Dump :
ASTPrinter::None, Format,
@ -156,7 +156,7 @@ clang::CreateASTDumper(std::unique_ptr<raw_ostream> Out, StringRef FilterString,
}
std::unique_ptr<ASTConsumer> clang::CreateASTDeclNodeLister() {
return llvm::make_unique<ASTDeclNodeLister>(nullptr);
return std::make_unique<ASTDeclNodeLister>(nullptr);
}
//===----------------------------------------------------------------------===//
@ -193,5 +193,5 @@ void ASTViewer::HandleTopLevelSingleDecl(Decl *D) {
}
std::unique_ptr<ASTConsumer> clang::CreateASTViewer() {
return llvm::make_unique<ASTViewer>();
return std::make_unique<ASTViewer>();
}

View file

@ -819,7 +819,7 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
/*isysroot=*/"",
/*DisableValidation=*/disableValid, AllowPCHWithCompilerErrors);
AST->Reader->setListener(llvm::make_unique<ASTInfoCollector>(
AST->Reader->setListener(std::make_unique<ASTInfoCollector>(
*AST->PP, AST->Ctx.get(), *AST->HSOpts, *AST->PPOpts, *AST->LangOpts,
AST->TargetOpts, AST->Target, Counter));
@ -999,9 +999,9 @@ public:
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override {
CI.getPreprocessor().addPPCallbacks(
llvm::make_unique<MacroDefinitionTrackerPPCallbacks>(
std::make_unique<MacroDefinitionTrackerPPCallbacks>(
Unit.getCurrentTopLevelHashValue()));
return llvm::make_unique<TopLevelDeclTrackerConsumer>(
return std::make_unique<TopLevelDeclTrackerConsumer>(
Unit, Unit.getCurrentTopLevelHashValue());
}
@ -1049,7 +1049,7 @@ public:
}
std::unique_ptr<PPCallbacks> createPPCallbacks() override {
return llvm::make_unique<MacroDefinitionTrackerPPCallbacks>(Hash);
return std::make_unique<MacroDefinitionTrackerPPCallbacks>(Hash);
}
private:
@ -1624,15 +1624,15 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(
if (Persistent && !TrackerAct) {
Clang->getPreprocessor().addPPCallbacks(
llvm::make_unique<MacroDefinitionTrackerPPCallbacks>(
std::make_unique<MacroDefinitionTrackerPPCallbacks>(
AST->getCurrentTopLevelHashValue()));
std::vector<std::unique_ptr<ASTConsumer>> Consumers;
if (Clang->hasASTConsumer())
Consumers.push_back(Clang->takeASTConsumer());
Consumers.push_back(llvm::make_unique<TopLevelDeclTrackerConsumer>(
Consumers.push_back(std::make_unique<TopLevelDeclTrackerConsumer>(
*AST, AST->getCurrentTopLevelHashValue()));
Clang->setASTConsumer(
llvm::make_unique<MultiplexConsumer>(std::move(Consumers)));
std::make_unique<MultiplexConsumer>(std::move(Consumers)));
}
if (llvm::Error Err = Act->Execute()) {
consumeError(std::move(Err)); // FIXME this drops errors on the floor.

View file

@ -158,7 +158,7 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource(
auto Buffer = std::make_shared<PCHBuffer>();
ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions;
auto consumer = llvm::make_unique<PCHGenerator>(
auto consumer = std::make_unique<PCHGenerator>(
Clang->getPreprocessor(), Clang->getModuleCache(), "-", /*isysroot=*/"",
Buffer, Extensions, /*AllowASTWithErrors=*/true);
Clang->getASTContext().setASTMutationListener(

View file

@ -215,7 +215,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts,
raw_ostream *OS = &llvm::errs();
if (DiagOpts->DiagnosticLogFile != "-") {
// Create the output stream.
auto FileOS = llvm::make_unique<llvm::raw_fd_ostream>(
auto FileOS = std::make_unique<llvm::raw_fd_ostream>(
DiagOpts->DiagnosticLogFile, EC,
llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text);
if (EC) {
@ -229,7 +229,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts,
}
// Chain in the diagnostic client which will log the diagnostics.
auto Logger = llvm::make_unique<LogDiagnosticPrinter>(*OS, DiagOpts,
auto Logger = std::make_unique<LogDiagnosticPrinter>(*OS, DiagOpts,
std::move(StreamOwner));
if (CodeGenOpts)
Logger->setDwarfDebugFlags(CodeGenOpts->DwarfDebugFlags);
@ -667,7 +667,7 @@ CompilerInstance::createDefaultOutputFile(bool Binary, StringRef InFile,
}
std::unique_ptr<raw_pwrite_stream> CompilerInstance::createNullOutputFile() {
return llvm::make_unique<llvm::raw_null_ostream>();
return std::make_unique<llvm::raw_null_ostream>();
}
std::unique_ptr<raw_pwrite_stream>
@ -793,7 +793,7 @@ std::unique_ptr<llvm::raw_pwrite_stream> CompilerInstance::createOutputFile(
if (!Binary || OS->supportsSeeking())
return std::move(OS);
auto B = llvm::make_unique<llvm::buffer_ostream>(*OS);
auto B = std::make_unique<llvm::buffer_ostream>(*OS);
assert(!NonSeekStream);
NonSeekStream = std::move(OS);
return std::move(B);
@ -988,7 +988,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
StringRef StatsFile = getFrontendOpts().StatsFile;
if (!StatsFile.empty()) {
std::error_code EC;
auto StatS = llvm::make_unique<llvm::raw_fd_ostream>(
auto StatS = std::make_unique<llvm::raw_fd_ostream>(
StatsFile, EC, llvm::sys::fs::OF_Text);
if (EC) {
getDiagnostics().Report(diag::warn_fe_unable_to_open_stats_file)
@ -1471,7 +1471,7 @@ void CompilerInstance::createModuleManager() {
const PreprocessorOptions &PPOpts = getPreprocessorOpts();
std::unique_ptr<llvm::Timer> ReadTimer;
if (FrontendTimerGroup)
ReadTimer = llvm::make_unique<llvm::Timer>("reading_modules",
ReadTimer = std::make_unique<llvm::Timer>("reading_modules",
"Reading modules",
*FrontendTimerGroup);
ModuleManager = new ASTReader(
@ -1566,7 +1566,7 @@ bool CompilerInstance::loadModuleFile(StringRef FileName) {
SourceLocation())
<= DiagnosticsEngine::Warning;
auto Listener = llvm::make_unique<ReadModuleNames>(*this);
auto Listener = std::make_unique<ReadModuleNames>(*this);
auto &ListenerRef = *Listener;
ASTReader::ListenerScope ReadModuleNamesListener(*ModuleManager,
std::move(Listener));

View file

@ -94,7 +94,7 @@ std::unique_ptr<CompilerInvocation> clang::createInvocationFromCommandLine(
}
const ArgStringList &CCArgs = Cmd.getArguments();
auto CI = llvm::make_unique<CompilerInvocation>();
auto CI = std::make_unique<CompilerInvocation>();
if (!CompilerInvocation::CreateFromArgs(*CI,
const_cast<const char **>(CCArgs.data()),
const_cast<const char **>(CCArgs.data()) +

View file

@ -168,13 +168,13 @@ bool DependencyCollector::sawDependency(StringRef Filename, bool FromModule,
DependencyCollector::~DependencyCollector() { }
void DependencyCollector::attachToPreprocessor(Preprocessor &PP) {
PP.addPPCallbacks(llvm::make_unique<DepCollectorPPCallbacks>(
PP.addPPCallbacks(std::make_unique<DepCollectorPPCallbacks>(
*this, PP.getSourceManager(), PP.getDiagnostics()));
PP.getHeaderSearchInfo().getModuleMap().addModuleMapCallbacks(
llvm::make_unique<DepCollectorMMCallbacks>(*this));
std::make_unique<DepCollectorMMCallbacks>(*this));
}
void DependencyCollector::attachToASTReader(ASTReader &R) {
R.addListener(llvm::make_unique<DepCollectorASTListener>(*this));
R.addListener(std::make_unique<DepCollectorASTListener>(*this));
}
DependencyFileGenerator::DependencyFileGenerator(

View file

@ -61,7 +61,7 @@ public:
void clang::AttachDependencyGraphGen(Preprocessor &PP, StringRef OutputFile,
StringRef SysRoot) {
PP.addPPCallbacks(llvm::make_unique<DependencyGraphCallback>(&PP, OutputFile,
PP.addPPCallbacks(std::make_unique<DependencyGraphCallback>(&PP, OutputFile,
SysRoot));
}

View file

@ -216,7 +216,7 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
Consumers.push_back(std::move(C));
}
return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
return std::make_unique<MultiplexConsumer>(std::move(Consumers));
}
/// For preprocessed files, if the first line is the linemarker and specifies

View file

@ -55,7 +55,7 @@ void EnsureSemaIsCreated(CompilerInstance &CI, FrontendAction &Action) {
std::unique_ptr<ASTConsumer>
InitOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
return llvm::make_unique<ASTConsumer>();
return std::make_unique<ASTConsumer>();
}
void InitOnlyAction::ExecuteAction() {
@ -109,7 +109,7 @@ GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
const auto &FrontendOpts = CI.getFrontendOpts();
auto Buffer = std::make_shared<PCHBuffer>();
std::vector<std::unique_ptr<ASTConsumer>> Consumers;
Consumers.push_back(llvm::make_unique<PCHGenerator>(
Consumers.push_back(std::make_unique<PCHGenerator>(
CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
FrontendOpts.ModuleFileExtensions,
CI.getPreprocessorOpts().AllowPCHWithCompilerErrors,
@ -117,7 +117,7 @@ GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
CI, InFile, OutputFile, std::move(OS), Buffer));
return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
return std::make_unique<MultiplexConsumer>(std::move(Consumers));
}
bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
@ -172,7 +172,7 @@ GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
auto Buffer = std::make_shared<PCHBuffer>();
std::vector<std::unique_ptr<ASTConsumer>> Consumers;
Consumers.push_back(llvm::make_unique<PCHGenerator>(
Consumers.push_back(std::make_unique<PCHGenerator>(
CI.getPreprocessor(), CI.getModuleCache(), OutputFile, Sysroot, Buffer,
CI.getFrontendOpts().ModuleFileExtensions,
/*AllowASTWithErrors=*/false,
@ -182,7 +182,7 @@ GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
+CI.getFrontendOpts().BuildingImplicitModule));
Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
CI, InFile, OutputFile, std::move(OS), Buffer));
return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
return std::make_unique<MultiplexConsumer>(std::move(Consumers));
}
bool GenerateModuleFromModuleMapAction::BeginSourceFileAction(
@ -313,18 +313,18 @@ SyntaxOnlyAction::~SyntaxOnlyAction() {
std::unique_ptr<ASTConsumer>
SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
return llvm::make_unique<ASTConsumer>();
return std::make_unique<ASTConsumer>();
}
std::unique_ptr<ASTConsumer>
DumpModuleInfoAction::CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) {
return llvm::make_unique<ASTConsumer>();
return std::make_unique<ASTConsumer>();
}
std::unique_ptr<ASTConsumer>
VerifyPCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
return llvm::make_unique<ASTConsumer>();
return std::make_unique<ASTConsumer>();
}
void VerifyPCHAction::ExecuteAction() {
@ -466,7 +466,7 @@ private:
std::unique_ptr<ASTConsumer>
TemplightDumpAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
return llvm::make_unique<ASTConsumer>();
return std::make_unique<ASTConsumer>();
}
void TemplightDumpAction::ExecuteAction() {
@ -479,7 +479,7 @@ void TemplightDumpAction::ExecuteAction() {
EnsureSemaIsCreated(CI, *this);
CI.getSema().TemplateInstCallbacks.push_back(
llvm::make_unique<DefaultTemplateInstCallback>());
std::make_unique<DefaultTemplateInstCallback>());
ASTFrontendAction::ExecuteAction();
}

View file

@ -120,7 +120,7 @@ void clang::AttachHeaderIncludeGen(Preprocessor &PP,
// the GNU way to generate rules is -M / -MM / -MD / -MMD.
for (const auto &Header : DepOpts.ExtraDeps)
PrintHeaderInfo(OutputFile, Header, ShowDepth, 2, MSStyle);
PP.addPPCallbacks(llvm::make_unique<HeaderIncludesCallback>(
PP.addPPCallbacks(std::make_unique<HeaderIncludesCallback>(
&PP, ShowAllHeaders, OutputFile, DepOpts, OwnsOutputFile, ShowDepth,
MSStyle));
}

View file

@ -366,13 +366,13 @@ public:
std::unique_ptr<ASTConsumer>
GenerateInterfaceYAMLExpV1Action::CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) {
return llvm::make_unique<InterfaceStubFunctionsConsumer>(
return std::make_unique<InterfaceStubFunctionsConsumer>(
CI, InFile, "experimental-yaml-elf-v1");
}
std::unique_ptr<ASTConsumer>
GenerateInterfaceTBEExpV1Action::CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) {
return llvm::make_unique<InterfaceStubFunctionsConsumer>(
return std::make_unique<InterfaceStubFunctionsConsumer>(
CI, InFile, "experimental-tapi-elf-v1");
}

View file

@ -99,14 +99,14 @@ struct ModuleDependencyMMCallbacks : public ModuleMapCallbacks {
}
void ModuleDependencyCollector::attachToASTReader(ASTReader &R) {
R.addListener(llvm::make_unique<ModuleDependencyListener>(*this));
R.addListener(std::make_unique<ModuleDependencyListener>(*this));
}
void ModuleDependencyCollector::attachToPreprocessor(Preprocessor &PP) {
PP.addPPCallbacks(llvm::make_unique<ModuleDependencyPPCallbacks>(
PP.addPPCallbacks(std::make_unique<ModuleDependencyPPCallbacks>(
*this, PP.getSourceManager()));
PP.getHeaderSearchInfo().getModuleMap().addModuleMapCallbacks(
llvm::make_unique<ModuleDependencyMMCallbacks>(*this));
std::make_unique<ModuleDependencyMMCallbacks>(*this));
}
static bool isCaseSensitivePath(StringRef Path) {

View file

@ -249,11 +249,11 @@ MultiplexConsumer::MultiplexConsumer(
}
if (!mutationListeners.empty()) {
MutationListener =
llvm::make_unique<MultiplexASTMutationListener>(mutationListeners);
std::make_unique<MultiplexASTMutationListener>(mutationListeners);
}
if (!serializationListeners.empty()) {
DeserializationListener =
llvm::make_unique<MultiplexASTDeserializationListener>(
std::make_unique<MultiplexASTDeserializationListener>(
serializationListeners);
}
}

View file

@ -202,7 +202,7 @@ PrecompilePreambleAction::CreateASTConsumer(CompilerInstance &CI,
std::unique_ptr<llvm::raw_ostream> OS;
if (InMemStorage) {
OS = llvm::make_unique<llvm::raw_string_ostream>(*InMemStorage);
OS = std::make_unique<llvm::raw_string_ostream>(*InMemStorage);
} else {
std::string OutputFile;
OS = GeneratePCHAction::CreateOutputFile(CI, InFile, OutputFile);
@ -213,7 +213,7 @@ PrecompilePreambleAction::CreateASTConsumer(CompilerInstance &CI,
if (!CI.getFrontendOpts().RelocatablePCH)
Sysroot.clear();
return llvm::make_unique<PrecompilePreambleConsumer>(
return std::make_unique<PrecompilePreambleConsumer>(
*this, CI.getPreprocessor(), CI.getModuleCache(), Sysroot, std::move(OS));
}

View file

@ -675,7 +675,7 @@ struct UnknownPragmaHandler : public PragmaHandler {
if (ShouldExpandTokens) {
// The first token does not have expanded macros. Expand them, if
// required.
auto Toks = llvm::make_unique<Token[]>(1);
auto Toks = std::make_unique<Token[]>(1);
Toks[0] = PragmaTok;
PP.EnterTokenStream(std::move(Toks), /*NumToks=*/1,
/*DisableMacroExpansion=*/false,

View file

@ -50,7 +50,7 @@ FixItAction::~FixItAction() {}
std::unique_ptr<ASTConsumer>
FixItAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
return llvm::make_unique<ASTConsumer>();
return std::make_unique<ASTConsumer>();
}
namespace {
@ -295,7 +295,7 @@ bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) {
if (CI.getPreprocessorOutputOpts().RewriteImports) {
CI.createModuleManager();
CI.getModuleManager()->addListener(
llvm::make_unique<RewriteImportsListener>(CI, OutputStream));
std::make_unique<RewriteImportsListener>(CI, OutputStream));
}
return true;

View file

@ -48,7 +48,7 @@ namespace {
std::unique_ptr<ASTConsumer>
clang::CreateHTMLPrinter(std::unique_ptr<raw_ostream> OS, Preprocessor &PP,
bool SyntaxHighlight, bool HighlightMacros) {
return llvm::make_unique<HTMLPrinter>(std::move(OS), PP, SyntaxHighlight,
return std::make_unique<HTMLPrinter>(std::move(OS), PP, SyntaxHighlight,
HighlightMacros);
}

View file

@ -663,7 +663,7 @@ std::unique_ptr<ASTConsumer> clang::CreateModernObjCRewriter(
const std::string &InFile, std::unique_ptr<raw_ostream> OS,
DiagnosticsEngine &Diags, const LangOptions &LOpts,
bool SilenceRewriteMacroWarning, bool LineInfo) {
return llvm::make_unique<RewriteModernObjC>(InFile, std::move(OS), Diags,
return std::make_unique<RewriteModernObjC>(InFile, std::move(OS), Diags,
LOpts, SilenceRewriteMacroWarning,
LineInfo);
}

View file

@ -593,7 +593,7 @@ clang::CreateObjCRewriter(const std::string &InFile,
std::unique_ptr<raw_ostream> OS,
DiagnosticsEngine &Diags, const LangOptions &LOpts,
bool SilenceRewriteMacroWarning) {
return llvm::make_unique<RewriteObjCFragileABI>(
return std::make_unique<RewriteObjCFragileABI>(
InFile, std::move(OS), Diags, LOpts, SilenceRewriteMacroWarning);
}

View file

@ -296,7 +296,7 @@ namespace clang {
namespace serialized_diags {
std::unique_ptr<DiagnosticConsumer>
create(StringRef OutputFile, DiagnosticOptions *Diags, bool MergeChildRecords) {
return llvm::make_unique<SDiagsWriter>(OutputFile, Diags, MergeChildRecords);
return std::make_unique<SDiagsWriter>(OutputFile, Diags, MergeChildRecords);
}
} // end namespace serialized_diags
@ -743,7 +743,7 @@ DiagnosticsEngine *SDiagsWriter::getMetaDiags() {
IntrusiveRefCntPtr<DiagnosticIDs> IDs(new DiagnosticIDs());
auto Client =
new TextDiagnosticPrinter(llvm::errs(), State->DiagOpts.get());
State->MetaDiagnostics = llvm::make_unique<DiagnosticsEngine>(
State->MetaDiagnostics = std::make_unique<DiagnosticsEngine>(
IDs, State->DiagOpts.get(), Client);
}
return State->MetaDiagnostics.get();
@ -780,7 +780,7 @@ void SDiagsWriter::finish() {
}
std::error_code EC;
auto OS = llvm::make_unique<llvm::raw_fd_ostream>(State->OutputFile.c_str(),
auto OS = std::make_unique<llvm::raw_fd_ostream>(State->OutputFile.c_str(),
EC, llvm::sys::fs::OF_None);
if (EC) {
getMetaDiags()->Report(diag::warn_fe_serialized_diag_failure)

View file

@ -671,7 +671,7 @@ void VerifyDiagnosticConsumer::BeginSourceFile(const LangOptions &LangOpts,
#ifndef NDEBUG
// Debug build tracks parsed files.
const_cast<Preprocessor *>(PP)->addPPCallbacks(
llvm::make_unique<VerifyFileTracker>(*this, *SrcManager));
std::make_unique<VerifyFileTracker>(*this, *SrcManager));
#endif
}
}
@ -1116,7 +1116,7 @@ std::unique_ptr<Directive> Directive::create(bool RegexKind,
bool MatchAnyLine, StringRef Text,
unsigned Min, unsigned Max) {
if (!RegexKind)
return llvm::make_unique<StandardDirective>(DirectiveLoc, DiagnosticLoc,
return std::make_unique<StandardDirective>(DirectiveLoc, DiagnosticLoc,
MatchAnyLine, Text, Min, Max);
// Parse the directive into a regular expression.
@ -1142,6 +1142,6 @@ std::unique_ptr<Directive> Directive::create(bool RegexKind,
}
}
return llvm::make_unique<RegexDirective>(
return std::make_unique<RegexDirective>(
DirectiveLoc, DiagnosticLoc, MatchAnyLine, Text, Min, Max, RegexStr);
}

View file

@ -41,38 +41,38 @@ CreateFrontendBaseAction(CompilerInstance &CI) {
(void)Action;
switch (CI.getFrontendOpts().ProgramAction) {
case ASTDeclList: return llvm::make_unique<ASTDeclListAction>();
case ASTDump: return llvm::make_unique<ASTDumpAction>();
case ASTPrint: return llvm::make_unique<ASTPrintAction>();
case ASTView: return llvm::make_unique<ASTViewAction>();
case ASTDeclList: return std::make_unique<ASTDeclListAction>();
case ASTDump: return std::make_unique<ASTDumpAction>();
case ASTPrint: return std::make_unique<ASTPrintAction>();
case ASTView: return std::make_unique<ASTViewAction>();
case DumpCompilerOptions:
return llvm::make_unique<DumpCompilerOptionsAction>();
case DumpRawTokens: return llvm::make_unique<DumpRawTokensAction>();
case DumpTokens: return llvm::make_unique<DumpTokensAction>();
case EmitAssembly: return llvm::make_unique<EmitAssemblyAction>();
case EmitBC: return llvm::make_unique<EmitBCAction>();
case EmitHTML: return llvm::make_unique<HTMLPrintAction>();
case EmitLLVM: return llvm::make_unique<EmitLLVMAction>();
case EmitLLVMOnly: return llvm::make_unique<EmitLLVMOnlyAction>();
case EmitCodeGenOnly: return llvm::make_unique<EmitCodeGenOnlyAction>();
case EmitObj: return llvm::make_unique<EmitObjAction>();
case FixIt: return llvm::make_unique<FixItAction>();
return std::make_unique<DumpCompilerOptionsAction>();
case DumpRawTokens: return std::make_unique<DumpRawTokensAction>();
case DumpTokens: return std::make_unique<DumpTokensAction>();
case EmitAssembly: return std::make_unique<EmitAssemblyAction>();
case EmitBC: return std::make_unique<EmitBCAction>();
case EmitHTML: return std::make_unique<HTMLPrintAction>();
case EmitLLVM: return std::make_unique<EmitLLVMAction>();
case EmitLLVMOnly: return std::make_unique<EmitLLVMOnlyAction>();
case EmitCodeGenOnly: return std::make_unique<EmitCodeGenOnlyAction>();
case EmitObj: return std::make_unique<EmitObjAction>();
case FixIt: return std::make_unique<FixItAction>();
case GenerateModule:
return llvm::make_unique<GenerateModuleFromModuleMapAction>();
return std::make_unique<GenerateModuleFromModuleMapAction>();
case GenerateModuleInterface:
return llvm::make_unique<GenerateModuleInterfaceAction>();
return std::make_unique<GenerateModuleInterfaceAction>();
case GenerateHeaderModule:
return llvm::make_unique<GenerateHeaderModuleAction>();
case GeneratePCH: return llvm::make_unique<GeneratePCHAction>();
return std::make_unique<GenerateHeaderModuleAction>();
case GeneratePCH: return std::make_unique<GeneratePCHAction>();
case GenerateInterfaceYAMLExpV1:
return llvm::make_unique<GenerateInterfaceYAMLExpV1Action>();
return std::make_unique<GenerateInterfaceYAMLExpV1Action>();
case GenerateInterfaceTBEExpV1:
return llvm::make_unique<GenerateInterfaceTBEExpV1Action>();
case InitOnly: return llvm::make_unique<InitOnlyAction>();
case ParseSyntaxOnly: return llvm::make_unique<SyntaxOnlyAction>();
case ModuleFileInfo: return llvm::make_unique<DumpModuleInfoAction>();
case VerifyPCH: return llvm::make_unique<VerifyPCHAction>();
case TemplightDump: return llvm::make_unique<TemplightDumpAction>();
return std::make_unique<GenerateInterfaceTBEExpV1Action>();
case InitOnly: return std::make_unique<InitOnlyAction>();
case ParseSyntaxOnly: return std::make_unique<SyntaxOnlyAction>();
case ModuleFileInfo: return std::make_unique<DumpModuleInfoAction>();
case VerifyPCH: return std::make_unique<VerifyPCHAction>();
case TemplightDump: return std::make_unique<TemplightDumpAction>();
case PluginAction: {
for (FrontendPluginRegistry::iterator it =
@ -93,35 +93,35 @@ CreateFrontendBaseAction(CompilerInstance &CI) {
return nullptr;
}
case PrintPreamble: return llvm::make_unique<PrintPreambleAction>();
case PrintPreamble: return std::make_unique<PrintPreambleAction>();
case PrintPreprocessedInput: {
if (CI.getPreprocessorOutputOpts().RewriteIncludes ||
CI.getPreprocessorOutputOpts().RewriteImports)
return llvm::make_unique<RewriteIncludesAction>();
return llvm::make_unique<PrintPreprocessedAction>();
return std::make_unique<RewriteIncludesAction>();
return std::make_unique<PrintPreprocessedAction>();
}
case RewriteMacros: return llvm::make_unique<RewriteMacrosAction>();
case RewriteTest: return llvm::make_unique<RewriteTestAction>();
case RewriteMacros: return std::make_unique<RewriteMacrosAction>();
case RewriteTest: return std::make_unique<RewriteTestAction>();
#if CLANG_ENABLE_OBJC_REWRITER
case RewriteObjC: return llvm::make_unique<RewriteObjCAction>();
case RewriteObjC: return std::make_unique<RewriteObjCAction>();
#else
case RewriteObjC: Action = "RewriteObjC"; break;
#endif
#if CLANG_ENABLE_ARCMT
case MigrateSource:
return llvm::make_unique<arcmt::MigrateSourceAction>();
return std::make_unique<arcmt::MigrateSourceAction>();
#else
case MigrateSource: Action = "MigrateSource"; break;
#endif
#if CLANG_ENABLE_STATIC_ANALYZER
case RunAnalysis: return llvm::make_unique<ento::AnalysisAction>();
case RunAnalysis: return std::make_unique<ento::AnalysisAction>();
#else
case RunAnalysis: Action = "RunAnalysis"; break;
#endif
case RunPreprocessorOnly: return llvm::make_unique<PreprocessOnlyAction>();
case RunPreprocessorOnly: return std::make_unique<PreprocessOnlyAction>();
case PrintDependencyDirectivesSourceMinimizerOutput:
return llvm::make_unique<PrintDependencyDirectivesSourceMinimizerAction>();
return std::make_unique<PrintDependencyDirectivesSourceMinimizerAction>();
}
#if !CLANG_ENABLE_ARCMT || !CLANG_ENABLE_STATIC_ANALYZER \
@ -143,7 +143,7 @@ CreateFrontendAction(CompilerInstance &CI) {
const FrontendOptions &FEOpts = CI.getFrontendOpts();
if (FEOpts.FixAndRecompile) {
Act = llvm::make_unique<FixItRecompile>(std::move(Act));
Act = std::make_unique<FixItRecompile>(std::move(Act));
}
#if CLANG_ENABLE_ARCMT
@ -154,13 +154,13 @@ CreateFrontendAction(CompilerInstance &CI) {
case FrontendOptions::ARCMT_None:
break;
case FrontendOptions::ARCMT_Check:
Act = llvm::make_unique<arcmt::CheckAction>(std::move(Act));
Act = std::make_unique<arcmt::CheckAction>(std::move(Act));
break;
case FrontendOptions::ARCMT_Modify:
Act = llvm::make_unique<arcmt::ModifyAction>(std::move(Act));
Act = std::make_unique<arcmt::ModifyAction>(std::move(Act));
break;
case FrontendOptions::ARCMT_Migrate:
Act = llvm::make_unique<arcmt::MigrateAction>(std::move(Act),
Act = std::make_unique<arcmt::MigrateAction>(std::move(Act),
FEOpts.MTMigrateDir,
FEOpts.ARCMTMigrateReportOut,
FEOpts.ARCMTMigrateEmitARCErrors);
@ -168,7 +168,7 @@ CreateFrontendAction(CompilerInstance &CI) {
}
if (FEOpts.ObjCMTAction != FrontendOptions::ObjCMT_None) {
Act = llvm::make_unique<arcmt::ObjCMigrateAction>(std::move(Act),
Act = std::make_unique<arcmt::ObjCMigrateAction>(std::move(Act),
FEOpts.MTMigrateDir,
FEOpts.ObjCMTAction);
}
@ -178,7 +178,7 @@ CreateFrontendAction(CompilerInstance &CI) {
// If there are any AST files to merge, create a frontend action
// adaptor to perform the merge.
if (!FEOpts.ASTMergeFiles.empty())
Act = llvm::make_unique<ASTMergeAction>(std::move(Act),
Act = std::make_unique<ASTMergeAction>(std::move(Act),
FEOpts.ASTMergeFiles);
return Act;
@ -231,7 +231,7 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
// This should happen AFTER plugins have been loaded!
if (!Clang->getFrontendOpts().LLVMArgs.empty()) {
unsigned NumArgs = Clang->getFrontendOpts().LLVMArgs.size();
auto Args = llvm::make_unique<const char*[]>(NumArgs + 2);
auto Args = std::make_unique<const char*[]>(NumArgs + 2);
Args[0] = "clang (LLVM option parsing)";
for (unsigned i = 0; i != NumArgs; ++i)
Args[i + 1] = Clang->getFrontendOpts().LLVMArgs[i].c_str();

View file

@ -118,12 +118,12 @@ protected:
std::unique_ptr<IndexASTConsumer>
createIndexASTConsumer(CompilerInstance &CI) {
return llvm::make_unique<IndexASTConsumer>(CI.getPreprocessorPtr(),
return std::make_unique<IndexASTConsumer>(CI.getPreprocessorPtr(),
IndexCtx);
}
std::unique_ptr<PPCallbacks> createIndexPPCallbacks() {
return llvm::make_unique<IndexPPCallbacks>(IndexCtx);
return std::make_unique<IndexPPCallbacks>(IndexCtx);
}
void finish() {
@ -176,7 +176,7 @@ protected:
std::vector<std::unique_ptr<ASTConsumer>> Consumers;
Consumers.push_back(std::move(OtherConsumer));
Consumers.push_back(createIndexASTConsumer(CI));
return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
return std::make_unique<MultiplexConsumer>(std::move(Consumers));
}
bool BeginSourceFileAction(clang::CompilerInstance &CI) override {
@ -200,10 +200,10 @@ index::createIndexingAction(std::shared_ptr<IndexDataConsumer> DataConsumer,
IndexingOptions Opts,
std::unique_ptr<FrontendAction> WrappedAction) {
if (WrappedAction)
return llvm::make_unique<WrappingIndexAction>(std::move(WrappedAction),
return std::make_unique<WrappingIndexAction>(std::move(WrappedAction),
std::move(DataConsumer),
Opts);
return llvm::make_unique<IndexAction>(std::move(DataConsumer), Opts);
return std::make_unique<IndexAction>(std::move(DataConsumer), Opts);
}
static bool topLevelDeclVisitor(void *context, const Decl *D) {
@ -257,7 +257,7 @@ void index::indexTopLevelDecls(ASTContext &Ctx, Preprocessor &PP,
std::unique_ptr<PPCallbacks>
index::indexMacrosCallback(IndexDataConsumer &Consumer, IndexingOptions Opts) {
return llvm::make_unique<IndexPPCallbacks>(
return std::make_unique<IndexPPCallbacks>(
std::make_shared<IndexingContext>(Opts, Consumer));
}

View file

@ -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());

Some files were not shown because too many files have changed in this diff Show more