ExecutionSession ES;
RTDyldObjectLinkingLayer ObjLinkingLayer(
- ES, []() { return llvm::make_unique<SectionMemoryManager>(); });
+ ES, []() { return std::make_unique<SectionMemoryManager>(); });
CXXCompileLayer CXXLayer(ES, ObjLinkingLayer);
// Create JITDylib "A" and add code to it using the CXX layer.
.. code-block:: c++
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
ThreadSafeModules can be constructed from a pair of a std::unique_ptr<Module>
and a ThreadSafeContext value. ThreadSafeContext values may be shared between
.. code-block:: c++
ThreadSafeModule TSM1(
- llvm::make_unique<Module>("M1", *TSCtx.getContext()), TSCtx);
+ std::make_unique<Module>("M1", *TSCtx.getContext()), TSCtx);
ThreadSafeModule TSM2(
- llvm::make_unique<Module>("M2", *TSCtx.getContext()), TSCtx);
+ std::make_unique<Module>("M2", *TSCtx.getContext()), TSCtx);
Before using a ThreadSafeContext, clients should ensure that either the context
is only accessible on the current thread, or that the context is locked. In the
.. code-block:: c++
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
ThreadPool TP(NumThreads);
JITStack J;
// Maximize concurrency opportunities by loading every module on a
// separate context.
for (const auto &IRPath : IRPaths) {
- auto Ctx = llvm::make_unique<LLVMContext>();
- auto M = llvm::make_unique<LLVMContext>("M", *Ctx);
+ auto Ctx = std::make_unique<LLVMContext>();
+ auto M = std::make_unique<LLVMContext>("M", *Ctx);
CompileLayer.add(ES.getMainJITDylib(),
ThreadSafeModule(std::move(M), std::move(Ctx)));
}
.. code-block:: c++
// Save memory by using one context for all Modules:
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
for (const auto &IRPath : IRPaths) {
ThreadSafeModule TSM(parsePath(IRPath, *TSCtx.getContext()), TSCtx);
CompileLayer.add(ES.getMainJITDylib(), ThreadSafeModule(std::move(TSM));
public:
KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL)
: ObjectLayer(ES,
- []() { return llvm::make_unique<SectionMemoryManager>(); }),
+ []() { return std::make_unique<SectionMemoryManager>(); }),
CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))),
DL(std::move(DL)), Mangle(ES, this->DL),
- Ctx(llvm::make_unique<LLVMContext>()) {
+ Ctx(std::make_unique<LLVMContext>()) {
ES.getMainJITDylib().setGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL)));
}
if (!DL)
return DL.takeError();
- return llvm::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
+ return std::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
}
const DataLayout &getDataLayout() const { return DL; }
KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL)
: ObjectLayer(ES,
- []() { return llvm::make_unique<SectionMemoryManager>(); }),
+ []() { return std::make_unique<SectionMemoryManager>(); }),
CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))),
TransformLayer(ES, CompileLayer, optimizeModule),
DL(std::move(DL)), Mangle(ES, this->DL),
- Ctx(llvm::make_unique<LLVMContext>()) {
+ Ctx(std::make_unique<LLVMContext>()) {
ES.getMainJITDylib().setGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL)));
}
static Expected<ThreadSafeModule>
optimizeModule(ThreadSafeModule M, const MaterializationResponsibility &R) {
// Create a function pass manager.
- auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get());
+ auto FPM = std::make_unique<legacy::FunctionPassManager>(M.get());
// Add some optimizations.
FPM->add(createInstructionCombiningPass());
.. code-block:: c++
Error IRLayer::add(JITDylib &JD, ThreadSafeModule TSM, VModuleKey K) {
- return JD.define(llvm::make_unique<BasicIRLayerMaterializationUnit>(
+ return JD.define(std::make_unique<BasicIRLayerMaterializationUnit>(
*this, std::move(K), std::move(TSM)));
}
.. code-block:: c++
- auto LHS = llvm::make_unique<VariableExprAST>("x");
- auto RHS = llvm::make_unique<VariableExprAST>("y");
+ auto LHS = std::make_unique<VariableExprAST>("x");
+ auto RHS = std::make_unique<VariableExprAST>("y");
auto Result = std::make_unique<BinaryExprAST>('+', std::move(LHS),
std::move(RHS));
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
This routine follows the same style as the other routines. (It expects
}
// Merge LHS/RHS.
- LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
+ LHS = std::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
std::move(RHS));
} // loop around to the top of the while loop.
}
return nullptr;
}
// Merge LHS/RHS.
- LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
+ LHS = std::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
std::move(RHS));
} // loop around to the top of the while loop.
}
// success.
getNextToken(); // eat ')'.
- return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
+ return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
}
Given this, a function definition is very simple, just a prototype plus
if (!Proto) return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("", std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ auto Proto = std::make_unique<PrototypeAST>("", std::vector<std::string>());
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
void InitializeModuleAndPassManager(void) {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
// Create a new pass manager attached to it.
- TheFPM = llvm::make_unique<FunctionPassManager>(TheModule.get());
+ TheFPM = std::make_unique<FunctionPassManager>(TheModule.get());
// Do simple "peephole" optimizations and bit-twiddling optzns.
TheFPM->add(createInstructionCombiningPass());
fprintf(stderr, "ready> ");
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
// Run the main "interpreter loop" now.
MainLoop();
void InitializeModuleAndPassManager(void) {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
// Create a new pass manager attached to it.
- TheFPM = llvm::make_unique<FunctionPassManager>(TheModule.get());
+ TheFPM = std::make_unique<FunctionPassManager>(TheModule.get());
...
The KaleidoscopeJIT class is a simple JIT built specifically for these
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start),
std::move(End), std::move(Step),
std::move(Body));
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames), Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames), Kind != 0,
BinaryPrecedence);
}
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames),
+ return std::make_unique<VarExprAST>(std::move(VarNames),
std::move(Body));
}
.. code-block:: udiff
- - auto Proto = llvm::make_unique<PrototypeAST>("", std::vector<std::string>());
- + auto Proto = llvm::make_unique<PrototypeAST>("main", std::vector<std::string>());
+ - auto Proto = std::make_unique<PrototypeAST>("", std::vector<std::string>());
+ + auto Proto = std::make_unique<PrototypeAST>("main", std::vector<std::string>());
just with the simple change of giving it a name.
.. code-block:: c++
- LHS = llvm::make_unique<BinaryExprAST>(BinLoc, BinOp, std::move(LHS),
+ LHS = std::make_unique<BinaryExprAST>(BinLoc, BinOp, std::move(LHS),
std::move(RHS));
giving us locations for each of our expressions and variables.
// Make the module, which holds all the code.
std::unique_ptr<llvm::Module> Owner =
- llvm::make_unique<llvm::Module>("my cool jit", Context);
+ std::make_unique<llvm::Module>("my cool jit", Context);
llvm::Module *module = Owner.get();
std::unique_ptr<llvm::RTDyldMemoryManager> MemMgr(new llvm::SectionMemoryManager());
LLVMContext Context;
// Create some module to put our function into it.
- std::unique_ptr<Module> Owner = make_unique<Module>("test", Context);
+ std::unique_ptr<Module> Owner = std::make_unique<Module>("test", Context);
Module *M = Owner.get();
// Create the add1 function entry and insert this entry into module M. The
ExitOnError ExitOnErr;
ThreadSafeModule createDemoModule() {
- auto Context = llvm::make_unique<LLVMContext>();
- auto M = make_unique<Module>("test", *Context);
+ auto Context = std::make_unique<LLVMContext>();
+ auto M = std::make_unique<Module>("test", *Context);
// Create the add1 function entry and insert this entry into module M. The
// function will have a return type of "int" and take an argument of "int".
public:
KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL)
: ObjectLayer(ES,
- []() { return llvm::make_unique<SectionMemoryManager>(); }),
+ []() { return std::make_unique<SectionMemoryManager>(); }),
CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))),
DL(std::move(DL)), Mangle(ES, this->DL),
- Ctx(llvm::make_unique<LLVMContext>()) {
+ Ctx(std::make_unique<LLVMContext>()) {
ES.getMainJITDylib().addGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(
DL.getGlobalPrefix())));
if (!DL)
return DL.takeError();
- return llvm::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
+ return std::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
}
const DataLayout &getDataLayout() const { return DL; }
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr(unsigned ExprCount) {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>
+ auto Proto = std::make_unique<PrototypeAST>
(("__anon_expr" + Twine(ExprCount)).str(), std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModule() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", *TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", *TheContext);
TheModule->setDataLayout(TheJIT->getDataLayout());
// Create a new builder for the module.
- Builder = llvm::make_unique<IRBuilder<>>(*TheContext);
+ Builder = std::make_unique<IRBuilder<>>(*TheContext);
}
static void HandleDefinition() {
public:
KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL)
: ObjectLayer(ES,
- []() { return llvm::make_unique<SectionMemoryManager>(); }),
+ []() { return std::make_unique<SectionMemoryManager>(); }),
CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))),
OptimizeLayer(ES, CompileLayer, optimizeModule),
DL(std::move(DL)), Mangle(ES, this->DL),
- Ctx(llvm::make_unique<LLVMContext>()) {
+ Ctx(std::make_unique<LLVMContext>()) {
ES.getMainJITDylib().addGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(
DL.getGlobalPrefix())));
if (!DL)
return DL.takeError();
- return llvm::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
+ return std::make_unique<KaleidoscopeJIT>(std::move(*JTMB), std::move(*DL));
}
Error addModule(std::unique_ptr<Module> M) {
optimizeModule(ThreadSafeModule TSM, const MaterializationResponsibility &R) {
TSM.withModuleDo([](Module &M) {
// Create a function pass manager.
- auto FPM = llvm::make_unique<legacy::FunctionPassManager>(&M);
+ auto FPM = std::make_unique<legacy::FunctionPassManager>(&M);
// Add some optimizations.
FPM->add(createInstructionCombiningPass());
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr(unsigned ExprCount) {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>(
+ auto Proto = std::make_unique<PrototypeAST>(
("__anon_expr" + Twine(ExprCount)).str(), std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModule() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", *TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", *TheContext);
TheModule->setDataLayout(TheJIT->getDataLayout());
// Create a new builder for the module.
- Builder = llvm::make_unique<IRBuilder<>>(*TheContext);
+ Builder = std::make_unique<IRBuilder<>>(*TheContext);
}
static void HandleDefinition() {
private:
std::unique_ptr<Module> optimizeModule(std::unique_ptr<Module> M) {
// Create a function pass manager.
- auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get());
+ auto FPM = std::make_unique<legacy::FunctionPassManager>(M.get());
// Add some optimizations.
FPM->add(createInstructionCombiningPass());
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModule() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
}
fprintf(stderr, "ready> ");
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
InitializeModule();
std::unique_ptr<Module> optimizeModule(std::unique_ptr<Module> M) {
// Create a function pass manager.
- auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get());
+ auto FPM = std::make_unique<legacy::FunctionPassManager>(M.get());
// Add some optimizations.
FPM->add(createInstructionCombiningPass());
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModule() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
}
static void HandleDefinition() {
if (auto FnAST = ParseDefinition()) {
FunctionProtos[FnAST->getProto().getName()] =
- llvm::make_unique<PrototypeAST>(FnAST->getProto());
+ std::make_unique<PrototypeAST>(FnAST->getProto());
ExitOnErr(TheJIT->addFunctionAST(std::move(FnAST)));
} else {
// Skip token for error recovery.
// Evaluate a top-level expression into an anonymous function.
if (auto FnAST = ParseTopLevelExpr()) {
FunctionProtos[FnAST->getName()] =
- llvm::make_unique<PrototypeAST>(FnAST->getProto());
+ std::make_unique<PrototypeAST>(FnAST->getProto());
if (FnAST->codegen()) {
// JIT the module containing the anonymous expression, keeping a handle so
// we can free it later.
fprintf(stderr, "ready> ");
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
InitializeModule();
std::unique_ptr<Module> optimizeModule(std::unique_ptr<Module> M) {
// Create a function pass manager.
- auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get());
+ auto FPM = std::make_unique<legacy::FunctionPassManager>(M.get());
// Add some optimizations.
FPM->add(createInstructionCombiningPass());
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
auto PEArgs = std::vector<std::unique_ptr<ExprAST>>();
PEArgs.push_back(std::move(E));
auto PrintExpr =
- llvm::make_unique<CallExprAST>("printExprResult", std::move(PEArgs));
+ std::make_unique<CallExprAST>("printExprResult", std::move(PEArgs));
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto),
+ return std::make_unique<FunctionAST>(std::move(Proto),
std::move(PrintExpr));
}
return nullptr;
static void InitializeModule() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
}
static void HandleDefinition() {
if (auto FnAST = ParseDefinition()) {
FunctionProtos[FnAST->getProto().getName()] =
- llvm::make_unique<PrototypeAST>(FnAST->getProto());
+ std::make_unique<PrototypeAST>(FnAST->getProto());
ExitOnErr(TheJIT->addFunctionAST(std::move(FnAST)));
} else {
// Skip token for error recovery.
// Evaluate a top-level expression into an anonymous function.
if (auto FnAST = ParseTopLevelExpr()) {
FunctionProtos[FnAST->getName()] =
- llvm::make_unique<PrototypeAST>(FnAST->getProto());
+ std::make_unique<PrototypeAST>(FnAST->getProto());
if (FnAST->codegen()) {
// JIT the module containing the anonymous expression, keeping a handle so
// we can free it later.
exit(1);
}
- return llvm::make_unique<FDRPCChannel>(sockfd, sockfd);
+ return std::make_unique<FDRPCChannel>(sockfd, sockfd);
}
//===----------------------------------------------------------------------===//
ExecutionSession ES;
auto TCPChannel = connect();
auto Remote = ExitOnErr(MyRemote::Create(*TCPChannel, ES));
- TheJIT = llvm::make_unique<KaleidoscopeJIT>(ES, *Remote);
+ TheJIT = std::make_unique<KaleidoscopeJIT>(ES, *Remote);
// Automatically inject a definition for 'printExprResult'.
FunctionProtos["printExprResult"] =
- llvm::make_unique<PrototypeAST>("printExprResult",
+ std::make_unique<PrototypeAST>("printExprResult",
std::vector<std::string>({"Val"}));
// Prime the first token.
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// primary
}
// Merge LHS/RHS.
- LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
+ LHS = std::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
std::move(RHS));
}
}
// success.
getNextToken(); // eat ')'.
- return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
+ return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
}
/// definition ::= 'def' prototype expression
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// primary
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
// success.
getNextToken(); // eat ')'.
- return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
+ return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
}
/// definition ::= 'def' prototype expression
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
getNextToken();
// Make the module, which holds all the code.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
// Run the main "interpreter loop" now.
MainLoop();
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// primary
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
// success.
getNextToken(); // eat ')'.
- return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
+ return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
}
/// definition ::= 'def' prototype expression
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModuleAndPassManager() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
// Create a new pass manager attached to it.
- TheFPM = llvm::make_unique<legacy::FunctionPassManager>(TheModule.get());
+ TheFPM = std::make_unique<legacy::FunctionPassManager>(TheModule.get());
// Do simple "peephole" optimizations and bit-twiddling optzns.
TheFPM->add(createInstructionCombiningPass());
fprintf(stderr, "ready> ");
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
InitializeModuleAndPassManager();
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
// success.
getNextToken(); // eat ')'.
- return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
+ return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames));
}
/// definition ::= 'def' prototype expression
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModuleAndPassManager() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
// Create a new pass manager attached to it.
- TheFPM = llvm::make_unique<legacy::FunctionPassManager>(TheModule.get());
+ TheFPM = std::make_unique<legacy::FunctionPassManager>(TheModule.get());
// Do simple "peephole" optimizations and bit-twiddling optzns.
TheFPM->add(createInstructionCombiningPass());
fprintf(stderr, "ready> ");
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
InitializeModuleAndPassManager();
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModuleAndPassManager() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
// Create a new pass manager attached to it.
- TheFPM = llvm::make_unique<legacy::FunctionPassManager>(TheModule.get());
+ TheFPM = std::make_unique<legacy::FunctionPassManager>(TheModule.get());
// Do simple "peephole" optimizations and bit-twiddling optzns.
TheFPM->add(createInstructionCombiningPass());
fprintf(stderr, "ready> ");
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
InitializeModuleAndPassManager();
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModuleAndPassManager() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
// Create a new pass manager attached to it.
- TheFPM = llvm::make_unique<legacy::FunctionPassManager>(TheModule.get());
+ TheFPM = std::make_unique<legacy::FunctionPassManager>(TheModule.get());
// Promote allocas to registers.
TheFPM->add(createPromoteMemoryToRegisterPass());
fprintf(stderr, "ready> ");
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
InitializeModuleAndPassManager();
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>("__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModuleAndPassManager() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
}
static void HandleDefinition() {
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(LitLoc, IdName);
+ return std::make_unique<VariableExprAST>(LitLoc, IdName);
// Call.
getNextToken(); // eat (
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(LitLoc, IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(LitLoc, IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(IfLoc, std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(IfLoc, std::move(Cond), std::move(Then),
std::move(Else));
}
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
}
// Merge LHS/RHS.
- LHS = llvm::make_unique<BinaryExprAST>(BinLoc, BinOp, std::move(LHS),
+ LHS = std::make_unique<BinaryExprAST>(BinLoc, BinOp, std::move(LHS),
std::move(RHS));
}
}
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnLoc, FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnLoc, FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
SourceLocation FnLoc = CurLoc;
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>(FnLoc, "__anon_expr",
+ auto Proto = std::make_unique<PrototypeAST>(FnLoc, "__anon_expr",
std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
static void InitializeModule() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", TheContext);
TheModule->setDataLayout(TheJIT->getTargetMachine().createDataLayout());
}
// Prime the first token.
getNextToken();
- TheJIT = llvm::make_unique<KaleidoscopeJIT>();
+ TheJIT = std::make_unique<KaleidoscopeJIT>();
InitializeModule();
TheModule->addModuleFlag(llvm::Module::Warning, "Dwarf Version", 2);
// Construct the DIBuilder, we do this here because we need the module.
- DBuilder = llvm::make_unique<DIBuilder>(*TheModule);
+ DBuilder = std::make_unique<DIBuilder>(*TheModule);
// Create the compile unit for the module.
// Currently down as "fib.ks" as a filename since we're redirecting stdin
using namespace llvm;
using namespace llvm::orc;
- auto Ctx = llvm::make_unique<LLVMContext>();
+ auto Ctx = std::make_unique<LLVMContext>();
SMDiagnostic Err;
auto M = parseIR(MemoryBufferRef(Source, Name), Err, *Ctx);
LLVMContext Context;
// Create some module to put our function into it.
- std::unique_ptr<Module> Owner = make_unique<Module>("test", Context);
+ std::unique_ptr<Module> Owner = std::make_unique<Module>("test", Context);
Module *M = Owner.get();
Function* add1F = createAdd1( M );
if (!DL)
return DL.takeError();
- auto ES = llvm::make_unique<ExecutionSession>();
+ auto ES = std::make_unique<ExecutionSession>();
auto LCTMgr = createLocalLazyCallThroughManager(
JTMB->getTargetTriple(), *ES,
}
static std::unique_ptr<SectionMemoryManager> createMemMgr() {
- return llvm::make_unique<SectionMemoryManager>();
+ return std::make_unique<SectionMemoryManager>();
}
std::unique_ptr<ExecutionSession> ES;
// Load the IR inputs.
for (const auto &InputFile : InputFiles) {
SMDiagnostic Err;
- auto Ctx = llvm::make_unique<LLVMContext>();
+ auto Ctx = std::make_unique<LLVMContext>();
auto M = parseIRFile(InputFile, Err, *Ctx);
if (!M) {
Err.print(argv[0], errs());
explicit StorageImpl(T &&Value) : Value(std::move(Value)) {}
std::unique_ptr<StorageBase> clone() const override {
- return llvm::make_unique<StorageImpl<T>>(Value);
+ return std::make_unique<StorageImpl<T>>(Value);
}
const void *id() const override { return &TypeId<T>::Id; }
int>::type = 0>
Any(T &&Value) {
using U = typename std::decay<T>::type;
- Storage = llvm::make_unique<StorageImpl<U>>(std::forward<T>(Value));
+ Storage = std::make_unique<StorageImpl<U>>(std::forward<T>(Value));
}
Any(Any &&Other) : Storage(std::move(Other.Storage)) {}
auto Deconst = const_cast<RegionBase<Tr> *>(this);
typename BBNodeMapT::value_type V = {
BB,
- llvm::make_unique<RegionNodeT>(static_cast<RegionT *>(Deconst), BB)};
+ std::make_unique<RegionNodeT>(static_cast<RegionT *>(Deconst), BB)};
at = BBNodeMap.insert(std::move(V)).first;
}
return at->second.get();
}
GISelKnownBits &get(MachineFunction &MF) {
if (!Info)
- Info = make_unique<GISelKnownBits>(MF);
+ Info = std::make_unique<GISelKnownBits>(MF);
return *Info.get();
}
void getAnalysisUsage(AnalysisUsage &AU) const override;
/// Constructs a new LiveRange object.
LiveRange(bool UseSegmentSet = false)
- : segmentSet(UseSegmentSet ? llvm::make_unique<SegmentSet>()
+ : segmentSet(UseSegmentSet ? std::make_unique<SegmentSet>()
: nullptr) {}
/// Constructs a new LiveRange object by copying segments and valnos from
RegClassInfo(rci), II_setByPragma(II), Topo(SUnits, &ExitSU) {
P.MF->getSubtarget().getSMSMutations(Mutations);
if (SwpEnableCopyToPhi)
- Mutations.push_back(llvm::make_unique<CopyToPhiMutation>());
+ Mutations.push_back(std::make_unique<CopyToPhiMutation>());
}
void schedule() override;
public:
/// Construct a PBQP vector of the given size.
explicit Vector(unsigned Length)
- : Length(Length), Data(llvm::make_unique<PBQPNum []>(Length)) {}
+ : Length(Length), Data(std::make_unique<PBQPNum []>(Length)) {}
/// Construct a PBQP vector with initializer.
Vector(unsigned Length, PBQPNum InitVal)
- : Length(Length), Data(llvm::make_unique<PBQPNum []>(Length)) {
+ : Length(Length), Data(std::make_unique<PBQPNum []>(Length)) {
std::fill(Data.get(), Data.get() + Length, InitVal);
}
/// Copy construct a PBQP vector.
Vector(const Vector &V)
- : Length(V.Length), Data(llvm::make_unique<PBQPNum []>(Length)) {
+ : Length(V.Length), Data(std::make_unique<PBQPNum []>(Length)) {
std::copy(V.Data.get(), V.Data.get() + Length, Data.get());
}
public:
/// Construct a PBQP Matrix with the given dimensions.
Matrix(unsigned Rows, unsigned Cols) :
- Rows(Rows), Cols(Cols), Data(llvm::make_unique<PBQPNum []>(Rows * Cols)) {
+ Rows(Rows), Cols(Cols), Data(std::make_unique<PBQPNum []>(Rows * Cols)) {
}
/// Construct a PBQP Matrix with the given dimensions and initial
/// value.
Matrix(unsigned Rows, unsigned Cols, PBQPNum InitVal)
: Rows(Rows), Cols(Cols),
- Data(llvm::make_unique<PBQPNum []>(Rows * Cols)) {
+ Data(std::make_unique<PBQPNum []>(Rows * Cols)) {
std::fill(Data.get(), Data.get() + (Rows * Cols), InitVal);
}
/// Copy construct a PBQP matrix.
Matrix(const Matrix &M)
: Rows(M.Rows), Cols(M.Cols),
- Data(llvm::make_unique<PBQPNum []>(Rows * Cols)) {
+ Data(std::make_unique<PBQPNum []>(Rows * Cols)) {
std::copy(M.Data.get(), M.Data.get() + (Rows * Cols), Data.get());
}
///
/// This can also be used to plug a new MachineSchedStrategy into an instance
/// of the standard ScheduleDAGMI:
- /// return new ScheduleDAGMI(C, make_unique<MyStrategy>(C), /*RemoveKillFlags=*/false)
+ /// return new ScheduleDAGMI(C, std::make_unique<MyStrategy>(C), /*RemoveKillFlags=*/false)
///
/// Return NULL to select the default (generic) machine scheduler.
virtual ScheduleDAGInstrs *
Error visitSymbolBegin(CVSymbol &Record) override {
assert(!Mapping && "Already in a symbol mapping!");
- Mapping = llvm::make_unique<MappingInfo>(Record.content(), Container);
+ Mapping = std::make_unique<MappingInfo>(Record.content(), Container);
return Mapping->Mapping.visitSymbolBegin(Record);
}
Error visitSymbolEnd(CVSymbol &Record) override {
Error visitTypeBegin(CVType &Record) override {
assert(!Mapping && "Already in a type mapping!");
- Mapping = llvm::make_unique<MappingInfo>(Record.content());
+ Mapping = std::make_unique<MappingInfo>(Record.content());
return Mapping->Mapping.visitTypeBegin(Record);
}
LoadedObjectInfoHelper(Ts &&... Args) : Base(std::forward<Ts>(Args)...) {}
std::unique_ptr<llvm::LoadedObjectInfo> clone() const override {
- return llvm::make_unique<Derived>(static_cast<const Derived &>(*this));
+ return std::make_unique<Derived>(static_cast<const Derived &>(*this));
}
};
// Initial construction must not access the cache, since it must be done
// atomically.
- auto Result = llvm::make_unique<ConcreteSymbolT>(
+ auto Result = std::make_unique<ConcreteSymbolT>(
Session, Id, std::forward<Args>(ConstructorArgs)...);
Result->SymbolId = Id;
auto BaseIter = RawSymbol->findChildren(T::Tag);
if (!BaseIter)
return nullptr;
- return llvm::make_unique<ConcreteSymbolEnumerator<T>>(std::move(BaseIter));
+ return std::make_unique<ConcreteSymbolEnumerator<T>>(std::move(BaseIter));
}
std::unique_ptr<IPDBEnumSymbols> findAllChildren(PDB_SymType Type) const;
std::unique_ptr<IPDBEnumSymbols> findAllChildren() const;
std::unique_ptr<ResourceOwner<ResourceT>>
wrapOwnership(ResourcePtrT ResourcePtr) {
using RO = ResourceOwnerImpl<ResourceT, ResourcePtrT>;
- return llvm::make_unique<RO>(std::move(ResourcePtr));
+ return std::make_unique<RO>(std::move(ResourcePtr));
}
struct LogicalDylib {
return Error::success();
// Create the GlobalValues module.
- auto GVsM = llvm::make_unique<Module>((SrcM.getName() + ".globals").str(),
+ auto GVsM = std::make_unique<Module>((SrcM.getName() + ".globals").str(),
SrcM.getContext());
GVsM->setDataLayout(DL);
NewName += F->getName();
}
- auto M = llvm::make_unique<Module>(NewName, SrcM.getContext());
+ auto M = std::make_unique<Module>(NewName, SrcM.getContext());
M->setDataLayout(SrcM.getDataLayout());
ValueToValueMapTy VMap;
///
inline std::unique_ptr<AbsoluteSymbolsMaterializationUnit>
absoluteSymbols(SymbolMap Symbols, VModuleKey K = VModuleKey()) {
- return llvm::make_unique<AbsoluteSymbolsMaterializationUnit>(
+ return std::make_unique<AbsoluteSymbolsMaterializationUnit>(
std::move(Symbols), std::move(K));
}
/// \endcode
inline std::unique_ptr<ReExportsMaterializationUnit>
symbolAliases(SymbolAliasMap Aliases, VModuleKey K = VModuleKey()) {
- return llvm::make_unique<ReExportsMaterializationUnit>(
+ return std::make_unique<ReExportsMaterializationUnit>(
nullptr, true, std::move(Aliases), std::move(K));
}
inline std::unique_ptr<ReExportsMaterializationUnit>
reexports(JITDylib &SourceJD, SymbolAliasMap Aliases,
bool MatchNonExported = false, VModuleKey K = VModuleKey()) {
- return llvm::make_unique<ReExportsMaterializationUnit>(
+ return std::make_unique<ReExportsMaterializationUnit>(
&SourceJD, MatchNonExported, std::move(Aliases), std::move(K));
}
createLambdaResolver(DylibLookupFtorT DylibLookupFtor,
ExternalLookupFtorT ExternalLookupFtor) {
using LR = LambdaResolver<DylibLookupFtorT, ExternalLookupFtorT>;
- return make_unique<LR>(std::move(DylibLookupFtor),
+ return std::make_unique<LR>(std::move(DylibLookupFtor),
std::move(ExternalLookupFtor));
}
DylibLookupFtorT DylibLookupFtor,
ExternalLookupFtorT ExternalLookupFtor) {
using LR = LambdaResolver<DylibLookupFtorT, ExternalLookupFtorT>;
- return make_unique<LR>(AcknowledgeORCv1Deprecation,
+ return std::make_unique<LR>(AcknowledgeORCv1Deprecation,
std::move(DylibLookupFtor),
std::move(ExternalLookupFtor));
}
bool ExportedSymbolsOnly) const {
assert(!MangledSymbols && "Mangled symbols map already exists?");
- auto Symbols = llvm::make_unique<StringMap<const GlobalValue*>>();
+ auto Symbols = std::make_unique<StringMap<const GlobalValue*>>();
Mangler Mang;
Error addModule(VModuleKey K, std::unique_ptr<Module> M) {
assert(!ModuleMap.count(K) && "VModuleKey K already in use");
ModuleMap[K] =
- llvm::make_unique<EmissionDeferredModule>(std::move(K), std::move(M));
+ std::make_unique<EmissionDeferredModule>(std::move(K), std::move(M));
return Error::success();
}
template <typename NotifyResolvedImpl>
static std::unique_ptr<NotifyResolvedFunction>
createNotifyResolvedFunction(NotifyResolvedImpl NotifyResolved) {
- return llvm::make_unique<NotifyResolvedFunctionImpl<NotifyResolvedImpl>>(
+ return std::make_unique<NotifyResolvedFunctionImpl<NotifyResolvedImpl>>(
std::move(NotifyResolved));
}
IndirectStubsManager &ISManager, JITDylib &SourceJD,
SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc = nullptr,
VModuleKey K = VModuleKey()) {
- return llvm::make_unique<LazyReexportsMaterializationUnit>(
+ return std::make_unique<LazyReexportsMaterializationUnit>(
LCTManager, ISManager, SourceJD, std::move(CallableAliases), SrcJDLoc,
std::move(K));
}
typename std::remove_reference<GetResponsibilitySetFn>::type>::type,
typename std::remove_cv<
typename std::remove_reference<LookupFn>::type>::type>;
- return llvm::make_unique<LambdaSymbolResolverImpl>(
+ return std::make_unique<LambdaSymbolResolverImpl>(
std::forward<GetResponsibilitySetFn>(GetResponsibilitySet),
std::forward<LookupFn>(Lookup));
}
ExecutionSession &ES,
JITTargetAddress ErrorHandlerAddress)
: JITCompileCallbackManager(
- llvm::make_unique<RemoteTrampolinePool>(Client), ES,
+ std::make_unique<RemoteTrampolinePool>(Client), ES,
ErrorHandlerAddress) {}
};
auto Id = IndirectStubOwnerIds.getNext();
if (auto Err = callB<stubs::CreateIndirectStubsOwner>(Id))
return std::move(Err);
- return llvm::make_unique<RemoteIndirectStubsManager>(*this, Id);
+ return std::make_unique<RemoteIndirectStubsManager>(*this, Id);
}
Expected<RemoteCompileCallbackManager &>
// Create a ResponseHandler from a given user handler.
template <typename ChannelT, typename FuncRetT, typename HandlerT>
std::unique_ptr<ResponseHandler<ChannelT>> createResponseHandler(HandlerT H) {
- return llvm::make_unique<ResponseHandlerImpl<ChannelT, FuncRetT, HandlerT>>(
+ return std::make_unique<ResponseHandlerImpl<ChannelT, FuncRetT, HandlerT>>(
std::move(H));
}
: K(std::move(K)),
Parent(Parent),
MemMgr(std::move(MemMgr)),
- PFC(llvm::make_unique<PreFinalizeContents>(
+ PFC(std::make_unique<PreFinalizeContents>(
std::move(Obj), std::move(Resolver),
ProcessAllSections)) {
buildInitialSymbolTable(PFC->Obj);
JITSymbolResolverAdapter ResolverAdapter(Parent.ES, *PFC->Resolver,
nullptr);
- PFC->RTDyld = llvm::make_unique<RuntimeDyld>(*MemMgr, ResolverAdapter);
+ PFC->RTDyld = std::make_unique<RuntimeDyld>(*MemMgr, ResolverAdapter);
PFC->RTDyld->setProcessAllSections(PFC->ProcessAllSections);
Finalized = true;
std::shared_ptr<SymbolResolver> Resolver,
bool ProcessAllSections) {
using LOS = ConcreteLinkedObject<MemoryManagerPtrT>;
- return llvm::make_unique<LOS>(Parent, std::move(K), std::move(Obj),
+ return std::make_unique<LOS>(Parent, std::move(K), std::move(Obj),
std::move(MemMgr), std::move(Resolver),
ProcessAllSections);
}
}
Expected<ObjHandleT> addObject(std::string ObjBuffer) {
- auto Buffer = llvm::make_unique<StringMemoryBuffer>(std::move(ObjBuffer));
+ auto Buffer = std::make_unique<StringMemoryBuffer>(std::move(ObjBuffer));
auto Id = HandleIdMgr.getNext();
assert(!BaseLayerHandles.count(Id) && "Id already in use?");
/// Ensure that this has RAUW support, and then return it.
ReplaceableMetadataImpl *getOrCreateReplaceableUses() {
if (!hasReplaceableUses())
- makeReplaceable(llvm::make_unique<ReplaceableMetadataImpl>(getContext()));
+ makeReplaceable(std::make_unique<ReplaceableMetadataImpl>(getContext()));
return getReplaceableUses();
}
if (!TypeTests.empty() || !TypeTestAssumeVCalls.empty() ||
!TypeCheckedLoadVCalls.empty() || !TypeTestAssumeConstVCalls.empty() ||
!TypeCheckedLoadConstVCalls.empty())
- TIdInfo = llvm::make_unique<TypeIdInfo>(TypeIdInfo{
+ TIdInfo = std::make_unique<TypeIdInfo>(TypeIdInfo{
std::move(TypeTests), std::move(TypeTestAssumeVCalls),
std::move(TypeCheckedLoadVCalls),
std::move(TypeTestAssumeConstVCalls),
/// were unable to devirtualize a checked call.
void addTypeTest(GlobalValue::GUID Guid) {
if (!TIdInfo)
- TIdInfo = llvm::make_unique<TypeIdInfo>();
+ TIdInfo = std::make_unique<TypeIdInfo>();
TIdInfo->TypeTests.push_back(Guid);
}
void setVTableFuncs(VTableFuncList Funcs) {
assert(!VTableFuncs);
- VTableFuncs = llvm::make_unique<VTableFuncList>(std::move(Funcs));
+ VTableFuncs = std::make_unique<VTableFuncList>(std::move(Funcs));
}
ArrayRef<VirtFuncOffset> vTableFuncs() const {
struct GraphTraits<ModuleSummaryIndex *> : public GraphTraits<ValueInfo> {
static NodeRef getEntryNode(ModuleSummaryIndex *I) {
std::unique_ptr<GlobalValueSummary> Root =
- make_unique<FunctionSummary>(I->calculateCallGraphRoot());
+ std::make_unique<FunctionSummary>(I->calculateCallGraphRoot());
GlobalValueSummaryInfo G(I->haveGVs());
G.SummaryList.push_back(std::move(Root));
static auto P =
V.emplace(RefGUID, /*IsAnalysis=*/false);
Refs.push_back(ValueInfo(/*IsAnalysis=*/false, &*V.find(RefGUID)));
}
- Elem.SummaryList.push_back(llvm::make_unique<FunctionSummary>(
+ Elem.SummaryList.push_back(std::make_unique<FunctionSummary>(
GlobalValueSummary::GVFlags(
static_cast<GlobalValue::LinkageTypes>(FSum.Linkage),
FSum.NotEligibleToImport, FSum.Live, FSum.IsLocal, FSum.CanAutoHide),
AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT>>
run(IRUnitT &IR, AnalysisManager<IRUnitT, ExtraArgTs...> &AM,
ExtraArgTs... ExtraArgs) override {
- return llvm::make_unique<ResultModelT>(
+ return std::make_unique<ResultModelT>(
Pass.run(IR, AM, std::forward<ExtraArgTs>(ExtraArgs)...));
}
setDiscardValueNames(C.ShouldDiscardValueNames);
enableDebugTypeODRUniquing();
setDiagnosticHandler(
- llvm::make_unique<LTOLLVMDiagnosticHandler>(&DiagHandler), true);
+ std::make_unique<LTOLLVMDiagnosticHandler>(&DiagHandler), true);
}
DiagnosticHandlerFunction DiagHandler;
};
unsigned createMemoryGroup() {
Groups.insert(
- std::make_pair(NextGroupID, llvm::make_unique<MemoryGroup>()));
+ std::make_pair(NextGroupID, std::make_unique<MemoryGroup>()));
return NextGroupID++;
}
Scheduler(const MCSchedModel &Model, LSUnit &Lsu,
std::unique_ptr<SchedulerStrategy> SelectStrategy)
- : Scheduler(make_unique<ResourceManager>(Model), Lsu,
+ : Scheduler(std::make_unique<ResourceManager>(Model), Lsu,
std::move(SelectStrategy)) {}
Scheduler(std::unique_ptr<ResourceManager> RM, LSUnit &Lsu,
InstrProfRecord(const InstrProfRecord &RHS)
: Counts(RHS.Counts),
ValueData(RHS.ValueData
- ? llvm::make_unique<ValueProfData>(*RHS.ValueData)
+ ? std::make_unique<ValueProfData>(*RHS.ValueData)
: nullptr) {}
InstrProfRecord &operator=(InstrProfRecord &&) = default;
InstrProfRecord &operator=(const InstrProfRecord &RHS) {
return *this;
}
if (!ValueData)
- ValueData = llvm::make_unique<ValueProfData>(*RHS.ValueData);
+ ValueData = std::make_unique<ValueProfData>(*RHS.ValueData);
else
*ValueData = *RHS.ValueData;
return *this;
std::vector<InstrProfValueSiteRecord> &
getOrCreateValueSitesForKind(uint32_t ValueKind) {
if (!ValueData)
- ValueData = llvm::make_unique<ValueProfData>();
+ ValueData = std::make_unique<ValueProfData>();
switch (ValueKind) {
case IPVK_IndirectCallTarget:
return ValueData->IndirectCallSites;
return std::unique_ptr<InstrProfValueData[]>(nullptr);
}
- auto VD = llvm::make_unique<InstrProfValueData[]>(N);
+ auto VD = std::make_unique<InstrProfValueData[]>(N);
TotalCount = getValueForSite(VD.get(), ValueKind, Site);
return VD;
/// Make a Error instance representing failure using the given error info
/// type.
template <typename ErrT, typename... ArgTs> Error make_error(ArgTs &&... Args) {
- return Error(llvm::make_unique<ErrT>(std::forward<ArgTs>(Args)...));
+ return Error(std::make_unique<ErrT>(std::forward<ArgTs>(Args)...));
}
/// Base class for user error types. Users should declare their error types
assert(IDomNode && "Not immediate dominator specified for block!");
DFSInfoValid = false;
return (DomTreeNodes[BB] = IDomNode->addChild(
- llvm::make_unique<DomTreeNodeBase<NodeT>>(BB, IDomNode))).get();
+ std::make_unique<DomTreeNodeBase<NodeT>>(BB, IDomNode))).get();
}
/// Add a new node to the forward dominator tree and make it a new root.
"Cannot change root of post-dominator tree");
DFSInfoValid = false;
DomTreeNodeBase<NodeT> *NewNode = (DomTreeNodes[BB] =
- llvm::make_unique<DomTreeNodeBase<NodeT>>(BB, nullptr)).get();
+ std::make_unique<DomTreeNodeBase<NodeT>>(BB, nullptr)).get();
if (Roots.empty()) {
addRoot(BB);
} else {
// Add a new tree node for this NodeT, and link it as a child of
// IDomNode
return (DT.DomTreeNodes[BB] = IDomNode->addChild(
- llvm::make_unique<DomTreeNodeBase<NodeT>>(BB, IDomNode)))
+ std::make_unique<DomTreeNodeBase<NodeT>>(BB, IDomNode)))
.get();
}
NodePtr Root = IsPostDom ? nullptr : DT.Roots[0];
DT.RootNode = (DT.DomTreeNodes[Root] =
- llvm::make_unique<DomTreeNodeBase<NodeT>>(Root, nullptr))
+ std::make_unique<DomTreeNodeBase<NodeT>>(Root, nullptr))
.get();
SNCA.attachNewSubtree(DT, DT.RootNode);
}
// Add a new tree node for this BasicBlock, and link it as a child of
// IDomNode.
DT.DomTreeNodes[W] = IDomNode->addChild(
- llvm::make_unique<DomTreeNodeBase<NodeT>>(W, IDomNode));
+ std::make_unique<DomTreeNodeBase<NodeT>>(W, IDomNode));
}
}
TreeNodePtr VirtualRoot = DT.getNode(nullptr);
FromTN =
(DT.DomTreeNodes[From] = VirtualRoot->addChild(
- llvm::make_unique<DomTreeNodeBase<NodeT>>(From, VirtualRoot)))
+ std::make_unique<DomTreeNodeBase<NodeT>>(From, VirtualRoot)))
.get();
DT.Roots.push_back(From);
}
entry Entry;
node Node;
- static std::unique_ptr<T> CtorFn() { return make_unique<V>(); }
+ static std::unique_ptr<T> CtorFn() { return std::make_unique<V>(); }
public:
Add(StringRef Name, StringRef Desc)
// Ok, build a new cache by scanning the function, insert it and the value
// handle into our map, and return the newly populated cache.
auto IP = AssumptionCaches.insert(std::make_pair(
- FunctionCallbackVH(&F, this), llvm::make_unique<AssumptionCache>(F)));
+ FunctionCallbackVH(&F, this), std::make_unique<AssumptionCache>(F)));
assert(IP.second && "Scanning function already in the map?");
return *IP.first->second;
}
CallGraph::CallGraph(Module &M)
: M(M), ExternalCallingNode(getOrInsertFunction(nullptr)),
- CallsExternalNode(llvm::make_unique<CallGraphNode>(nullptr)) {
+ CallsExternalNode(std::make_unique<CallGraphNode>(nullptr)) {
// Add every function to the call graph.
for (Function &F : M)
addToCallGraph(&F);
return CGN.get();
assert((!F || F->getParent() == &M) && "Function not in current module!");
- CGN = llvm::make_unique<CallGraphNode>(const_cast<Function *>(F));
+ CGN = std::make_unique<CallGraphNode>(const_cast<Function *>(F));
return CGN.get();
}
LoopIndependent(PossiblyLoopIndependent) {
Consistent = true;
if (CommonLevels)
- DV = make_unique<DVEntry[]>(CommonLevels);
+ DV = std::make_unique<DVEntry[]>(CommonLevels);
}
// The rest are simple getters that hide the implementation.
if (!isLoadOrStore(Src) || !isLoadOrStore(Dst)) {
// can only analyze simple loads and stores, i.e., no calls, invokes, etc.
LLVM_DEBUG(dbgs() << "can only handle simple loads and stores\n");
- return make_unique<Dependence>(Src, Dst);
+ return std::make_unique<Dependence>(Src, Dst);
}
assert(isLoadOrStore(Src) && "instruction is not load or store");
case PartialAlias:
// cannot analyse objects if we don't understand their aliasing.
LLVM_DEBUG(dbgs() << "can't analyze may or partial alias\n");
- return make_unique<Dependence>(Src, Dst);
+ return std::make_unique<Dependence>(Src, Dst);
case NoAlias:
// If the objects noalias, they are distinct, accesses are independent.
LLVM_DEBUG(dbgs() << "no alias\n");
return nullptr;
}
- return make_unique<FullDependence>(std::move(Result));
+ return std::make_unique<FullDependence>(std::move(Result));
}
"call callsite"));
ICallPromotionAnalysis::ICallPromotionAnalysis() {
- ValueDataArray = llvm::make_unique<InstrProfValueData[]>(MaxNumPromotions);
+ ValueDataArray = std::make_unique<InstrProfValueData[]>(MaxNumPromotions);
}
bool ICallPromotionAnalysis::isPromotionProfitable(uint64_t Count,
bool LazyBranchProbabilityInfoPass::runOnFunction(Function &F) {
LoopInfo &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
TargetLibraryInfo &TLI = getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
- LBPI = llvm::make_unique<LazyBranchProbabilityInfo>(&F, &LI, &TLI);
+ LBPI = std::make_unique<LazyBranchProbabilityInfo>(&F, &LI, &TLI);
return false;
}
else {
auto It = ValueCache.find_as(Val);
if (It == ValueCache.end()) {
- ValueCache[Val] = make_unique<ValueCacheEntryTy>(Val, this);
+ ValueCache[Val] = std::make_unique<ValueCacheEntryTy>(Val, this);
It = ValueCache.find_as(Val);
assert(It != ValueCache.end() && "Val was just added to the map!");
}
if (shouldUseGPUDivergenceAnalysis(F)) {
// run the new GPU divergence analysis
auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
- gpuDA = llvm::make_unique<GPUDivergenceAnalysis>(F, DT, PDT, LI, TTI);
+ gpuDA = std::make_unique<GPUDivergenceAnalysis>(F, DT, PDT, LI, TTI);
} else {
// run LLVM's existing DivergenceAnalysis
DL = I->getDebugLoc();
}
- Report = make_unique<OptimizationRemarkAnalysis>(DEBUG_TYPE, RemarkName, DL,
+ Report = std::make_unique<OptimizationRemarkAnalysis>(DEBUG_TYPE, RemarkName, DL,
CodeRegion);
return *Report;
}
LoopAccessInfo::LoopAccessInfo(Loop *L, ScalarEvolution *SE,
const TargetLibraryInfo *TLI, AliasAnalysis *AA,
DominatorTree *DT, LoopInfo *LI)
- : PSE(llvm::make_unique<PredicatedScalarEvolution>(*SE, *L)),
- PtrRtChecking(llvm::make_unique<RuntimePointerChecking>(SE)),
- DepChecker(llvm::make_unique<MemoryDepChecker>(*PSE, L)), TheLoop(L),
+ : PSE(std::make_unique<PredicatedScalarEvolution>(*SE, *L)),
+ PtrRtChecking(std::make_unique<RuntimePointerChecking>(SE)),
+ DepChecker(std::make_unique<MemoryDepChecker>(*PSE, L)), TheLoop(L),
NumLoads(0), NumStores(0), MaxSafeDepDistBytes(-1), CanVecMem(false),
HasConvergentOp(false),
HasDependenceInvolvingLoopInvariantAddress(false) {
auto &LAI = LoopAccessInfoMap[L];
if (!LAI)
- LAI = llvm::make_unique<LoopAccessInfo>(L, SE, TLI, AA, DT, LI);
+ LAI = std::make_unique<LoopAccessInfo>(L, SE, TLI, AA, DT, LI);
return *LAI.get();
}
return nullptr;
}
- return make_unique<CacheCost>(Loops, AR.LI, AR.SE, AR.TTI, AR.AA, DI, TRT);
+ return std::make_unique<CacheCost>(Loops, AR.LI, AR.SE, AR.TTI, AR.AA, DI, TRT);
}
void CacheCost::calculateCacheFootprint() {
auto Res = PerBlockAccesses.insert(std::make_pair(BB, nullptr));
if (Res.second)
- Res.first->second = llvm::make_unique<AccessList>();
+ Res.first->second = std::make_unique<AccessList>();
return Res.first->second.get();
}
auto Res = PerBlockDefs.insert(std::make_pair(BB, nullptr));
if (Res.second)
- Res.first->second = llvm::make_unique<DefsList>();
+ Res.first->second = std::make_unique<DefsList>();
return Res.first->second.get();
}
if (!WalkerBase)
WalkerBase =
- llvm::make_unique<ClobberWalkerBase<AliasAnalysis>>(this, AA, DT);
+ std::make_unique<ClobberWalkerBase<AliasAnalysis>>(this, AA, DT);
Walker =
- llvm::make_unique<CachingWalker<AliasAnalysis>>(this, WalkerBase.get());
+ std::make_unique<CachingWalker<AliasAnalysis>>(this, WalkerBase.get());
return Walker.get();
}
if (!WalkerBase)
WalkerBase =
- llvm::make_unique<ClobberWalkerBase<AliasAnalysis>>(this, AA, DT);
+ std::make_unique<ClobberWalkerBase<AliasAnalysis>>(this, AA, DT);
SkipWalker =
- llvm::make_unique<SkipSelfWalker<AliasAnalysis>>(this, WalkerBase.get());
+ std::make_unique<SkipSelfWalker<AliasAnalysis>>(this, WalkerBase.get());
return SkipWalker.get();
}
FunctionAnalysisManager &AM) {
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &AA = AM.getResult<AAManager>(F);
- return MemorySSAAnalysis::Result(llvm::make_unique<MemorySSA>(F, &AA, &DT));
+ return MemorySSAAnalysis::Result(std::make_unique<MemorySSA>(F, &AA, &DT));
}
bool MemorySSAAnalysis::Result::invalidate(
// FIXME: refactor this to use the same code that inliner is using.
// Don't try to import functions with noinline attribute.
F.getAttributes().hasFnAttribute(Attribute::NoInline)};
- auto FuncSummary = llvm::make_unique<FunctionSummary>(
+ auto FuncSummary = std::make_unique<FunctionSummary>(
Flags, NumInsts, FunFlags, /*EntryCount=*/0, std::move(Refs),
CallGraphEdges.takeVector(), TypeTests.takeVector(),
TypeTestAssumeVCalls.takeVector(), TypeCheckedLoadVCalls.takeVector(),
!V.hasComdat() && !V.hasAppendingLinkage() && !V.isInterposable() &&
!V.hasAvailableExternallyLinkage() && !V.hasDLLExportStorageClass();
GlobalVarSummary::GVarFlags VarFlags(CanBeInternalized, CanBeInternalized);
- auto GVarSummary = llvm::make_unique<GlobalVarSummary>(Flags, VarFlags,
+ auto GVarSummary = std::make_unique<GlobalVarSummary>(Flags, VarFlags,
RefEdges.takeVector());
if (NonRenamableLocal)
CantBePromoted.insert(V.getGUID());
GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal,
/* Live = */ false, A.isDSOLocal(),
A.hasLinkOnceODRLinkage() && A.hasGlobalUnnamedAddr());
- auto AS = llvm::make_unique<AliasSummary>(Flags);
+ auto AS = std::make_unique<AliasSummary>(Flags);
auto *Aliasee = A.getBaseObject();
auto AliaseeVI = Index.getValueInfo(Aliasee->getGUID());
assert(AliaseeVI && "Alias expects aliasee summary to be available");
// Create the appropriate summary type.
if (Function *F = dyn_cast<Function>(GV)) {
std::unique_ptr<FunctionSummary> Summary =
- llvm::make_unique<FunctionSummary>(
+ std::make_unique<FunctionSummary>(
GVFlags, /*InstCount=*/0,
FunctionSummary::FFlags{
F->hasFnAttribute(Attribute::ReadNone),
Index.addGlobalValueSummary(*GV, std::move(Summary));
} else {
std::unique_ptr<GlobalVarSummary> Summary =
- llvm::make_unique<GlobalVarSummary>(
+ std::make_unique<GlobalVarSummary>(
GVFlags, GlobalVarSummary::GVarFlags(false, false),
ArrayRef<ValueInfo>{});
Index.addGlobalValueSummary(*GV, std::move(Summary));
else if (F.hasProfileData()) {
LoopInfo LI{DT};
BranchProbabilityInfo BPI{F, LI};
- BFIPtr = llvm::make_unique<BlockFrequencyInfo>(F, BPI, LI);
+ BFIPtr = std::make_unique<BlockFrequencyInfo>(F, BPI, LI);
BFI = BFIPtr.get();
}
BPI.calculate(*F, LI);
// Finally compute BFI.
- OwnedBFI = llvm::make_unique<BlockFrequencyInfo>(*F, BPI, LI);
+ OwnedBFI = std::make_unique<BlockFrequencyInfo>(*F, BPI, LI);
BFI = OwnedBFI.get();
}
else
BFI = nullptr;
- ORE = llvm::make_unique<OptimizationRemarkEmitter>(&Fn, BFI);
+ ORE = std::make_unique<OptimizationRemarkEmitter>(&Fn, BFI);
return false;
}
const BasicBlock *IBB = InstA->getParent();
auto OBB = OBBMap.find(IBB);
if (OBB == OBBMap.end())
- OBB = OBBMap.insert({IBB, make_unique<OrderedBasicBlock>(IBB)}).first;
+ OBB = OBBMap.insert({IBB, std::make_unique<OrderedBasicBlock>(IBB)}).first;
return OBB->second->dominates(InstA, InstB);
}
ParseToken(lltok::rbrace, "expected end of struct constant"))
return true;
- ID.ConstantStructElts = make_unique<Constant *[]>(Elts.size());
+ ID.ConstantStructElts = std::make_unique<Constant *[]>(Elts.size());
ID.UIntVal = Elts.size();
memcpy(ID.ConstantStructElts.get(), Elts.data(),
Elts.size() * sizeof(Elts[0]));
return true;
if (isPackedStruct) {
- ID.ConstantStructElts = make_unique<Constant *[]>(Elts.size());
+ ID.ConstantStructElts = std::make_unique<Constant *[]>(Elts.size());
memcpy(ID.ConstantStructElts.get(), Elts.data(),
Elts.size() * sizeof(Elts[0]));
ID.UIntVal = Elts.size();
if (ParseToken(lltok::rparen, "expected ')' here"))
return true;
- auto FS = llvm::make_unique<FunctionSummary>(
+ auto FS = std::make_unique<FunctionSummary>(
GVFlags, InstCount, FFlags, /*EntryCount=*/0, std::move(Refs),
std::move(Calls), std::move(TypeIdInfo.TypeTests),
std::move(TypeIdInfo.TypeTestAssumeVCalls),
return true;
auto GS =
- llvm::make_unique<GlobalVarSummary>(GVFlags, GVarFlags, std::move(Refs));
+ std::make_unique<GlobalVarSummary>(GVFlags, GVarFlags, std::move(Refs));
GS->setModulePath(ModulePath);
GS->setVTableFuncs(std::move(VTableFuncs));
if (ParseToken(lltok::rparen, "expected ')' here"))
return true;
- auto AS = llvm::make_unique<AliasSummary>(GVFlags);
+ auto AS = std::make_unique<AliasSummary>(GVFlags);
AS->setModulePath(ModulePath);
SlotMapping *Slots, bool UpgradeDebugInfo,
StringRef DataLayoutString) {
std::unique_ptr<Module> M =
- make_unique<Module>(F.getBufferIdentifier(), Context);
+ std::make_unique<Module>(F.getBufferIdentifier(), Context);
if (parseAssemblyInto(F, M.get(), nullptr, Err, Slots, UpgradeDebugInfo,
DataLayoutString))
MemoryBufferRef F, SMDiagnostic &Err, LLVMContext &Context,
SlotMapping *Slots, bool UpgradeDebugInfo, StringRef DataLayoutString) {
std::unique_ptr<Module> M =
- make_unique<Module>(F.getBufferIdentifier(), Context);
+ std::make_unique<Module>(F.getBufferIdentifier(), Context);
std::unique_ptr<ModuleSummaryIndex> Index =
- make_unique<ModuleSummaryIndex>(/*HaveGVs=*/true);
+ std::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/true);
if (parseAssemblyInto(F, M.get(), Index.get(), Err, Slots, UpgradeDebugInfo,
DataLayoutString))
std::unique_ptr<ModuleSummaryIndex>
llvm::parseSummaryIndexAssembly(MemoryBufferRef F, SMDiagnostic &Err) {
std::unique_ptr<ModuleSummaryIndex> Index =
- make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false);
+ std::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false);
if (parseSummaryIndexAssemblyInto(F, *Index, Err))
return nullptr;
ArrayRef<uint64_t>(Record).slice(CallGraphEdgeStartIndex),
IsOldProfileFormat, HasProfile, HasRelBF);
setSpecialRefs(Refs, NumRORefs, NumWORefs);
- auto FS = llvm::make_unique<FunctionSummary>(
+ auto FS = std::make_unique<FunctionSummary>(
Flags, InstCount, getDecodedFFlags(RawFunFlags), /*EntryCount=*/0,
std::move(Refs), std::move(Calls), std::move(PendingTypeTests),
std::move(PendingTypeTestAssumeVCalls),
uint64_t RawFlags = Record[1];
unsigned AliaseeID = Record[2];
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
- auto AS = llvm::make_unique<AliasSummary>(Flags);
+ auto AS = std::make_unique<AliasSummary>(Flags);
// The module path string ref set in the summary must be owned by the
// index's module string table. Since we don't have a module path
// string table section in the per-module index, we create a single
std::vector<ValueInfo> Refs =
makeRefList(ArrayRef<uint64_t>(Record).slice(RefArrayStart));
auto FS =
- llvm::make_unique<GlobalVarSummary>(Flags, GVF, std::move(Refs));
+ std::make_unique<GlobalVarSummary>(Flags, GVF, std::move(Refs));
FS->setModulePath(getThisModule()->first());
auto GUID = getValueInfoFromValueId(ValueID);
FS->setOriginalName(GUID.second);
VTableFuncs.push_back({Callee, Offset});
}
auto VS =
- llvm::make_unique<GlobalVarSummary>(Flags, GVF, std::move(Refs));
+ std::make_unique<GlobalVarSummary>(Flags, GVF, std::move(Refs));
VS->setModulePath(getThisModule()->first());
VS->setVTableFuncs(VTableFuncs);
auto GUID = getValueInfoFromValueId(ValueID);
IsOldProfileFormat, HasProfile, false);
ValueInfo VI = getValueInfoFromValueId(ValueID).first;
setSpecialRefs(Refs, NumRORefs, NumWORefs);
- auto FS = llvm::make_unique<FunctionSummary>(
+ auto FS = std::make_unique<FunctionSummary>(
Flags, InstCount, getDecodedFFlags(RawFunFlags), EntryCount,
std::move(Refs), std::move(Edges), std::move(PendingTypeTests),
std::move(PendingTypeTestAssumeVCalls),
uint64_t RawFlags = Record[2];
unsigned AliaseeValueId = Record[3];
auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
- auto AS = llvm::make_unique<AliasSummary>(Flags);
+ auto AS = std::make_unique<AliasSummary>(Flags);
LastSeenSummary = AS.get();
AS->setModulePath(ModuleIdMap[ModuleId]);
std::vector<ValueInfo> Refs =
makeRefList(ArrayRef<uint64_t>(Record).slice(RefArrayStart));
auto FS =
- llvm::make_unique<GlobalVarSummary>(Flags, GVF, std::move(Refs));
+ std::make_unique<GlobalVarSummary>(Flags, GVF, std::move(Refs));
LastSeenSummary = FS.get();
FS->setModulePath(ModuleIdMap[ModuleId]);
ValueInfo VI = getValueInfoFromValueId(ValueID).first;
Context);
std::unique_ptr<Module> M =
- llvm::make_unique<Module>(ModuleIdentifier, Context);
+ std::make_unique<Module>(ModuleIdentifier, Context);
M->setMaterializer(R);
// Delay parsing Metadata if ShouldLazyLoadMetadata is true.
if (Error JumpFailed = Stream.JumpToBit(ModuleBit))
return std::move(JumpFailed);
- auto Index = llvm::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false);
+ auto Index = std::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false);
ModuleSummaryIndexBitcodeReader R(std::move(Stream), Strtab, *Index,
ModuleIdentifier, 0);
BitcodeReaderValueList &ValueList,
bool IsImporting,
std::function<Type *(unsigned)> getTypeByID)
- : Pimpl(llvm::make_unique<MetadataLoaderImpl>(
+ : Pimpl(std::make_unique<MetadataLoaderImpl>(
Stream, TheModule, ValueList, std::move(getTypeByID), IsImporting)) {}
Error MetadataLoader::parseMetadata(bool ModuleLevel) {
if (MAI->doesSupportDebugInformation()) {
bool EmitCodeView = MMI->getModule()->getCodeViewFlag();
if (EmitCodeView && TM.getTargetTriple().isOSWindows()) {
- Handlers.emplace_back(llvm::make_unique<CodeViewDebug>(this),
+ Handlers.emplace_back(std::make_unique<CodeViewDebug>(this),
DbgTimerName, DbgTimerDescription,
CodeViewLineTablesGroupName,
CodeViewLineTablesGroupDescription);
if (mdconst::extract_or_null<ConstantInt>(
MMI->getModule()->getModuleFlag("cfguardtable")))
- Handlers.emplace_back(llvm::make_unique<WinCFGuard>(this), CFGuardName,
+ Handlers.emplace_back(std::make_unique<WinCFGuard>(this), CFGuardName,
CFGuardDescription, DWARFGroupName,
DWARFGroupDescription);
// Get MachineDominatorTree or compute it on the fly if it's unavailable
MDT = getAnalysisIfAvailable<MachineDominatorTree>();
if (!MDT) {
- OwnedMDT = make_unique<MachineDominatorTree>();
+ OwnedMDT = std::make_unique<MachineDominatorTree>();
OwnedMDT->getBase().recalculate(*MF);
MDT = OwnedMDT.get();
}
// Get MachineLoopInfo or compute it on the fly if it's unavailable
MLI = getAnalysisIfAvailable<MachineLoopInfo>();
if (!MLI) {
- OwnedMLI = make_unique<MachineLoopInfo>();
+ OwnedMLI = std::make_unique<MachineLoopInfo>();
OwnedMLI->getBase().analyze(MDT->getBase());
MLI = OwnedMLI.get();
}
unsigned AsmPrinter::addInlineAsmDiagBuffer(StringRef AsmStr,
const MDNode *LocMDNode) const {
if (!DiagInfo) {
- DiagInfo = make_unique<SrcMgrDiagInfo>();
+ DiagInfo = std::make_unique<SrcMgrDiagInfo>();
MCContext &Context = MMI->getContext();
Context.setInlineSourceManager(&DiagInfo->SrcMgr);
if (OS.isVerboseAsm()) {
// To construct block comment describing the type record for readability.
- SP = llvm::make_unique<ScopedPrinter>(CommentOS);
+ SP = std::make_unique<ScopedPrinter>(CommentOS);
SP->setPrefix(CommentPrefix);
- TDV = llvm::make_unique<TypeDumpVisitor>(Table, SP.get(), false);
+ TDV = std::make_unique<TypeDumpVisitor>(Table, SP.get(), false);
Pipeline.addCallbackToPipeline(*TDV);
}
const TargetRegisterInfo *TRI = TSI.getRegisterInfo();
const MachineFrameInfo &MFI = MF->getFrameInfo();
const Function &GV = MF->getFunction();
- auto Insertion = FnDebugInfo.insert({&GV, llvm::make_unique<FunctionInfo>()});
+ auto Insertion = FnDebugInfo.insert({&GV, std::make_unique<FunctionInfo>()});
assert(Insertion.second && "function already has info");
CurFn = Insertion.first->second.get();
CurFn->FuncId = NextFuncId++;
auto Insertion = ScopeGlobals.insert(
{Scope, std::unique_ptr<GlobalVariableList>()});
if (Insertion.second)
- Insertion.first->second = llvm::make_unique<GlobalVariableList>();
+ Insertion.first->second = std::make_unique<GlobalVariableList>();
VariableList = Insertion.first->second.get();
} else if (GV->hasComdat())
// Emit this global variable into a COMDAT section.
if (!Loc) {
addToAccelTable = true;
Loc = new (DIEValueAllocator) DIELoc;
- DwarfExpr = llvm::make_unique<DIEDwarfExpression>(*Asm, *this, *Loc);
+ DwarfExpr = std::make_unique<DIEDwarfExpression>(*Asm, *this, *Loc);
}
if (Expr) {
assert(Scope && Scope->isAbstractScope());
auto &Entity = getAbstractEntities()[Node];
if (isa<const DILocalVariable>(Node)) {
- Entity = llvm::make_unique<DbgVariable>(
+ Entity = std::make_unique<DbgVariable>(
cast<const DILocalVariable>(Node), nullptr /* IA */);;
DU->addScopeVariable(Scope, cast<DbgVariable>(Entity.get()));
} else if (isa<const DILabel>(Node)) {
- Entity = llvm::make_unique<DbgLabel>(
+ Entity = std::make_unique<DbgLabel>(
cast<const DILabel>(Node), nullptr /* IA */);
DU->addScopeLabel(Scope, cast<DbgLabel>(Entity.get()));
}
assert(getInlinedAt() == DbgValue->getDebugLoc()->getInlinedAt() &&
"Wrong inlined-at");
- ValueLoc = llvm::make_unique<DbgValueLoc>(getDebugLocValue(DbgValue));
+ ValueLoc = std::make_unique<DbgValueLoc>(getDebugLocValue(DbgValue));
if (auto *E = DbgValue->getDebugExpression())
if (E->getNumElements())
FrameIndexExprs.push_back({0, E});
CompilationDir = DIUnit->getDirectory();
- auto OwnedUnit = llvm::make_unique<DwarfCompileUnit>(
+ auto OwnedUnit = std::make_unique<DwarfCompileUnit>(
InfoHolder.getUnits().size(), DIUnit, Asm, this, &InfoHolder);
DwarfCompileUnit &NewCU = *OwnedUnit;
InfoHolder.addUnit(std::move(OwnedUnit));
continue;
ensureAbstractEntityIsCreatedIfScoped(TheCU, Var.first, Scope->getScopeNode());
- auto RegVar = llvm::make_unique<DbgVariable>(
+ auto RegVar = std::make_unique<DbgVariable>(
cast<DILocalVariable>(Var.first), Var.second);
RegVar->initializeMMI(VI.Expr, VI.Slot);
if (DbgVariable *DbgVar = MFVars.lookup(Var))
ensureAbstractEntityIsCreatedIfScoped(TheCU, Node, Scope.getScopeNode());
if (isa<const DILocalVariable>(Node)) {
ConcreteEntities.push_back(
- llvm::make_unique<DbgVariable>(cast<const DILocalVariable>(Node),
+ std::make_unique<DbgVariable>(cast<const DILocalVariable>(Node),
Location));
InfoHolder.addScopeVariable(&Scope,
cast<DbgVariable>(ConcreteEntities.back().get()));
} else if (isa<const DILabel>(Node)) {
ConcreteEntities.push_back(
- llvm::make_unique<DbgLabel>(cast<const DILabel>(Node),
+ std::make_unique<DbgLabel>(cast<const DILabel>(Node),
Location, Sym));
InfoHolder.addScopeLabel(&Scope,
cast<DbgLabel>(ConcreteEntities.back().get()));
DwarfCompileUnit &DwarfDebug::constructSkeletonCU(const DwarfCompileUnit &CU) {
- auto OwnedUnit = llvm::make_unique<DwarfCompileUnit>(
+ auto OwnedUnit = std::make_unique<DwarfCompileUnit>(
CU.getUniqueID(), CU.getCUNode(), Asm, this, &SkeletonHolder);
DwarfCompileUnit &NewCU = *OwnedUnit;
NewCU.setSection(Asm->getObjFileLowering().getDwarfInfoSection());
bool TopLevelType = TypeUnitsUnderConstruction.empty();
AddrPool.resetUsedFlag();
- auto OwnedUnit = llvm::make_unique<DwarfTypeUnit>(CU, Asm, this, &InfoHolder,
+ auto OwnedUnit = std::make_unique<DwarfTypeUnit>(CU, Asm, this, &InfoHolder,
getDwoLineTable(CU));
DwarfTypeUnit &NewTU = *OwnedUnit;
DIE &UnitDie = NewTU.getUnitDie();
assert(!ValueLoc && "Already initialized?");
assert(!Value.getExpression()->isFragment() && "Fragments not supported.");
- ValueLoc = llvm::make_unique<DbgValueLoc>(Value);
+ ValueLoc = std::make_unique<DbgValueLoc>(Value);
if (auto *E = ValueLoc->getExpression())
if (E->getNumElements())
FrameIndexExprs.push_back({0, E});
// Get the DominatorTree, building if necessary.
DominatorTree &getDT(Function &F) {
if (!DT)
- DT = llvm::make_unique<DominatorTree>(F);
+ DT = std::make_unique<DominatorTree>(F);
return *DT;
}
void TypePromotionTransaction::setOperand(Instruction *Inst, unsigned Idx,
Value *NewVal) {
- Actions.push_back(llvm::make_unique<TypePromotionTransaction::OperandSetter>(
+ Actions.push_back(std::make_unique<TypePromotionTransaction::OperandSetter>(
Inst, Idx, NewVal));
}
void TypePromotionTransaction::eraseInstruction(Instruction *Inst,
Value *NewVal) {
Actions.push_back(
- llvm::make_unique<TypePromotionTransaction::InstructionRemover>(
+ std::make_unique<TypePromotionTransaction::InstructionRemover>(
Inst, RemovedInsts, NewVal));
}
void TypePromotionTransaction::replaceAllUsesWith(Instruction *Inst,
Value *New) {
Actions.push_back(
- llvm::make_unique<TypePromotionTransaction::UsesReplacer>(Inst, New));
+ std::make_unique<TypePromotionTransaction::UsesReplacer>(Inst, New));
}
void TypePromotionTransaction::mutateType(Instruction *Inst, Type *NewTy) {
Actions.push_back(
- llvm::make_unique<TypePromotionTransaction::TypeMutator>(Inst, NewTy));
+ std::make_unique<TypePromotionTransaction::TypeMutator>(Inst, NewTy));
}
Value *TypePromotionTransaction::createTrunc(Instruction *Opnd,
void TypePromotionTransaction::moveBefore(Instruction *Inst,
Instruction *Before) {
Actions.push_back(
- llvm::make_unique<TypePromotionTransaction::InstructionMoveBefore>(
+ std::make_unique<TypePromotionTransaction::InstructionMoveBefore>(
Inst, Before));
}
return *I->second;
GCStrategy *S = getGCStrategy(F.getGC());
- Functions.push_back(llvm::make_unique<GCFunctionInfo>(F, *S));
+ Functions.push_back(std::make_unique<GCFunctionInfo>(F, *S));
GCFunctionInfo *GFI = Functions.back().get();
FInfoMap[&F] = GFI;
return *GFI;
llvm::getStandardCSEConfigForOpt(CodeGenOpt::Level Level) {
std::unique_ptr<CSEConfigBase> Config;
if (Level == CodeGenOpt::None)
- Config = make_unique<CSEConfigConstantOnly>();
+ Config = std::make_unique<CSEConfigConstantOnly>();
else
- Config = make_unique<CSEConfigFull>();
+ Config = std::make_unique<CSEConfigFull>();
return Config;
}
return false;
Builder =
- CSEInfo ? make_unique<CSEMIRBuilder>() : make_unique<MachineIRBuilder>();
+ CSEInfo ? std::make_unique<CSEMIRBuilder>() : std::make_unique<MachineIRBuilder>();
MRI = &MF.getRegInfo();
Builder->setMF(MF);
if (CSEInfo)
: TPC->isGISelCSEEnabled();
if (EnableCSE) {
- EntryBuilder = make_unique<CSEMIRBuilder>(CurMF);
+ EntryBuilder = std::make_unique<CSEMIRBuilder>(CurMF);
CSEInfo = &Wrapper.get(TPC->getCSEConfig());
EntryBuilder->setCSEInfo(CSEInfo);
- CurBuilder = make_unique<CSEMIRBuilder>(CurMF);
+ CurBuilder = std::make_unique<CSEMIRBuilder>(CurMF);
CurBuilder->setCSEInfo(CSEInfo);
} else {
- EntryBuilder = make_unique<MachineIRBuilder>();
- CurBuilder = make_unique<MachineIRBuilder>();
+ EntryBuilder = std::make_unique<MachineIRBuilder>();
+ CurBuilder = std::make_unique<MachineIRBuilder>();
}
CLI = MF->getSubtarget().getCallLowering();
CurBuilder->setMF(*MF);
EntryBuilder->setMF(*MF);
MRI = &MF->getRegInfo();
DL = &F.getParent()->getDataLayout();
- ORE = llvm::make_unique<OptimizationRemarkEmitter>(&F);
+ ORE = std::make_unique<OptimizationRemarkEmitter>(&F);
FuncInfo.MF = MF;
FuncInfo.BPI = nullptr;
const auto &TLI = *MF->getSubtarget().getTargetLowering();
const TargetMachine &TM = MF->getTarget();
- SL = make_unique<GISelSwitchLowering>(this, FuncInfo);
+ SL = std::make_unique<GISelSwitchLowering>(this, FuncInfo);
SL->init(TLI, TM, *DL);
EnableOpts = TM.getOptLevel() != CodeGenOpt::None && !skipFunction(F);
: TPC.isGISelCSEEnabled();
if (EnableCSE) {
- MIRBuilder = make_unique<CSEMIRBuilder>();
+ MIRBuilder = std::make_unique<CSEMIRBuilder>();
CSEInfo = &Wrapper.get(TPC.getCSEConfig());
MIRBuilder->setCSEInfo(CSEInfo);
} else
- MIRBuilder = make_unique<MachineIRBuilder>();
+ MIRBuilder = std::make_unique<MachineIRBuilder>();
// This observer keeps the worklist updated.
LegalizerWorkListManager WorkListObserver(InstList, ArtifactList);
// We want both WorkListObserver as well as CSEInfo to observe all changes.
MBPI = nullptr;
}
MIRBuilder.setMF(MF);
- MORE = llvm::make_unique<MachineOptimizationRemarkEmitter>(MF, MBFI);
+ MORE = std::make_unique<MachineOptimizationRemarkEmitter>(MF, MBFI);
}
void RegBankSelect::getAnalysisUsage(AnalysisUsage &AU) const {
++NumPartialMappingsCreated;
auto &PartMapping = MapOfPartialMappings[Hash];
- PartMapping = llvm::make_unique<PartialMapping>(StartIdx, Length, RegBank);
+ PartMapping = std::make_unique<PartialMapping>(StartIdx, Length, RegBank);
return *PartMapping;
}
++NumValueMappingsCreated;
auto &ValMapping = MapOfValueMappings[Hash];
- ValMapping = llvm::make_unique<ValueMapping>(BreakDown, NumBreakDowns);
+ ValMapping = std::make_unique<ValueMapping>(BreakDown, NumBreakDowns);
return *ValMapping;
}
// mapping, because we use the pointer of the ValueMapping
// to hash and we expect them to uniquely identify an instance
// of value mapping.
- Res = llvm::make_unique<ValueMapping[]>(std::distance(Begin, End));
+ Res = std::make_unique<ValueMapping[]>(std::distance(Begin, End));
unsigned Idx = 0;
for (Iterator It = Begin; It != End; ++It, ++Idx) {
const ValueMapping *ValMap = *It;
++NumInstructionMappingsCreated;
auto &InstrMapping = MapOfInstructionMappings[Hash];
- InstrMapping = llvm::make_unique<InstructionMapping>(
+ InstrMapping = std::make_unique<InstructionMapping>(
ID, Cost, OperandsMapping, NumOperands);
return *InstrMapping;
}
// \ /
// TailBB
// Note TailBB can be empty.
- Tokens.push_back(llvm::make_unique<IfcvtToken>(
+ Tokens.push_back(std::make_unique<IfcvtToken>(
BBI, ICDiamond, TNeedSub | FNeedSub, Dups, Dups2,
(bool) TrueBBICalc.ClobbersPred, (bool) FalseBBICalc.ClobbersPred));
Enqueued = true;
// / \ / \
// FalseBB TrueBB FalseBB
//
- Tokens.push_back(llvm::make_unique<IfcvtToken>(
+ Tokens.push_back(std::make_unique<IfcvtToken>(
BBI, ICForkedDiamond, TNeedSub | FNeedSub, Dups, Dups2,
(bool) TrueBBICalc.ClobbersPred, (bool) FalseBBICalc.ClobbersPred));
Enqueued = true;
// | /
// FBB
Tokens.push_back(
- llvm::make_unique<IfcvtToken>(BBI, ICTriangle, TNeedSub, Dups));
+ std::make_unique<IfcvtToken>(BBI, ICTriangle, TNeedSub, Dups));
Enqueued = true;
}
TrueBBI.ExtraCost2, Prediction) &&
FeasibilityAnalysis(TrueBBI, BBI.BrCond, true, true)) {
Tokens.push_back(
- llvm::make_unique<IfcvtToken>(BBI, ICTriangleRev, TNeedSub, Dups));
+ std::make_unique<IfcvtToken>(BBI, ICTriangleRev, TNeedSub, Dups));
Enqueued = true;
}
// |
// FBB
Tokens.push_back(
- llvm::make_unique<IfcvtToken>(BBI, ICSimple, TNeedSub, Dups));
+ std::make_unique<IfcvtToken>(BBI, ICSimple, TNeedSub, Dups));
Enqueued = true;
}
FalseBBI.NonPredSize + FalseBBI.ExtraCost,
FalseBBI.ExtraCost2, Prediction.getCompl()) &&
FeasibilityAnalysis(FalseBBI, RevCond, true)) {
- Tokens.push_back(llvm::make_unique<IfcvtToken>(BBI, ICTriangleFalse,
+ Tokens.push_back(std::make_unique<IfcvtToken>(BBI, ICTriangleFalse,
FNeedSub, Dups));
Enqueued = true;
}
FalseBBI.ExtraCost2, Prediction.getCompl()) &&
FeasibilityAnalysis(FalseBBI, RevCond, true, true)) {
Tokens.push_back(
- llvm::make_unique<IfcvtToken>(BBI, ICTriangleFRev, FNeedSub, Dups));
+ std::make_unique<IfcvtToken>(BBI, ICTriangleFRev, FNeedSub, Dups));
Enqueued = true;
}
FalseBBI.ExtraCost2, Prediction.getCompl()) &&
FeasibilityAnalysis(FalseBBI, RevCond)) {
Tokens.push_back(
- llvm::make_unique<IfcvtToken>(BBI, ICSimpleFalse, FNeedSub, Dups));
+ std::make_unique<IfcvtToken>(BBI, ICSimpleFalse, FNeedSub, Dups));
Enqueued = true;
}
}
// save a copy of LiveInterval in StackSlotToOrigLI because the original
// LiveInterval may be cleared after all its references are spilled.
if (StackSlotToOrigLI.find(StackSlot) == StackSlotToOrigLI.end()) {
- auto LI = llvm::make_unique<LiveInterval>(OrigLI.reg, OrigLI.weight);
+ auto LI = std::make_unique<LiveInterval>(OrigLI.reg, OrigLI.weight);
LI->assign(OrigLI, Allocator);
StackSlotToOrigLI[StackSlot] = std::move(LI);
}
std::unique_ptr<MCAsmBackend> MAB(
getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions));
- auto FOut = llvm::make_unique<formatted_raw_ostream>(Out);
+ auto FOut = std::make_unique<formatted_raw_ostream>(Out);
MCStreamer *S = getTarget().createAsmStreamer(
Context, std::move(FOut), Options.MCOptions.AsmVerbose,
Options.MCOptions.MCUseDwarfDirectory, InstPrinter, std::move(MCE),
if (!MDT) {
LLVM_DEBUG(dbgs() << "Building DominatorTree on the fly\n");
- OwnedMDT = make_unique<MachineDominatorTree>();
+ OwnedMDT = std::make_unique<MachineDominatorTree>();
OwnedMDT->getBase().recalculate(*MF);
MDT = OwnedMDT.get();
}
// Generate LoopInfo from it.
- OwnedMLI = make_unique<MachineLoopInfo>();
+ OwnedMLI = std::make_unique<MachineLoopInfo>();
OwnedMLI->getBase().analyze(MDT->getBase());
MLI = OwnedMLI.get();
}
- OwnedMBFI = make_unique<MachineBlockFrequencyInfo>();
+ OwnedMBFI = std::make_unique<MachineBlockFrequencyInfo>();
OwnedMBFI->calculate(*MF, MBPI, *MLI);
return *OwnedMBFI.get();
}
TII = MF.getSubtarget().getInstrInfo();
TFI = MF.getSubtarget().getFrameLowering();
TFI->determineCalleeSaves(MF, CalleeSavedRegs,
- make_unique<RegScavenger>().get());
+ std::make_unique<RegScavenger>().get());
LS.initialize(MF);
bool Changed = ExtendRanges(MF);
}
userValues.push_back(
- llvm::make_unique<UserValue>(Var, Expr, DL, allocator));
+ std::make_unique<UserValue>(Var, Expr, DL, allocator));
UserValue *UV = userValues.back().get();
Leader = UserValue::merge(Leader, UV);
return UV;
}
}
if (!Found)
- userLabels.push_back(llvm::make_unique<UserLabel>(Label, DL, Idx));
+ userLabels.push_back(std::make_unique<UserLabel>(Label, DL, Idx));
return true;
}
return nullptr;
// Create an empty module when the MIR file is empty.
NoMIRDocuments = true;
- return llvm::make_unique<Module>(Filename, Context);
+ return std::make_unique<Module>(Filename, Context);
}
std::unique_ptr<Module> M;
NoMIRDocuments = true;
} else {
// Create an new, empty module.
- M = llvm::make_unique<Module>(Filename, Context);
+ M = std::make_unique<Module>(Filename, Context);
NoLLVMIR = true;
}
return M;
"Can't read MIR with a Context that discards named Values")));
return nullptr;
}
- return llvm::make_unique<MIRParser>(
- llvm::make_unique<MIRParserImpl>(std::move(Contents), Filename, Context));
+ return std::make_unique<MIRParser>(
+ std::make_unique<MIRParserImpl>(std::move(Contents), Filename, Context));
}
F = &MF;
MBPI = &getAnalysis<MachineBranchProbabilityInfo>();
- MBFI = llvm::make_unique<BranchFolder::MBFIWrapper>(
+ MBFI = std::make_unique<BranchFolder::MBFIWrapper>(
getAnalysis<MachineBlockFrequencyInfo>());
MLI = &getAnalysis<MachineLoopInfo>();
TII = MF.getSubtarget().getInstrInfo();
"Target-incompatible DataLayout attached\n");
PSVManager =
- llvm::make_unique<PseudoSourceValueManager>(*(getSubtarget().
+ std::make_unique<PseudoSourceValueManager>(*(getSubtarget().
getInstrInfo()));
}
MFI = &MF->getFrameInfo();
Context = &MF->getFunction().getContext();
} else {
- CtxPtr = llvm::make_unique<LLVMContext>();
+ CtxPtr = std::make_unique<LLVMContext>();
Context = CtxPtr.get();
}
else
MBFI = nullptr;
- ORE = llvm::make_unique<MachineOptimizationRemarkEmitter>(MF, MBFI);
+ ORE = std::make_unique<MachineOptimizationRemarkEmitter>(MF, MBFI);
return false;
}
std::unique_ptr<ScheduleDAGMutation>
createLoadClusterDAGMutation(const TargetInstrInfo *TII,
const TargetRegisterInfo *TRI) {
- return EnableMemOpCluster ? llvm::make_unique<LoadClusterMutation>(TII, TRI)
+ return EnableMemOpCluster ? std::make_unique<LoadClusterMutation>(TII, TRI)
: nullptr;
}
std::unique_ptr<ScheduleDAGMutation>
createStoreClusterDAGMutation(const TargetInstrInfo *TII,
const TargetRegisterInfo *TRI) {
- return EnableMemOpCluster ? llvm::make_unique<StoreClusterMutation>(TII, TRI)
+ return EnableMemOpCluster ? std::make_unique<StoreClusterMutation>(TII, TRI)
: nullptr;
}
std::unique_ptr<ScheduleDAGMutation>
createCopyConstrainDAGMutation(const TargetInstrInfo *TII,
const TargetRegisterInfo *TRI) {
- return llvm::make_unique<CopyConstrain>(TII, TRI);
+ return std::make_unique<CopyConstrain>(TII, TRI);
}
} // end namespace llvm
/// default scheduler if the target does not set a default.
ScheduleDAGMILive *llvm::createGenericSchedLive(MachineSchedContext *C) {
ScheduleDAGMILive *DAG =
- new ScheduleDAGMILive(C, llvm::make_unique<GenericScheduler>(C));
+ new ScheduleDAGMILive(C, std::make_unique<GenericScheduler>(C));
// Register DAG post-processors.
//
// FIXME: extend the mutation API to allow earlier mutations to instantiate
}
ScheduleDAGMI *llvm::createGenericSchedPostRA(MachineSchedContext *C) {
- return new ScheduleDAGMI(C, llvm::make_unique<PostGenericScheduler>(C),
+ return new ScheduleDAGMI(C, std::make_unique<PostGenericScheduler>(C),
/*RemoveKillFlags=*/true);
}
} // end anonymous namespace
static ScheduleDAGInstrs *createILPMaxScheduler(MachineSchedContext *C) {
- return new ScheduleDAGMILive(C, llvm::make_unique<ILPScheduler>(true));
+ return new ScheduleDAGMILive(C, std::make_unique<ILPScheduler>(true));
}
static ScheduleDAGInstrs *createILPMinScheduler(MachineSchedContext *C) {
- return new ScheduleDAGMILive(C, llvm::make_unique<ILPScheduler>(false));
+ return new ScheduleDAGMILive(C, std::make_unique<ILPScheduler>(false));
}
static MachineSchedRegistry ILPMaxRegistry(
assert((TopDown || !ForceTopDown) &&
"-misched-topdown incompatible with -misched-bottomup");
return new ScheduleDAGMILive(
- C, llvm::make_unique<InstructionShuffler>(Alternate, TopDown));
+ C, std::make_unique<InstructionShuffler>(Alternate, TopDown));
}
static MachineSchedRegistry ShufflerRegistry(
llvm::createMacroFusionDAGMutation(
ShouldSchedulePredTy shouldScheduleAdjacent) {
if(EnableMacroFusion)
- return llvm::make_unique<MacroFusion>(shouldScheduleAdjacent, true);
+ return std::make_unique<MacroFusion>(shouldScheduleAdjacent, true);
return nullptr;
}
llvm::createBranchMacroFusionDAGMutation(
ShouldSchedulePredTy shouldScheduleAdjacent) {
if(EnableMacroFusion)
- return llvm::make_unique<MacroFusion>(shouldScheduleAdjacent, false);
+ return std::make_unique<MacroFusion>(shouldScheduleAdjacent, false);
return nullptr;
}
PseudoSourceValueManager::getFixedStack(int FI) {
std::unique_ptr<FixedStackPseudoSourceValue> &V = FSValues[FI];
if (!V)
- V = llvm::make_unique<FixedStackPseudoSourceValue>(FI, TII);
+ V = std::make_unique<FixedStackPseudoSourceValue>(FI, TII);
return V.get();
}
std::unique_ptr<const GlobalValuePseudoSourceValue> &E =
GlobalCallEntries[GV];
if (!E)
- E = llvm::make_unique<GlobalValuePseudoSourceValue>(GV, TII);
+ E = std::make_unique<GlobalValuePseudoSourceValue>(GV, TII);
return E.get();
}
std::unique_ptr<const ExternalSymbolPseudoSourceValue> &E =
ExternalCallEntries[ES];
if (!E)
- E = llvm::make_unique<ExternalSymbolPseudoSourceValue>(ES, TII);
+ E = std::make_unique<ExternalSymbolPseudoSourceValue>(ES, TII);
return E.get();
}
if (!VRegsToAlloc.empty()) {
const TargetSubtargetInfo &Subtarget = MF.getSubtarget();
std::unique_ptr<PBQPRAConstraintList> ConstraintsRoot =
- llvm::make_unique<PBQPRAConstraintList>();
- ConstraintsRoot->addConstraint(llvm::make_unique<SpillCosts>());
- ConstraintsRoot->addConstraint(llvm::make_unique<Interference>());
+ std::make_unique<PBQPRAConstraintList>();
+ ConstraintsRoot->addConstraint(std::make_unique<SpillCosts>());
+ ConstraintsRoot->addConstraint(std::make_unique<Interference>());
if (PBQPCoalescing)
- ConstraintsRoot->addConstraint(llvm::make_unique<Coalescing>());
+ ConstraintsRoot->addConstraint(std::make_unique<Coalescing>());
ConstraintsRoot->addConstraint(Subtarget.getCustomPBQPConstraints());
bool PBQPAllocComplete = false;
SelectionDAGBuilder(SelectionDAG &dag, FunctionLoweringInfo &funcinfo,
SwiftErrorValueTracking &swifterror, CodeGenOpt::Level ol)
: SDNodeOrder(LowestSDNodeOrder), TM(dag.getTarget()), DAG(dag),
- SL(make_unique<SDAGSwitchLowering>(this, funcinfo)), FuncInfo(funcinfo),
+ SL(std::make_unique<SDAGSwitchLowering>(this, funcinfo)), FuncInfo(funcinfo),
SwiftError(swifterror) {}
void init(GCFunctionInfo *gfi, AliasAnalysis *AA,
RegInfo = &MF->getRegInfo();
LibInfo = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
GFI = Fn.hasGC() ? &getAnalysis<GCModuleInfo>().getFunctionInfo(Fn) : nullptr;
- ORE = make_unique<OptimizationRemarkEmitter>(&Fn);
+ ORE = std::make_unique<OptimizationRemarkEmitter>(&Fn);
auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>();
DominatorTree *DT = DTWP ? &DTWP->getDomTree() : nullptr;
auto *LIWP = getAnalysisIfAvailable<LoopInfoWrapperPass>();
}
std::unique_ptr<CSEConfigBase> TargetPassConfig::getCSEConfig() const {
- return make_unique<CSEConfigBase>();
+ return std::make_unique<CSEConfigBase>();
}
DataExtractor CUIndexData(DObj->getCUIndexSection(), isLittleEndian(), 0);
- CUIndex = llvm::make_unique<DWARFUnitIndex>(DW_SECT_INFO);
+ CUIndex = std::make_unique<DWARFUnitIndex>(DW_SECT_INFO);
CUIndex->parse(CUIndexData);
return *CUIndex;
}
DataExtractor TUIndexData(DObj->getTUIndexSection(), isLittleEndian(), 0);
- TUIndex = llvm::make_unique<DWARFUnitIndex>(DW_SECT_TYPES);
+ TUIndex = std::make_unique<DWARFUnitIndex>(DW_SECT_TYPES);
TUIndex->parse(TUIndexData);
return *TUIndex;
}
return *GdbIndex;
DataExtractor GdbIndexData(DObj->getGdbIndexSection(), true /*LE*/, 0);
- GdbIndex = llvm::make_unique<DWARFGdbIndex>();
+ GdbIndex = std::make_unique<DWARFGdbIndex>();
GdbIndex->parse(GdbIndexData);
return *GdbIndex;
}
DWARFContext::create(const object::ObjectFile &Obj, const LoadedObjectInfo *L,
function_ref<ErrorPolicy(Error)> HandleError,
std::string DWPName) {
- auto DObj = llvm::make_unique<DWARFObjInMemory>(Obj, L, HandleError);
- return llvm::make_unique<DWARFContext>(std::move(DObj), std::move(DWPName));
+ auto DObj = std::make_unique<DWARFObjInMemory>(Obj, L, HandleError);
+ return std::make_unique<DWARFContext>(std::move(DObj), std::move(DWPName));
}
std::unique_ptr<DWARFContext>
DWARFContext::create(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
uint8_t AddrSize, bool isLittleEndian) {
auto DObj =
- llvm::make_unique<DWARFObjInMemory>(Sections, AddrSize, isLittleEndian);
- return llvm::make_unique<DWARFContext>(std::move(DObj), "");
+ std::make_unique<DWARFObjInMemory>(Sections, AddrSize, isLittleEndian);
+ return std::make_unique<DWARFContext>(std::move(DObj), "");
}
Error DWARFContext::loadRegisterInfo(const object::ObjectFile &Obj) {
}
}
- auto Cie = llvm::make_unique<CIE>(
+ auto Cie = std::make_unique<CIE>(
StartOffset, Length, Version, AugmentationString, AddressSize,
SegmentDescriptorSize, CodeAlignmentFactor, DataAlignmentFactor,
ReturnAddressRegister, AugmentationData, FDEPointerEncoding,
return nullptr;
std::unique_ptr<DWARFUnit> U;
if (Header.isTypeUnit())
- U = llvm::make_unique<DWARFTypeUnit>(Context, InfoSection, Header, DA,
+ U = std::make_unique<DWARFTypeUnit>(Context, InfoSection, Header, DA,
RS, LocSection, SS, SOS, AOS, LS,
LE, IsDWO, *this);
else
- U = llvm::make_unique<DWARFCompileUnit>(Context, InfoSection, Header,
+ U = std::make_unique<DWARFCompileUnit>(Context, InfoSection, Header,
DA, RS, LocSection, SS, SOS,
AOS, LS, LE, IsDWO, *this);
return U;
(2 * Header.NumUnits + 1) * 4 * Header.NumColumns))
return false;
- Rows = llvm::make_unique<Entry[]>(Header.NumBuckets);
+ Rows = std::make_unique<Entry[]>(Header.NumBuckets);
auto Contribs =
- llvm::make_unique<Entry::SectionContribution *[]>(Header.NumUnits);
- ColumnKinds = llvm::make_unique<DWARFSectionKind[]>(Header.NumColumns);
+ std::make_unique<Entry::SectionContribution *[]>(Header.NumUnits);
+ ColumnKinds = std::make_unique<DWARFSectionKind[]>(Header.NumColumns);
// Read Hash Table of Signatures
for (unsigned i = 0; i != Header.NumBuckets; ++i)
continue;
Rows[i].Index = this;
Rows[i].Contributions =
- llvm::make_unique<Entry::SectionContribution[]>(Header.NumColumns);
+ std::make_unique<Entry::SectionContribution[]>(Header.NumColumns);
Contribs[Index - 1] = Rows[i].Contributions.get();
}
switch (UnitType) {
case dwarf::DW_UT_type:
case dwarf::DW_UT_split_type: {
- Unit = TypeUnitVector.addUnit(llvm::make_unique<DWARFTypeUnit>(
+ Unit = TypeUnitVector.addUnit(std::make_unique<DWARFTypeUnit>(
DCtx, S, Header, DCtx.getDebugAbbrev(), &DObj.getRangesSection(),
&DObj.getLocSection(), DObj.getStrSection(),
DObj.getStrOffsetsSection(), &DObj.getAppleObjCSection(),
case dwarf::DW_UT_partial:
// UnitType = 0 means that we are verifying a compile unit in DWARF v4.
case 0: {
- Unit = CompileUnitVector.addUnit(llvm::make_unique<DWARFCompileUnit>(
+ Unit = CompileUnitVector.addUnit(std::make_unique<DWARFCompileUnit>(
DCtx, S, Header, DCtx.getDebugAbbrev(), &DObj.getRangesSection(),
&DObj.getLocSection(), DObj.getStrSection(),
DObj.getStrOffsetsSection(), &DObj.getAppleObjCSection(),
std::unique_ptr<MappedBlockStream> MappedBlockStream::createStream(
uint32_t BlockSize, const MSFStreamLayout &Layout, BinaryStreamRef MsfData,
BumpPtrAllocator &Allocator) {
- return llvm::make_unique<MappedBlockStreamImpl<MappedBlockStream>>(
+ return std::make_unique<MappedBlockStreamImpl<MappedBlockStream>>(
BlockSize, Layout, MsfData, Allocator);
}
MSFStreamLayout SL;
SL.Blocks = Layout.StreamMap[StreamIndex];
SL.Length = Layout.StreamSizes[StreamIndex];
- return llvm::make_unique<MappedBlockStreamImpl<MappedBlockStream>>(
+ return std::make_unique<MappedBlockStreamImpl<MappedBlockStream>>(
Layout.SB->BlockSize, SL, MsfData, Allocator);
}
const MSFStreamLayout &Layout,
WritableBinaryStreamRef MsfData,
BumpPtrAllocator &Allocator) {
- return llvm::make_unique<MappedBlockStreamImpl<WritableMappedBlockStream>>(
+ return std::make_unique<MappedBlockStreamImpl<WritableMappedBlockStream>>(
BlockSize, Layout, MsfData, Allocator);
}
return nullptr;
}
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumSymbols>
Symbol->findChildrenEx(EnumVal, Name16Str, CompareFlags, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumSymbols>
Section, Offset, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumSymbols>
&DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumSymbols>
&DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumSymbols>
if (S_OK != Symbol->findInlineFramesByAddr(Section, Offset, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumSymbols>
if (S_OK != Symbol->findInlineFramesByRVA(RVA, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumSymbols>
if (S_OK != Symbol->findInlineFramesByVA(VA, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
+ return std::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
}
std::unique_ptr<IPDBEnumLineNumbers> DIARawSymbol::findInlineeLines() const {
if (S_OK != Symbol->findInlineeLines(&DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
+ return std::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
}
std::unique_ptr<IPDBEnumLineNumbers>
Symbol->findInlineeLinesByAddr(Section, Offset, Length, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
+ return std::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
}
std::unique_ptr<IPDBEnumLineNumbers>
if (S_OK != Symbol->findInlineeLinesByRVA(RVA, Length, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
+ return std::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
}
std::unique_ptr<IPDBEnumLineNumbers>
if (S_OK != Symbol->findInlineeLinesByVA(VA, Length, &DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
+ return std::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
}
void DIARawSymbol::getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes) const {
if (FAILED(Symbol->getSrcLineOnTypeDefn(&LineNumber)) || !LineNumber)
return nullptr;
- return llvm::make_unique<DIALineNumber>(LineNumber);
+ return std::make_unique<DIALineNumber>(LineNumber);
}
uint32_t DIARawSymbol::getStride() const {
if (FAILED(Symbol->get_virtualBaseTableType(&TableType)) || !TableType)
return nullptr;
- auto RawVT = llvm::make_unique<DIARawSymbol>(Session, TableType);
+ auto RawVT = std::make_unique<DIARawSymbol>(Session, TableType);
auto Pointer =
PDBSymbol::createAs<PDBSymbolTypePointer>(Session, std::move(RawVT));
return unique_dyn_cast<PDBSymbolTypeBuiltin>(Pointer->getPointeeType());
if (FAILED(Section->get_compiland(&Symbol)))
return nullptr;
- auto RawSymbol = llvm::make_unique<DIARawSymbol>(Session, Symbol);
+ auto RawSymbol = std::make_unique<DIARawSymbol>(Session, Symbol);
return PDBSymbol::createAs<PDBSymbolCompiland>(Session, std::move(RawSymbol));
}
if (S_OK != Session->get_globalScope(&GlobalScope))
return nullptr;
- auto RawSymbol = llvm::make_unique<DIARawSymbol>(*this, GlobalScope);
+ auto RawSymbol = std::make_unique<DIARawSymbol>(*this, GlobalScope);
auto PdbSymbol(PDBSymbol::create(*this, std::move(RawSymbol)));
std::unique_ptr<PDBSymbolExe> ExeSymbol(
static_cast<PDBSymbolExe *>(PdbSymbol.release()));
if (S_OK != Session->symbolById(SymbolId, &LocatedSymbol))
return nullptr;
- auto RawSymbol = llvm::make_unique<DIARawSymbol>(*this, LocatedSymbol);
+ auto RawSymbol = std::make_unique<DIARawSymbol>(*this, LocatedSymbol);
return PDBSymbol::create(*this, std::move(RawSymbol));
}
if (S_OK != Session->findSymbolByRVA(RVA, EnumVal, &Symbol))
return nullptr;
}
- auto RawSymbol = llvm::make_unique<DIARawSymbol>(*this, Symbol);
+ auto RawSymbol = std::make_unique<DIARawSymbol>(*this, Symbol);
return PDBSymbol::create(*this, std::move(RawSymbol));
}
if (S_OK != Session->findSymbolByRVA(RVA, EnumVal, &Symbol))
return nullptr;
- auto RawSymbol = llvm::make_unique<DIARawSymbol>(*this, Symbol);
+ auto RawSymbol = std::make_unique<DIARawSymbol>(*this, Symbol);
return PDBSymbol::create(*this, std::move(RawSymbol));
}
if (S_OK != Session->findSymbolByAddr(Sect, Offset, EnumVal, &Symbol))
return nullptr;
- auto RawSymbol = llvm::make_unique<DIARawSymbol>(*this, Symbol);
+ auto RawSymbol = std::make_unique<DIARawSymbol>(*this, Symbol);
return PDBSymbol::create(*this, std::move(RawSymbol));
}
RawFile.getDiaFile(), &LineNumbers))
return nullptr;
- return llvm::make_unique<DIAEnumLineNumbers>(LineNumbers);
+ return std::make_unique<DIAEnumLineNumbers>(LineNumbers);
}
std::unique_ptr<IPDBEnumLineNumbers>
if (S_OK != Session->findLinesByRVA(RVA, Length, &LineNumbers))
return nullptr;
}
- return llvm::make_unique<DIAEnumLineNumbers>(LineNumbers);
+ return std::make_unique<DIAEnumLineNumbers>(LineNumbers);
}
std::unique_ptr<IPDBEnumLineNumbers>
if (S_OK != Session->findLinesByRVA(RVA, Length, &LineNumbers))
return nullptr;
- return llvm::make_unique<DIAEnumLineNumbers>(LineNumbers);
+ return std::make_unique<DIAEnumLineNumbers>(LineNumbers);
}
std::unique_ptr<IPDBEnumLineNumbers>
if (S_OK != Session->findLinesByAddr(Section, Offset, Length, &LineNumbers))
return nullptr;
- return llvm::make_unique<DIAEnumLineNumbers>(LineNumbers);
+ return std::make_unique<DIAEnumLineNumbers>(LineNumbers);
}
std::unique_ptr<IPDBEnumSourceFiles>
if (S_OK !=
Session->findFile(DiaCompiland, Utf16Pattern.m_str, Flags, &SourceFiles))
return nullptr;
- return llvm::make_unique<DIAEnumSourceFiles>(*this, SourceFiles);
+ return std::make_unique<DIAEnumSourceFiles>(*this, SourceFiles);
}
std::unique_ptr<IPDBSourceFile>
if (S_OK != Session->findFile(nullptr, nullptr, nsNone, &Files))
return nullptr;
- return llvm::make_unique<DIAEnumSourceFiles>(*this, Files);
+ return std::make_unique<DIAEnumSourceFiles>(*this, Files);
}
std::unique_ptr<IPDBEnumSourceFiles> DIASession::getSourceFilesForCompiland(
Session->findFile(RawSymbol.getDiaSymbol(), nullptr, nsNone, &Files))
return nullptr;
- return llvm::make_unique<DIAEnumSourceFiles>(*this, Files);
+ return std::make_unique<DIAEnumSourceFiles>(*this, Files);
}
std::unique_ptr<IPDBSourceFile>
if (S_OK != Session->findFileById(FileId, &LocatedFile))
return nullptr;
- return llvm::make_unique<DIASourceFile>(*this, LocatedFile);
+ return std::make_unique<DIASourceFile>(*this, LocatedFile);
}
std::unique_ptr<IPDBEnumDataStreams> DIASession::getDebugStreams() const {
if (S_OK != Session->getEnumDebugStreams(&DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumDebugStreams>(DiaEnumerator);
+ return std::make_unique<DIAEnumDebugStreams>(DiaEnumerator);
}
std::unique_ptr<IPDBEnumTables> DIASession::getEnumTables() const {
if (S_OK != Session->getEnumTables(&DiaEnumerator))
return nullptr;
- return llvm::make_unique<DIAEnumTables>(DiaEnumerator);
+ return std::make_unique<DIAEnumTables>(DiaEnumerator);
}
template <class T> static CComPtr<T> getTableEnumerator(IDiaSession &Session) {
if (!Files)
return nullptr;
- return llvm::make_unique<DIAEnumInjectedSources>(Files);
+ return std::make_unique<DIAEnumInjectedSources>(Files);
}
std::unique_ptr<IPDBEnumSectionContribs>
if (!Sections)
return nullptr;
- return llvm::make_unique<DIAEnumSectionContribs>(*this, Sections);
+ return std::make_unique<DIAEnumSectionContribs>(*this, Sections);
}
std::unique_ptr<IPDBEnumFrameData>
if (!FD)
return nullptr;
- return llvm::make_unique<DIAEnumFrameData>(FD);
+ return std::make_unique<DIAEnumFrameData>(FD);
}
void DbiModuleDescriptorBuilder::addDebugSubsection(
std::shared_ptr<DebugSubsection> Subsection) {
assert(Subsection);
- C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
+ C13Builders.push_back(std::make_unique<DebugSubsectionRecordBuilder>(
std::move(Subsection), CodeViewContainer::Pdb));
}
void DbiModuleDescriptorBuilder::addDebugSubsection(
const DebugSubsectionRecord &SubsectionContents) {
- C13Builders.push_back(llvm::make_unique<DebugSubsectionRecordBuilder>(
+ C13Builders.push_back(std::make_unique<DebugSubsectionRecordBuilder>(
SubsectionContents, CodeViewContainer::Pdb));
}
DbiStreamBuilder::addModuleInfo(StringRef ModuleName) {
uint32_t Index = ModiList.size();
ModiList.push_back(
- llvm::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf));
+ std::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf));
return *ModiList.back();
}
}
GSIStreamBuilder::GSIStreamBuilder(msf::MSFBuilder &Msf)
- : Msf(Msf), PSH(llvm::make_unique<GSIHashStreamBuilder>()),
- GSH(llvm::make_unique<GSIHashStreamBuilder>()) {}
+ : Msf(Msf), PSH(std::make_unique<GSIHashStreamBuilder>()),
+ GSH(std::make_unique<GSIHashStreamBuilder>()) {}
GSIStreamBuilder::~GSIStreamBuilder() {}
NativeEnumInjectedSources::getChildAtIndex(uint32_t N) const {
if (N >= getChildCount())
return nullptr;
- return make_unique<NativeInjectedSource>(std::next(Stream.begin(), N)->second,
+ return std::make_unique<NativeInjectedSource>(std::next(Stream.begin(), N)->second,
File, Strings);
}
std::unique_ptr<IPDBInjectedSource> NativeEnumInjectedSources::getNext() {
if (Cur == Stream.end())
return nullptr;
- return make_unique<NativeInjectedSource>((Cur++)->second, File, Strings);
+ return std::make_unique<NativeInjectedSource>((Cur++)->second, File, Strings);
}
void NativeEnumInjectedSources::reset() { Cur = Stream.begin(); }
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildren(PDB_SymType Type) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags, uint64_t VA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags, uint32_t RVA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findInlineFramesByAddr(uint32_t Section,
uint32_t Offset) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findInlineFramesByVA(uint64_t VA) const {
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLines() const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
uint32_t Length) const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
std::unique_ptr<IPDBEnumLineNumbers>
NativeRawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
- return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
+ return std::make_unique<NullEnumerator<IPDBLineNumber>>();
}
void NativeRawSymbol::getDataBytes(SmallVector<uint8_t, 32> &bytes) const {
Error NativeSession::createFromPdb(std::unique_ptr<MemoryBuffer> Buffer,
std::unique_ptr<IPDBSession> &Session) {
StringRef Path = Buffer->getBufferIdentifier();
- auto Stream = llvm::make_unique<MemoryBufferByteStream>(
+ auto Stream = std::make_unique<MemoryBufferByteStream>(
std::move(Buffer), llvm::support::little);
- auto Allocator = llvm::make_unique<BumpPtrAllocator>();
- auto File = llvm::make_unique<PDBFile>(Path, std::move(Stream), *Allocator);
+ auto Allocator = std::make_unique<BumpPtrAllocator>();
+ auto File = std::make_unique<PDBFile>(Path, std::move(Stream), *Allocator);
if (auto EC = File->parseFileHeaders())
return EC;
if (auto EC = File->parseStreamData())
return EC;
Session =
- llvm::make_unique<NativeSession>(std::move(File), std::move(Allocator));
+ std::make_unique<NativeSession>(std::move(File), std::move(Allocator));
return Error::success();
}
consumeError(Strings.takeError());
return nullptr;
}
- return make_unique<NativeEnumInjectedSources>(*Pdb, *ISS, *Strings);
+ return std::make_unique<NativeEnumInjectedSources>(*Pdb, *ISS, *Strings);
}
std::unique_ptr<IPDBEnumSectionContribs>
std::unique_ptr<IPDBEnumSymbols>
NativeTypeEnum::findChildren(PDB_SymType Type) const {
if (Type != PDB_SymType::Data)
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
const NativeTypeEnum *ClassParent = nullptr;
if (!Modifiers)
ClassParent = this;
else
ClassParent = UnmodifiedType;
- return llvm::make_unique<NativeEnumEnumEnumerators>(Session, *ClassParent);
+ return std::make_unique<NativeEnumEnumEnumerators>(Session, *ClassParent);
}
PDB_SymType NativeTypeEnum::getSymTag() const { return PDB_SymType::Enum; }
std::unique_ptr<PDBSymbol> wrap(std::unique_ptr<PDBSymbol> S) const {
if (!S)
return nullptr;
- auto NTFA = llvm::make_unique<NativeTypeFunctionArg>(Session, std::move(S));
+ auto NTFA = std::make_unique<NativeTypeFunctionArg>(Session, std::move(S));
return PDBSymbol::create(Session, std::move(NTFA));
}
NativeSession &Session;
std::unique_ptr<IPDBEnumSymbols>
NativeTypeFunctionSig::findChildren(PDB_SymType Type) const {
if (Type != PDB_SymType::FunctionArg)
- return llvm::make_unique<NullEnumerator<PDBSymbol>>();
+ return std::make_unique<NullEnumerator<PDBSymbol>>();
- auto NET = llvm::make_unique<NativeEnumTypes>(Session,
+ auto NET = std::make_unique<NativeEnumTypes>(Session,
/* copy */ ArgList.ArgIndices);
return std::unique_ptr<IPDBEnumSymbols>(
new NativeEnumFunctionArgs(Session, std::move(NET)));
safelyCreateIndexedStream(DbiS->getGlobalSymbolStreamIndex());
if (!GlobalS)
return GlobalS.takeError();
- auto TempGlobals = llvm::make_unique<GlobalsStream>(std::move(*GlobalS));
+ auto TempGlobals = std::make_unique<GlobalsStream>(std::move(*GlobalS));
if (auto EC = TempGlobals->reload())
return std::move(EC);
Globals = std::move(TempGlobals);
auto InfoS = safelyCreateIndexedStream(StreamPDB);
if (!InfoS)
return InfoS.takeError();
- auto TempInfo = llvm::make_unique<InfoStream>(std::move(*InfoS));
+ auto TempInfo = std::make_unique<InfoStream>(std::move(*InfoS));
if (auto EC = TempInfo->reload())
return std::move(EC);
Info = std::move(TempInfo);
auto DbiS = safelyCreateIndexedStream(StreamDBI);
if (!DbiS)
return DbiS.takeError();
- auto TempDbi = llvm::make_unique<DbiStream>(std::move(*DbiS));
+ auto TempDbi = std::make_unique<DbiStream>(std::move(*DbiS));
if (auto EC = TempDbi->reload(this))
return std::move(EC);
Dbi = std::move(TempDbi);
auto TpiS = safelyCreateIndexedStream(StreamTPI);
if (!TpiS)
return TpiS.takeError();
- auto TempTpi = llvm::make_unique<TpiStream>(*this, std::move(*TpiS));
+ auto TempTpi = std::make_unique<TpiStream>(*this, std::move(*TpiS));
if (auto EC = TempTpi->reload())
return std::move(EC);
Tpi = std::move(TempTpi);
auto IpiS = safelyCreateIndexedStream(StreamIPI);
if (!IpiS)
return IpiS.takeError();
- auto TempIpi = llvm::make_unique<TpiStream>(*this, std::move(*IpiS));
+ auto TempIpi = std::make_unique<TpiStream>(*this, std::move(*IpiS));
if (auto EC = TempIpi->reload())
return std::move(EC);
Ipi = std::move(TempIpi);
safelyCreateIndexedStream(DbiS->getPublicSymbolStreamIndex());
if (!PublicS)
return PublicS.takeError();
- auto TempPublics = llvm::make_unique<PublicsStream>(std::move(*PublicS));
+ auto TempPublics = std::make_unique<PublicsStream>(std::move(*PublicS));
if (auto EC = TempPublics->reload())
return std::move(EC);
Publics = std::move(TempPublics);
if (!SymbolS)
return SymbolS.takeError();
- auto TempSymbols = llvm::make_unique<SymbolStream>(std::move(*SymbolS));
+ auto TempSymbols = std::make_unique<SymbolStream>(std::move(*SymbolS));
if (auto EC = TempSymbols->reload())
return std::move(EC);
Symbols = std::move(TempSymbols);
if (!NS)
return NS.takeError();
- auto N = llvm::make_unique<PDBStringTable>();
+ auto N = std::make_unique<PDBStringTable>();
BinaryStreamReader Reader(**NS);
if (auto EC = N->reload(Reader))
return std::move(EC);
if (!Strings)
return Strings.takeError();
- auto IJ = llvm::make_unique<InjectedSourceStream>(std::move(*IJS));
+ auto IJ = std::make_unique<InjectedSourceStream>(std::move(*IJS));
if (auto EC = IJ->reload(*Strings))
return std::move(EC);
InjectedSources = std::move(IJ);
auto ExpectedMsf = MSFBuilder::create(Allocator, BlockSize);
if (!ExpectedMsf)
return ExpectedMsf.takeError();
- Msf = llvm::make_unique<MSFBuilder>(std::move(*ExpectedMsf));
+ Msf = std::make_unique<MSFBuilder>(std::move(*ExpectedMsf));
return Error::success();
}
InfoStreamBuilder &PDBFileBuilder::getInfoBuilder() {
if (!Info)
- Info = llvm::make_unique<InfoStreamBuilder>(*Msf, NamedStreams);
+ Info = std::make_unique<InfoStreamBuilder>(*Msf, NamedStreams);
return *Info;
}
DbiStreamBuilder &PDBFileBuilder::getDbiBuilder() {
if (!Dbi)
- Dbi = llvm::make_unique<DbiStreamBuilder>(*Msf);
+ Dbi = std::make_unique<DbiStreamBuilder>(*Msf);
return *Dbi;
}
TpiStreamBuilder &PDBFileBuilder::getTpiBuilder() {
if (!Tpi)
- Tpi = llvm::make_unique<TpiStreamBuilder>(*Msf, StreamTPI);
+ Tpi = std::make_unique<TpiStreamBuilder>(*Msf, StreamTPI);
return *Tpi;
}
TpiStreamBuilder &PDBFileBuilder::getIpiBuilder() {
if (!Ipi)
- Ipi = llvm::make_unique<TpiStreamBuilder>(*Msf, StreamIPI);
+ Ipi = std::make_unique<TpiStreamBuilder>(*Msf, StreamIPI);
return *Ipi;
}
GSIStreamBuilder &PDBFileBuilder::getGsiBuilder() {
if (!Gsi)
- Gsi = llvm::make_unique<GSIStreamBuilder>(*Msf);
+ Gsi = std::make_unique<GSIStreamBuilder>(*Msf);
return *Gsi;
}
HashStream = std::move(*HS);
}
- Types = llvm::make_unique<LazyRandomTypeCollection>(
+ Types = std::make_unique<LazyRandomTypeCollection>(
TypeRecords, getNumTypeRecords(), getTypeIndexOffsets());
return Error::success();
}
reinterpret_cast<const uint8_t *>(HashBuffer.data()),
calculateHashBufferSize());
HashValueStream =
- llvm::make_unique<BinaryByteStream>(Bytes, llvm::support::little);
+ std::make_unique<BinaryByteStream>(Bytes, llvm::support::little);
}
return Error::success();
}
std::unique_ptr<IPDBEnumChildren<PDBSymbolData>>
PDBSymbolFunc::getArguments() const {
- return llvm::make_unique<FunctionArgEnumerator>(Session, *this);
+ return std::make_unique<FunctionArgEnumerator>(Session, *this);
}
void PDBSymbolFunc::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
std::unique_ptr<IPDBEnumSymbols>
PDBSymbolTypeFunctionSig::getArguments() const {
- return llvm::make_unique<FunctionArgEnumerator>(Session, *this);
+ return std::make_unique<FunctionArgEnumerator>(Session, *this);
}
void PDBSymbolTypeFunctionSig::dump(PDBSymDumper &Dumper) const {
DataMember(std::move(Member)) {
auto Type = DataMember->getType();
if (auto UDT = unique_dyn_cast<PDBSymbolTypeUDT>(Type)) {
- UdtLayout = llvm::make_unique<ClassLayout>(std::move(UDT));
+ UdtLayout = std::make_unique<ClassLayout>(std::move(UDT));
UsedBytes = UdtLayout->usedBytes();
}
}
for (auto &Base : Bases) {
uint32_t Offset = Base->getOffset();
// Non-virtual bases never get elided.
- auto BL = llvm::make_unique<BaseClassLayout>(*this, Offset, false,
+ auto BL = std::make_unique<BaseClassLayout>(*this, Offset, false,
std::move(Base));
AllBases.push_back(BL.get());
assert(VTables.size() <= 1);
if (!VTables.empty()) {
auto VTLayout =
- llvm::make_unique<VTableLayoutItem>(*this, std::move(VTables[0]));
+ std::make_unique<VTableLayoutItem>(*this, std::move(VTables[0]));
VTable = VTLayout.get();
}
for (auto &Data : Members) {
- auto DM = llvm::make_unique<DataMemberLayoutItem>(*this, std::move(Data));
+ auto DM = std::make_unique<DataMemberLayoutItem>(*this, std::move(Data));
addChildToLayout(std::move(DM));
}
int VBPO = VB->getVirtualBasePointerOffset();
if (!hasVBPtrAtOffset(VBPO)) {
if (auto VBP = VB->getRawSymbol().getVirtualBaseTableType()) {
- auto VBPL = llvm::make_unique<VBPtrLayoutItem>(*this, std::move(VBP),
+ auto VBPL = std::make_unique<VBPtrLayoutItem>(*this, std::move(VBP),
VBPO, VBP->getLength());
VBPtr = VBPL.get();
addChildToLayout(std::move(VBPL));
uint32_t Offset = UsedBytes.find_last() + 1;
bool Elide = (Parent != nullptr);
auto BL =
- llvm::make_unique<BaseClassLayout>(*this, Offset, Elide, std::move(VB));
+ std::make_unique<BaseClassLayout>(*this, Offset, Elide, std::move(VB));
AllBases.push_back(BL.get());
// Only lay this virtual base out directly inside of *this* class if this
Values.clear(); // Free the old contents.
Values.reserve(InputArgv.size());
unsigned PtrSize = EE->getDataLayout().getPointerSize();
- Array = make_unique<char[]>((InputArgv.size()+1)*PtrSize);
+ Array = std::make_unique<char[]>((InputArgv.size()+1)*PtrSize);
LLVM_DEBUG(dbgs() << "JIT: ARGV = " << (void *)Array.get() << "\n");
Type *SBytePtr = Type::getInt8PtrTy(C);
for (unsigned i = 0; i != InputArgv.size(); ++i) {
unsigned Size = InputArgv[i].size()+1;
- auto Dest = make_unique<char[]>(Size);
+ auto Dest = std::make_unique<char[]>(Size);
LLVM_DEBUG(dbgs() << "JIT: ARGV[" << i << "] = " << (void *)Dest.get()
<< "\n");
/// Link should be called with the constructor arguments for LinkerImpl, which
/// will be forwarded to the constructor.
template <typename... ArgTs> static void link(ArgTs &&... Args) {
- auto L = llvm::make_unique<LinkerImpl>(std::forward<ArgTs>(Args)...);
+ auto L = std::make_unique<LinkerImpl>(std::forward<ArgTs>(Args)...);
// Ownership of the linker is passed into the linker's doLink function to
// allow it to be passed on to async continuations.
MachOAtomGraphBuilder::MachOAtomGraphBuilder(const object::MachOObjectFile &Obj)
: Obj(Obj),
- G(llvm::make_unique<AtomGraph>(Obj.getFileName(), getPointerSize(Obj),
+ G(std::make_unique<AtomGraph>(Obj.getFileName(), getPointerSize(Obj),
getEndianness(Obj))) {}
void MachOAtomGraphBuilder::addCustomAtomizer(StringRef SectionName,
namespace llvm {
JITEventListener *JITEventListener::createOProfileJITEventListener() {
- return new OProfileJITEventListener(llvm::make_unique<OProfileWrapper>());
+ return new OProfileJITEventListener(std::make_unique<OProfileWrapper>());
}
} // namespace llvm
// Create a partitioning materialization unit and lodge it with the
// implementation dylib.
if (auto Err = PDR.getImplDylib().define(
- llvm::make_unique<PartitioningIRMaterializationUnit>(
+ std::make_unique<PartitioningIRMaterializationUnit>(
ES, std::move(TSM), R.getVModuleKey(), *this))) {
ES.reportError(std::move(Err));
R.failMaterialization();
// If the partition is empty, return the whole module to the symbol table.
if (GVsToExtract->empty()) {
- R.replace(llvm::make_unique<PartitioningIRMaterializationUnit>(
+ R.replace(std::make_unique<PartitioningIRMaterializationUnit>(
std::move(TSM), R.getSymbols(), std::move(Defs), *this));
return;
}
return;
}
- R.replace(llvm::make_unique<PartitioningIRMaterializationUnit>(
+ R.replace(std::make_unique<PartitioningIRMaterializationUnit>(
ES, std::move(TSM), R.getVModuleKey(), *this));
BaseLayer.emit(std::move(R), std::move(*ExtractedTSM));
}
PM.run(M);
}
- auto ObjBuffer = llvm::make_unique<SmallVectorMemoryBuffer>(
+ auto ObjBuffer = std::make_unique<SmallVectorMemoryBuffer>(
std::move(ObjBufferSV),
"<in memory object compiled from " + M.getModuleIdentifier() + ">");
auto Lib = sys::DynamicLibrary::getPermanentLibrary(FileName, &ErrMsg);
if (!Lib.isValid())
return make_error<StringError>(std::move(ErrMsg), inconvertibleErrorCode());
- return llvm::make_unique<DynamicLibrarySearchGenerator>(
+ return std::make_unique<DynamicLibrarySearchGenerator>(
std::move(Lib), GlobalPrefix, std::move(Allow));
}
std::lock_guard<std::mutex> Lock(CCMgrMutex);
AddrToSymbol[*TrampolineAddr] = CallbackName;
cantFail(CallbacksJD.define(
- llvm::make_unique<CompileCallbackMaterializationUnit>(
+ std::make_unique<CompileCallbackMaterializationUnit>(
std::move(CallbackName), std::move(Compile),
ES.allocateVModule())));
return *TrampolineAddr;
switch (T.getArch()) {
default:
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcGenericABI>>();
};
case Triple::aarch64:
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcAArch64>>();
};
case Triple::x86:
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcI386>>();
};
case Triple::mips:
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcMips32Be>>();
};
case Triple::mipsel:
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcMips32Le>>();
};
case Triple::mips64:
case Triple::mips64el:
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcMips64>>();
};
case Triple::x86_64:
if (T.getOS() == Triple::OSType::Win32) {
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcX86_64_Win32>>();
};
} else {
return [](){
- return llvm::make_unique<
+ return std::make_unique<
orc::LocalIndirectStubsManager<orc::OrcX86_64_SysV>>();
};
}
// Otherwise default to creating an RTDyldObjectLinkingLayer that constructs
// a new SectionMemoryManager for each object.
- auto GetMemMgr = []() { return llvm::make_unique<SectionMemoryManager>(); };
+ auto GetMemMgr = []() { return std::make_unique<SectionMemoryManager>(); };
auto ObjLinkingLayer =
- llvm::make_unique<RTDyldObjectLinkingLayer>(ES, std::move(GetMemMgr));
+ std::make_unique<RTDyldObjectLinkingLayer>(ES, std::move(GetMemMgr));
if (S.JTMB->getTargetTriple().isOSBinFormatCOFF())
ObjLinkingLayer->setOverrideObjectFlagsWithResponsibilityFlags(true);
}
LLJIT::LLJIT(LLJITBuilderState &S, Error &Err)
- : ES(S.ES ? std::move(S.ES) : llvm::make_unique<ExecutionSession>()),
+ : ES(S.ES ? std::move(S.ES) : std::make_unique<ExecutionSession>()),
Main(this->ES->getMainJITDylib()), DL(""), CtorRunner(Main),
DtorRunner(Main) {
Err = CompileFunction.takeError();
return;
}
- CompileLayer = llvm::make_unique<IRCompileLayer>(
+ CompileLayer = std::make_unique<IRCompileLayer>(
*ES, *ObjLinkingLayer, std::move(*CompileFunction));
}
if (S.NumCompileThreads > 0) {
CompileLayer->setCloneToNewContextOnEmit(true);
- CompileThreads = llvm::make_unique<ThreadPool>(S.NumCompileThreads);
+ CompileThreads = std::make_unique<ThreadPool>(S.NumCompileThreads);
ES->setDispatchMaterialization(
[this](JITDylib &JD, std::unique_ptr<MaterializationUnit> MU) {
// FIXME: Switch to move capture once we have c++14.
}
// Create the transform layer.
- TransformLayer = llvm::make_unique<IRTransformLayer>(*ES, *CompileLayer);
+ TransformLayer = std::make_unique<IRTransformLayer>(*ES, *CompileLayer);
// Create the COD layer.
- CODLayer = llvm::make_unique<CompileOnDemandLayer>(
+ CODLayer = std::make_unique<CompileOnDemandLayer>(
*ES, *TransformLayer, *LCTMgr, std::move(ISMBuilder));
if (S.NumCompileThreads > 0)
IRLayer::~IRLayer() {}
Error IRLayer::add(JITDylib &JD, ThreadSafeModule TSM, VModuleKey K) {
- return JD.define(llvm::make_unique<BasicIRLayerMaterializationUnit>(
+ return JD.define(std::make_unique<BasicIRLayerMaterializationUnit>(
*this, std::move(K), std::move(TSM)));
}
void ObjectLinkingLayer::emit(MaterializationResponsibility R,
std::unique_ptr<MemoryBuffer> O) {
assert(O && "Object must not be null");
- jitLink(llvm::make_unique<ObjectLinkingLayerJITLinkContext>(
+ jitLink(std::make_unique<ObjectLinkingLayerJITLinkContext>(
*this, std::move(R), std::move(O)));
}
template <typename LayerT>
std::unique_ptr<GenericLayerImpl<LayerT>> createGenericLayer(LayerT &Layer) {
- return llvm::make_unique<GenericLayerImpl<LayerT>>(Layer);
+ return std::make_unique<GenericLayerImpl<LayerT>>(Layer);
}
} // end namespace detail
LLVMOrcSymbolResolverFn ExternalResolver,
void *ExternalResolverCtx) {
return addIRModule(CompileLayer, std::move(M),
- llvm::make_unique<SectionMemoryManager>(),
+ std::make_unique<SectionMemoryManager>(),
std::move(ExternalResolver), ExternalResolverCtx);
}
inconvertibleErrorCode());
return addIRModule(*CODLayer, std::move(M),
- llvm::make_unique<SectionMemoryManager>(),
+ std::make_unique<SectionMemoryManager>(),
std::move(ExternalResolver), ExternalResolverCtx);
}
if (!CCMgr)
return nullptr;
- return llvm::make_unique<CODLayerT>(
+ return std::make_unique<CODLayerT>(
AcknowledgeORCv1Deprecation, ES, CompileLayer,
[&Resolvers](orc::VModuleKey K) {
auto ResolverI = Resolvers.find(K);
MemoryBufferRef ClonedModuleBufferRef(
StringRef(ClonedModuleBuffer.data(), ClonedModuleBuffer.size()),
"cloned module buffer");
- ThreadSafeContext NewTSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext NewTSCtx(std::make_unique<LLVMContext>());
auto ClonedModule = cantFail(
parseBitcodeFile(ClonedModuleBufferRef, *NewTSCtx.getContext()));
return;
}
- Dumpstream = make_unique<raw_fd_ostream>(DumpFd, true);
+ Dumpstream = std::make_unique<raw_fd_ostream>(DumpFd, true);
LLVMPerfJitHeader Header = {0};
if (!FillMachine(Header))
switch (Arch) {
default: llvm_unreachable("Unsupported target for RuntimeDyldCOFF.");
case Triple::x86:
- return make_unique<RuntimeDyldCOFFI386>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldCOFFI386>(MemMgr, Resolver);
case Triple::thumb:
- return make_unique<RuntimeDyldCOFFThumb>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldCOFFThumb>(MemMgr, Resolver);
case Triple::x86_64:
- return make_unique<RuntimeDyldCOFFX86_64>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldCOFFX86_64>(MemMgr, Resolver);
}
}
std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
RuntimeDyldCOFF::loadObject(const object::ObjectFile &O) {
if (auto ObjSectionToIDOrErr = loadObjectImpl(O)) {
- return llvm::make_unique<LoadedCOFFObjectInfo>(*this, *ObjSectionToIDOrErr);
+ return std::make_unique<LoadedCOFFObjectInfo>(*this, *ObjSectionToIDOrErr);
} else {
HasError = true;
raw_string_ostream ErrStream(ErrorStr);
GetGOTInfoFunction GetGOTInfo, support::endianness Endianness,
MCDisassembler *Disassembler, MCInstPrinter *InstPrinter,
raw_ostream &ErrStream)
- : Impl(::llvm::make_unique<RuntimeDyldCheckerImpl>(
+ : Impl(::std::make_unique<RuntimeDyldCheckerImpl>(
std::move(IsSymbolValid), std::move(GetSymbolInfo),
std::move(GetSectionInfo), std::move(GetStubInfo),
std::move(GetGOTInfo), Endianness, Disassembler, InstPrinter,
JITSymbolResolver &Resolver) {
switch (Arch) {
default:
- return make_unique<RuntimeDyldELF>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldELF>(MemMgr, Resolver);
case Triple::mips:
case Triple::mipsel:
case Triple::mips64:
case Triple::mips64el:
- return make_unique<RuntimeDyldELFMips>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldELFMips>(MemMgr, Resolver);
}
}
std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
RuntimeDyldELF::loadObject(const object::ObjectFile &O) {
if (auto ObjSectionToIDOrErr = loadObjectImpl(O))
- return llvm::make_unique<LoadedELFObjectInfo>(*this, *ObjSectionToIDOrErr);
+ return std::make_unique<LoadedELFObjectInfo>(*this, *ObjSectionToIDOrErr);
else {
HasError = true;
raw_string_ostream ErrStream(ErrorStr);
llvm_unreachable("Unsupported target for RuntimeDyldMachO.");
break;
case Triple::arm:
- return make_unique<RuntimeDyldMachOARM>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldMachOARM>(MemMgr, Resolver);
case Triple::aarch64:
- return make_unique<RuntimeDyldMachOAArch64>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldMachOAArch64>(MemMgr, Resolver);
case Triple::x86:
- return make_unique<RuntimeDyldMachOI386>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldMachOI386>(MemMgr, Resolver);
case Triple::x86_64:
- return make_unique<RuntimeDyldMachOX86_64>(MemMgr, Resolver);
+ return std::make_unique<RuntimeDyldMachOX86_64>(MemMgr, Resolver);
}
}
std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
RuntimeDyldMachO::loadObject(const object::ObjectFile &O) {
if (auto ObjSectionToIDOrErr = loadObjectImpl(O))
- return llvm::make_unique<LoadedMachOObjectInfo>(*this,
+ return std::make_unique<LoadedMachOObjectInfo>(*this,
*ObjSectionToIDOrErr);
else {
HasError = true;
if (Size <= 1)
// We get bogus data given an empty corpus - just create a new module.
- return llvm::make_unique<Module>("M", Context);
+ return std::make_unique<Module>("M", Context);
auto Buffer = MemoryBuffer::getMemBuffer(
StringRef(reinterpret_cast<const char *>(Data), Size), "Fuzzer input",
ShouldCreateStorage = false;
MachineStorage =
- llvm::make_unique<SlotTracker>(M, ShouldInitializeAllMetadata);
+ std::make_unique<SlotTracker>(M, ShouldInitializeAllMetadata);
Machine = MachineStorage.get();
return Machine;
}
if (const MDNode *N = dyn_cast<MDNode>(MD)) {
std::unique_ptr<SlotTracker> MachineStorage;
if (!Machine) {
- MachineStorage = make_unique<SlotTracker>(Context);
+ MachineStorage = std::make_unique<SlotTracker>(Context);
Machine = MachineStorage.get();
}
int Slot = Machine->getMetadataSlot(N);
// We only need a symbol table for a function if the context keeps value names
if (!getContext().shouldDiscardValueNames())
- SymTab = make_unique<ValueSymbolTable>();
+ SymTab = std::make_unique<ValueSymbolTable>();
// If the function has arguments, mark them as lazily built.
if (Ty->getNumParams())
using namespace llvm;
LLVMContextImpl::LLVMContextImpl(LLVMContext &C)
- : DiagHandler(llvm::make_unique<DiagnosticHandler>()),
+ : DiagHandler(std::make_unique<DiagnosticHandler>()),
VoidTy(C, Type::VoidTyID),
LabelTy(C, Type::LabelTyID),
HalfTy(C, Type::HalfTyID),
std::error_code EC;
auto RemarksFile =
- llvm::make_unique<ToolOutputFile>(RemarksFilename, EC, sys::fs::OF_None);
+ std::make_unique<ToolOutputFile>(RemarksFilename, EC, sys::fs::OF_None);
// We don't use llvm::FileError here because some diagnostics want the file
// name separately.
if (EC)
if (Error E = RemarkSerializer.takeError())
return make_error<RemarkSetupFormatError>(std::move(E));
- Context.setRemarkStreamer(llvm::make_unique<RemarkStreamer>(
+ Context.setRemarkStreamer(std::make_unique<RemarkStreamer>(
RemarksFilename, std::move(*RemarkSerializer)));
if (!RemarksPasses.empty())
}
bool doInitialization(Module &M) override {
- V = llvm::make_unique<Verifier>(
+ V = std::make_unique<Verifier>(
&dbgs(), /*ShouldTreatBrokenDebugInfoAsError=*/false, M);
return false;
}
}
// This CacheStream will move the temporary file into the cache when done.
- return llvm::make_unique<CacheStream>(
- llvm::make_unique<raw_fd_ostream>(Temp->FD, /* ShouldClose */ false),
+ return std::make_unique<CacheStream>(
+ std::make_unique<raw_fd_ostream>(Temp->FD, /* ShouldClose */ false),
AddBuffer, std::move(*Temp), EntryPath.str(), Task);
};
};
LTO::RegularLTOState::RegularLTOState(unsigned ParallelCodeGenParallelismLevel,
Config &Conf)
: ParallelCodeGenParallelismLevel(ParallelCodeGenParallelismLevel),
- Ctx(Conf), CombinedModule(llvm::make_unique<Module>("ld-temp.o", Ctx)),
- Mover(llvm::make_unique<IRMover>(*CombinedModule)) {}
+ Ctx(Conf), CombinedModule(std::make_unique<Module>("ld-temp.o", Ctx)),
+ Mover(std::make_unique<IRMover>(*CombinedModule)) {}
LTO::ThinLTOState::ThinLTOState(ThinBackend Backend)
: Backend(Backend), CombinedIndex(/*HaveGVs*/ false) {
return [=](Config &Conf, ModuleSummaryIndex &CombinedIndex,
const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
AddStreamFn AddStream, NativeObjectCache Cache) {
- return llvm::make_unique<InProcessThinBackend>(
+ return std::make_unique<InProcessThinBackend>(
Conf, CombinedIndex, ParallelismLevel, ModuleToDefinedGVSummaries,
AddStream, Cache);
};
return [=](Config &Conf, ModuleSummaryIndex &CombinedIndex,
const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
AddStreamFn AddStream, NativeObjectCache Cache) {
- return llvm::make_unique<WriteIndexesThinBackend>(
+ return std::make_unique<WriteIndexesThinBackend>(
Conf, CombinedIndex, ModuleToDefinedGVSummaries, OldPrefix, NewPrefix,
ShouldEmitImportsFiles, LinkedObjectsFile, OnWrite);
};
llvm::EnableStatistics(false);
std::error_code EC;
auto StatsFile =
- llvm::make_unique<ToolOutputFile>(StatsFilename, EC, sys::fs::OF_None);
+ std::make_unique<ToolOutputFile>(StatsFilename, EC, sys::fs::OF_None);
if (EC)
return errorCodeToError(EC);
ShouldDiscardValueNames = false;
std::error_code EC;
- ResolutionFile = llvm::make_unique<raw_fd_ostream>(
+ ResolutionFile = std::make_unique<raw_fd_ostream>(
OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::OF_Text);
if (EC)
return errorCodeToError(EC);
if (!DwoFile.empty()) {
std::error_code EC;
- DwoOut = llvm::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None);
+ DwoOut = std::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None);
if (EC)
report_fatal_error("Failed to open " + DwoFile + ": " + EC.message());
}
AsmUndefinedRefs.clear();
MergedModule = Mod->takeModule();
- TheLinker = make_unique<Linker>(*MergedModule);
+ TheLinker = std::make_unique<Linker>(*MergedModule);
setAsmUndefinedRefs(&*Mod);
// We've just changed the input, so let's make sure we verify it.
return Context.setDiagnosticHandler(nullptr);
// Register the LTOCodeGenerator stub in the LLVMContext to forward the
// diagnostic to the external DiagHandler.
- Context.setDiagnosticHandler(llvm::make_unique<LTODiagnosticHandler>(this),
+ Context.setDiagnosticHandler(std::make_unique<LTODiagnosticHandler>(this),
true);
}
// Run codegen now. resulting binary is in OutputBuffer.
PM.run(TheModule);
}
- return make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer));
+ return std::make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer));
}
/// Manage caching for a single Module.
auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI);
WriteBitcodeToFile(TheModule, OS, true, &Index);
}
- return make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer));
+ return std::make_unique<SmallVectorMemoryBuffer>(std::move(OutputBuffer));
}
return codegenModule(TheModule, TM);
*/
std::unique_ptr<ModuleSummaryIndex> ThinLTOCodeGenerator::linkCombinedIndex() {
std::unique_ptr<ModuleSummaryIndex> CombinedIndex =
- llvm::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false);
+ std::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false);
uint64_t NextModuleId = 0;
for (auto &Mod : Modules) {
auto &M = Mod->getSingleBitcodeModule();
std::unique_ptr<MCObjectWriter>
llvm::createELFObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW,
raw_pwrite_stream &OS, bool IsLittleEndian) {
- return llvm::make_unique<ELFSingleObjectWriter>(std::move(MOTW), OS,
+ return std::make_unique<ELFSingleObjectWriter>(std::move(MOTW), OS,
IsLittleEndian);
}
llvm::createELFDwoObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW,
raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS,
bool IsLittleEndian) {
- return llvm::make_unique<ELFDwoObjectWriter>(std::move(MOTW), OS, DwoOS,
+ return std::make_unique<ELFDwoObjectWriter>(std::move(MOTW), OS, DwoOS,
IsLittleEndian);
}
std::unique_ptr<MCAsmBackend> asmbackend, bool showInst)
: MCStreamer(Context), OSOwner(std::move(os)), OS(*OSOwner),
MAI(Context.getAsmInfo()), InstPrinter(printer),
- Assembler(llvm::make_unique<MCAssembler>(
+ Assembler(std::make_unique<MCAssembler>(
Context, std::move(asmbackend), std::move(emitter),
(asmbackend) ? asmbackend->createObjectWriter(NullStream)
: nullptr)),
std::unique_ptr<MCObjectWriter> OW,
std::unique_ptr<MCCodeEmitter> Emitter)
: MCStreamer(Context),
- Assembler(llvm::make_unique<MCAssembler>(
+ Assembler(std::make_unique<MCAssembler>(
Context, std::move(TAB), std::move(Emitter), std::move(OW))),
EmitEHFrame(true), EmitDebugFrame(false) {}
raw_fd_ostream *OS = getContext().getSecureLog();
if (!OS) {
std::error_code EC;
- auto NewOS = llvm::make_unique<raw_fd_ostream>(
+ auto NewOS = std::make_unique<raw_fd_ostream>(
StringRef(SecureLogFile), EC, sys::fs::OF_Append | sys::fs::OF_Text);
if (EC)
return Error(IDLoc, Twine("can't open secure log file: ") +
MCSymbol *StartProc = EmitCFILabel();
WinFrameInfos.emplace_back(
- llvm::make_unique<WinEH::FrameInfo>(Symbol, StartProc));
+ std::make_unique<WinEH::FrameInfo>(Symbol, StartProc));
CurrentWinFrameInfo = WinFrameInfos.back().get();
CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
}
MCSymbol *StartProc = EmitCFILabel();
- WinFrameInfos.emplace_back(llvm::make_unique<WinEH::FrameInfo>(
+ WinFrameInfos.emplace_back(std::make_unique<WinEH::FrameInfo>(
CurFrame->Function, StartProc, CurFrame));
CurrentWinFrameInfo = WinFrameInfos.back().get();
CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
std::unique_ptr<MCObjectWriter>
llvm::createMachObjectWriter(std::unique_ptr<MCMachObjectTargetWriter> MOTW,
raw_pwrite_stream &OS, bool IsLittleEndian) {
- return llvm::make_unique<MachObjectWriter>(std::move(MOTW), OS,
+ return std::make_unique<MachObjectWriter>(std::move(MOTW), OS,
IsLittleEndian);
}
// Separate out the producers and target features sections
if (Name == "producers") {
- ProducersSection = llvm::make_unique<WasmCustomSection>(Name, &Section);
+ ProducersSection = std::make_unique<WasmCustomSection>(Name, &Section);
continue;
}
if (Name == "target_features") {
TargetFeaturesSection =
- llvm::make_unique<WasmCustomSection>(Name, &Section);
+ std::make_unique<WasmCustomSection>(Name, &Section);
continue;
}
std::unique_ptr<MCObjectWriter>
llvm::createWasmObjectWriter(std::unique_ptr<MCWasmObjectTargetWriter> MOTW,
raw_pwrite_stream &OS) {
- return llvm::make_unique<WasmObjectWriter>(std::move(MOTW), OS);
+ return std::make_unique<WasmObjectWriter>(std::move(MOTW), OS);
}
}
COFFSymbol *WinCOFFObjectWriter::createSymbol(StringRef Name) {
- Symbols.push_back(make_unique<COFFSymbol>(Name));
+ Symbols.push_back(std::make_unique<COFFSymbol>(Name));
return Symbols.back().get();
}
}
COFFSection *WinCOFFObjectWriter::createSection(StringRef Name) {
- Sections.emplace_back(make_unique<COFFSection>(Name));
+ Sections.emplace_back(std::make_unique<COFFSection>(Name));
return Sections.back().get();
}
std::unique_ptr<MCObjectWriter> llvm::createWinCOFFObjectWriter(
std::unique_ptr<MCWinCOFFObjectTargetWriter> MOTW, raw_pwrite_stream &OS) {
- return llvm::make_unique<WinCOFFObjectWriter>(std::move(MOTW), OS);
+ return std::make_unique<WinCOFFObjectWriter>(std::move(MOTW), OS);
}
std::unique_ptr<MCObjectWriter>
llvm::createXCOFFObjectWriter(std::unique_ptr<MCXCOFFObjectTargetWriter> MOTW,
raw_pwrite_stream &OS) {
- return llvm::make_unique<XCOFFObjectWriter>(std::move(MOTW), OS);
+ return std::make_unique<XCOFFObjectWriter>(std::move(MOTW), OS);
}
const MCSchedModel &SM = STI.getSchedModel();
// Create the hardware units defining the backend.
- auto RCU = llvm::make_unique<RetireControlUnit>(SM);
- auto PRF = llvm::make_unique<RegisterFile>(SM, MRI, Opts.RegisterFileSize);
- auto LSU = llvm::make_unique<LSUnit>(SM, Opts.LoadQueueSize,
+ auto RCU = std::make_unique<RetireControlUnit>(SM);
+ auto PRF = std::make_unique<RegisterFile>(SM, MRI, Opts.RegisterFileSize);
+ auto LSU = std::make_unique<LSUnit>(SM, Opts.LoadQueueSize,
Opts.StoreQueueSize, Opts.AssumeNoAlias);
- auto HWS = llvm::make_unique<Scheduler>(SM, *LSU);
+ auto HWS = std::make_unique<Scheduler>(SM, *LSU);
// Create the pipeline stages.
- auto Fetch = llvm::make_unique<EntryStage>(SrcMgr);
- auto Dispatch = llvm::make_unique<DispatchStage>(STI, MRI, Opts.DispatchWidth,
+ auto Fetch = std::make_unique<EntryStage>(SrcMgr);
+ auto Dispatch = std::make_unique<DispatchStage>(STI, MRI, Opts.DispatchWidth,
*RCU, *PRF);
auto Execute =
- llvm::make_unique<ExecuteStage>(*HWS, Opts.EnableBottleneckAnalysis);
- auto Retire = llvm::make_unique<RetireStage>(*RCU, *PRF);
+ std::make_unique<ExecuteStage>(*HWS, Opts.EnableBottleneckAnalysis);
+ auto Retire = std::make_unique<RetireStage>(*RCU, *PRF);
// Pass the ownership of all the hardware units to this Context.
addHardwareUnit(std::move(RCU));
addHardwareUnit(std::move(HWS));
// Build the pipeline.
- auto StagePipeline = llvm::make_unique<Pipeline>();
+ auto StagePipeline = std::make_unique<Pipeline>();
StagePipeline->appendStage(std::move(Fetch));
if (Opts.MicroOpQueueSize)
- StagePipeline->appendStage(llvm::make_unique<MicroOpQueueStage>(
+ StagePipeline->appendStage(std::make_unique<MicroOpQueueStage>(
Opts.MicroOpQueueSize, Opts.DecodersThroughput));
StagePipeline->appendStage(std::move(Dispatch));
StagePipeline->appendStage(std::move(Execute));
static std::unique_ptr<ResourceStrategy>
getStrategyFor(const ResourceState &RS) {
if (RS.isAResourceGroup() || RS.getNumUnits() > 1)
- return llvm::make_unique<DefaultResourceStrategy>(RS.getReadyMask());
+ return std::make_unique<DefaultResourceStrategy>(RS.getReadyMask());
return std::unique_ptr<ResourceStrategy>(nullptr);
}
uint64_t Mask = ProcResID2Mask[I];
unsigned Index = getResourceStateIndex(Mask);
Resources[Index] =
- llvm::make_unique<ResourceState>(*SM.getProcResource(I), I, Mask);
+ std::make_unique<ResourceState>(*SM.getProcResource(I), I, Mask);
Strategies[Index] = getStrategyFor(*Resources[Index]);
}
void Scheduler::initializeStrategy(std::unique_ptr<SchedulerStrategy> S) {
// Ensure we have a valid (non-null) strategy object.
- Strategy = S ? std::move(S) : llvm::make_unique<DefaultSchedulerStrategy>();
+ Strategy = S ? std::move(S) : std::make_unique<DefaultSchedulerStrategy>();
}
// Anchor the vtable of SchedulerStrategy and DefaultSchedulerStrategy.
LLVM_DEBUG(dbgs() << "\t\tSchedClassID=" << SchedClassID << '\n');
// Create a new empty descriptor.
- std::unique_ptr<InstrDesc> ID = llvm::make_unique<InstrDesc>();
+ std::unique_ptr<InstrDesc> ID = std::make_unique<InstrDesc>();
ID->NumMicroOps = SCDesc.NumMicroOps;
ID->SchedClassID = SchedClassID;
if (!DescOrErr)
return DescOrErr.takeError();
const InstrDesc &D = *DescOrErr;
- std::unique_ptr<Instruction> NewIS = llvm::make_unique<Instruction>(D);
+ std::unique_ptr<Instruction> NewIS = std::make_unique<Instruction>(D);
// Check if this is a dependency breaking instruction.
APInt Mask;
if (!SM.hasNext())
return;
SourceRef SR = SM.peekNext();
- std::unique_ptr<Instruction> Inst = llvm::make_unique<Instruction>(SR.second);
+ std::unique_ptr<Instruction> Inst = std::make_unique<Instruction>(SR.second);
CurrentInstruction = InstRef(SR.first, Inst.get());
Instructions.emplace_back(std::move(Inst));
SM.updateNext();
auto Ret = ELFObjectFile<ELFT>::create(Object);
if (Error E = Ret.takeError())
return std::move(E);
- return make_unique<ELFObjectFile<ELFT>>(std::move(*Ret));
+ return std::make_unique<ELFObjectFile<ELFT>>(std::move(*Ret));
}
Expected<std::unique_ptr<ObjectFile>>
MachOObjectFile::rebaseTable(Error &Err, MachOObjectFile *O,
ArrayRef<uint8_t> Opcodes, bool is64) {
if (O->BindRebaseSectionTable == nullptr)
- O->BindRebaseSectionTable = llvm::make_unique<BindRebaseSegInfo>(O);
+ O->BindRebaseSectionTable = std::make_unique<BindRebaseSegInfo>(O);
MachORebaseEntry Start(&Err, O, Opcodes, is64);
Start.moveToFirst();
ArrayRef<uint8_t> Opcodes, bool is64,
MachOBindEntry::Kind BKind) {
if (O->BindRebaseSectionTable == nullptr)
- O->BindRebaseSectionTable = llvm::make_unique<BindRebaseSegInfo>(O);
+ O->BindRebaseSectionTable = std::make_unique<BindRebaseSegInfo>(O);
MachOBindEntry Start(&Err, O, Opcodes, is64, BKind);
Start.moveToFirst();
Expected<std::unique_ptr<WasmObjectFile>>
ObjectFile::createWasmObjectFile(MemoryBufferRef Buffer) {
Error Err = Error::success();
- auto ObjectFile = llvm::make_unique<WasmObjectFile>(Buffer, Err);
+ auto ObjectFile = std::make_unique<WasmObjectFile>(Buffer, Err);
if (Err)
return std::move(Err);
Expected<std::unique_ptr<XCOFFObjectFile>>
XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) {
- // Can't use make_unique because of the private constructor.
+ // Can't use std::make_unique because of the private constructor.
std::unique_ptr<XCOFFObjectFile> Obj;
Obj.reset(new XCOFFObjectFile(Type, MBR));
if (Doc.Sections.empty() || Doc.Sections.front()->Type != ELF::SHT_NULL)
Doc.Sections.insert(
Doc.Sections.begin(),
- llvm::make_unique<ELFYAML::Section>(
+ std::make_unique<ELFYAML::Section>(
ELFYAML::Section::SectionKind::RawContent, /*IsImplicit=*/true));
std::vector<StringRef> ImplicitSections = {".symtab", ".strtab", ".shstrtab"};
if (DocSections.count(SecName))
continue;
- std::unique_ptr<ELFYAML::Section> Sec = llvm::make_unique<ELFYAML::Section>(
+ std::unique_ptr<ELFYAML::Section> Sec = std::make_unique<ELFYAML::Section>(
ELFYAML::Section::SectionKind::RawContent, true /*IsImplicit*/);
Sec->Name = SecName;
Doc.Sections.push_back(std::move(Sec));
StreamKind Kind = getKind(Type);
switch (Kind) {
case StreamKind::MemoryList:
- return llvm::make_unique<MemoryListStream>();
+ return std::make_unique<MemoryListStream>();
case StreamKind::ModuleList:
- return llvm::make_unique<ModuleListStream>();
+ return std::make_unique<ModuleListStream>();
case StreamKind::RawContent:
- return llvm::make_unique<RawContentStream>(Type);
+ return std::make_unique<RawContentStream>(Type);
case StreamKind::SystemInfo:
- return llvm::make_unique<SystemInfoStream>();
+ return std::make_unique<SystemInfoStream>();
case StreamKind::TextContent:
- return llvm::make_unique<TextContentStream>(Type);
+ return std::make_unique<TextContentStream>(Type);
case StreamKind::ThreadList:
- return llvm::make_unique<ThreadListStream>();
+ return std::make_unique<ThreadListStream>();
}
llvm_unreachable("Unhandled stream kind!");
}
return ExpectedContent.takeError();
Ranges.push_back({MD, *ExpectedContent});
}
- return llvm::make_unique<MemoryListStream>(std::move(Ranges));
+ return std::make_unique<MemoryListStream>(std::move(Ranges));
}
case StreamKind::ModuleList: {
auto ExpectedList = File.getModuleList();
Modules.push_back(
{M, std::move(*ExpectedName), *ExpectedCv, *ExpectedMisc});
}
- return llvm::make_unique<ModuleListStream>(std::move(Modules));
+ return std::make_unique<ModuleListStream>(std::move(Modules));
}
case StreamKind::RawContent:
- return llvm::make_unique<RawContentStream>(StreamDesc.Type,
+ return std::make_unique<RawContentStream>(StreamDesc.Type,
File.getRawStream(StreamDesc));
case StreamKind::SystemInfo: {
auto ExpectedInfo = File.getSystemInfo();
auto ExpectedCSDVersion = File.getString(ExpectedInfo->CSDVersionRVA);
if (!ExpectedCSDVersion)
return ExpectedInfo.takeError();
- return llvm::make_unique<SystemInfoStream>(*ExpectedInfo,
+ return std::make_unique<SystemInfoStream>(*ExpectedInfo,
std::move(*ExpectedCSDVersion));
}
case StreamKind::TextContent:
- return llvm::make_unique<TextContentStream>(
+ return std::make_unique<TextContentStream>(
StreamDesc.Type, toStringRef(File.getRawStream(StreamDesc)));
case StreamKind::ThreadList: {
auto ExpectedList = File.getThreadList();
return ExpectedContext.takeError();
Threads.push_back({T, *ExpectedStack, *ExpectedContext});
}
- return llvm::make_unique<ThreadListStream>(std::move(Threads));
+ return std::make_unique<ThreadListStream>(std::move(Threads));
}
}
llvm_unreachable("Unhandled stream kind!");
Arg *DerivedArgList::MakeFlagArg(const Arg *BaseArg, const Option Opt) const {
SynthesizedArgs.push_back(
- make_unique<Arg>(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()),
+ std::make_unique<Arg>(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()),
BaseArgs.MakeIndex(Opt.getName()), BaseArg));
return SynthesizedArgs.back().get();
}
StringRef Value) const {
unsigned Index = BaseArgs.MakeIndex(Value);
SynthesizedArgs.push_back(
- make_unique<Arg>(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()),
+ std::make_unique<Arg>(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()),
Index, BaseArgs.getArgString(Index), BaseArg));
return SynthesizedArgs.back().get();
}
StringRef Value) const {
unsigned Index = BaseArgs.MakeIndex(Opt.getName(), Value);
SynthesizedArgs.push_back(
- make_unique<Arg>(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()),
+ std::make_unique<Arg>(Opt, MakeArgString(Opt.getPrefix() + Opt.getName()),
Index, BaseArgs.getArgString(Index + 1), BaseArg));
return SynthesizedArgs.back().get();
}
Arg *DerivedArgList::MakeJoinedArg(const Arg *BaseArg, const Option Opt,
StringRef Value) const {
unsigned Index = BaseArgs.MakeIndex((Opt.getName() + Value).str());
- SynthesizedArgs.push_back(make_unique<Arg>(
+ SynthesizedArgs.push_back(std::make_unique<Arg>(
Opt, MakeArgString(Opt.getPrefix() + Opt.getName()), Index,
BaseArgs.getArgString(Index) + Opt.getName().size(), BaseArg));
return SynthesizedArgs.back().get();
switch (Version) {
case CovMapVersion::Version1:
- return llvm::make_unique<VersionedCovMapFuncRecordReader<
+ return std::make_unique<VersionedCovMapFuncRecordReader<
CovMapVersion::Version1, IntPtrT, Endian>>(P, R, F);
case CovMapVersion::Version2:
case CovMapVersion::Version3:
if (Error E = P.create(P.getNameData()))
return std::move(E);
if (Version == CovMapVersion::Version2)
- return llvm::make_unique<VersionedCovMapFuncRecordReader<
+ return std::make_unique<VersionedCovMapFuncRecordReader<
CovMapVersion::Version2, IntPtrT, Endian>>(P, R, F);
else
- return llvm::make_unique<VersionedCovMapFuncRecordReader<
+ return std::make_unique<VersionedCovMapFuncRecordReader<
CovMapVersion::Version3, IntPtrT, Endian>>(P, R, F);
}
llvm_unreachable("Unsupported version");
while (true) {
if (!Buffer.readFunctionTag())
break;
- auto GFun = make_unique<GCOVFunction>(*this);
+ auto GFun = std::make_unique<GCOVFunction>(*this);
if (!GFun->readGCNO(Buffer, Version))
return false;
Functions.push_back(std::move(GFun));
for (uint32_t i = 0, e = BlockCount; i != e; ++i) {
if (!Buff.readInt(Dummy))
return false; // Block flags;
- Blocks.push_back(make_unique<GCOVBlock>(*this, i));
+ Blocks.push_back(std::make_unique<GCOVBlock>(*this, i));
}
// read edges.
uint32_t Dst;
if (!Buff.readInt(Dst))
return false;
- Edges.push_back(make_unique<GCOVEdge>(*Blocks[BlockNo], *Blocks[Dst]));
+ Edges.push_back(std::make_unique<GCOVEdge>(*Blocks[BlockNo], *Blocks[Dst]));
GCOVEdge *Edge = Edges.back().get();
Blocks[BlockNo]->addDstEdge(Edge);
Blocks[Dst]->addSrcEdge(Edge);
std::unique_ptr<raw_ostream>
FileInfo::openCoveragePath(StringRef CoveragePath) {
if (Options.NoOutput)
- return llvm::make_unique<raw_null_ostream>();
+ return std::make_unique<raw_null_ostream>();
std::error_code EC;
auto OS =
- llvm::make_unique<raw_fd_ostream>(CoveragePath, EC, sys::fs::OF_Text);
+ std::make_unique<raw_fd_ostream>(CoveragePath, EC, sys::fs::OF_Text);
if (EC) {
errs() << EC.message() << "\n";
- return llvm::make_unique<raw_null_ostream>();
+ return std::make_unique<raw_null_ostream>();
}
return std::move(OS);
}
// Create the reader.
if (!IndexedInstrProfReader::hasFormat(*Buffer))
return make_error<InstrProfError>(instrprof_error::bad_magic);
- auto Result = llvm::make_unique<IndexedInstrProfReader>(
+ auto Result = std::make_unique<IndexedInstrProfReader>(
std::move(Buffer), std::move(RemappingBuffer));
// Initialize the reader and return the result.
NamesStart = Start + NamesOffset;
ValueDataStart = reinterpret_cast<const uint8_t *>(Start + ValueDataOffset);
- std::unique_ptr<InstrProfSymtab> NewSymtab = make_unique<InstrProfSymtab>();
+ std::unique_ptr<InstrProfSymtab> NewSymtab = std::make_unique<InstrProfSymtab>();
if (Error E = createSymtab(*NewSymtab.get()))
return E;
UseCS ? this->CS_Summary : this->Summary;
// initialize InstrProfSummary using the SummaryData from disk.
- Summary = llvm::make_unique<ProfileSummary>(
+ Summary = std::make_unique<ProfileSummary>(
UseCS ? ProfileSummary::PSK_CSInstr : ProfileSummary::PSK_Instr,
DetailedSummary, SummaryData->get(Summary::TotalBlockCount),
SummaryData->get(Summary::MaxBlockCount),
// The rest of the file is an on disk hash table.
auto IndexPtr =
- llvm::make_unique<InstrProfReaderIndex<OnDiskHashTableImplV3>>(
+ std::make_unique<InstrProfReaderIndex<OnDiskHashTableImplV3>>(
Start + HashOffset, Cur, Start, HashType, FormatVersion);
// Load the remapping table now if requested.
if (RemappingBuffer) {
- Remapper = llvm::make_unique<
+ Remapper = std::make_unique<
InstrProfReaderItaniumRemapper<OnDiskHashTableImplV3>>(
std::move(RemappingBuffer), *IndexPtr);
if (Error E = Remapper->populateRemappings())
return E;
} else {
- Remapper = llvm::make_unique<InstrProfReaderNullRemapper>(*IndexPtr);
+ Remapper = std::make_unique<InstrProfReaderNullRemapper>(*IndexPtr);
}
Index = std::move(IndexPtr);
if (Symtab.get())
return *Symtab.get();
- std::unique_ptr<InstrProfSymtab> NewSymtab = make_unique<InstrProfSymtab>();
+ std::unique_ptr<InstrProfSymtab> NewSymtab = std::make_unique<InstrProfSymtab>();
if (Error E = Index->populateSymtab(*NewSymtab.get())) {
consumeError(error(InstrProfError::take(std::move(E))));
}
std::unique_ptr<ProfileSummary> SampleProfileSummaryBuilder::getSummary() {
computeDetailedSummary();
- return llvm::make_unique<ProfileSummary>(
+ return std::make_unique<ProfileSummary>(
ProfileSummary::PSK_Sample, DetailedSummary, TotalCount, MaxCount, 0,
MaxFunctionCount, NumCounts, NumFunctions);
}
std::unique_ptr<ProfileSummary> InstrProfSummaryBuilder::getSummary() {
computeDetailedSummary();
- return llvm::make_unique<ProfileSummary>(
+ return std::make_unique<ProfileSummary>(
ProfileSummary::PSK_Instr, DetailedSummary, TotalCount, MaxCount,
MaxInternalBlockCount, MaxFunctionCount, NumCounts, NumFunctions);
}
if (EC != sampleprof_error::success)
return EC;
}
- Summary = llvm::make_unique<ProfileSummary>(
+ Summary = std::make_unique<ProfileSummary>(
ProfileSummary::PSK_Sample, Entries, *TotalCount, *MaxBlockCount, 0,
*MaxFunctionCount, *NumBlocks, *NumFunctions);
auto BufferOrError = setupMemoryBuffer(Filename);
if (std::error_code EC = BufferOrError.getError())
return EC;
- return llvm::make_unique<SampleProfileReaderItaniumRemapper>(
+ return std::make_unique<SampleProfileReaderItaniumRemapper>(
std::move(BufferOrError.get()), C, std::move(Underlying));
}
BitstreamRemarkContainerType::SeparateRemarksMeta);
bool IsStandalone =
Helper.ContainerType == BitstreamRemarkContainerType::Standalone;
- return llvm::make_unique<BitstreamMetaSerializer>(
+ return std::make_unique<BitstreamMetaSerializer>(
OS,
IsStandalone ? BitstreamRemarkContainerType::Standalone
: BitstreamRemarkContainerType::SeparateRemarksMeta,
llvm::remarks::createRemarkParser(Format ParserFormat, StringRef Buf) {
switch (ParserFormat) {
case Format::YAML:
- return llvm::make_unique<YAMLRemarkParser>(Buf);
+ return std::make_unique<YAMLRemarkParser>(Buf);
case Format::YAMLStrTab:
return createStringError(
std::make_error_code(std::errc::invalid_argument),
"The YAML format can't be used with a string "
"table. Use yaml-strtab instead.");
case Format::YAMLStrTab:
- return llvm::make_unique<YAMLStrTabRemarkParser>(Buf, std::move(StrTab));
+ return std::make_unique<YAMLStrTabRemarkParser>(Buf, std::move(StrTab));
case Format::Bitstream:
return createStringError(std::make_error_code(std::errc::invalid_argument),
"Parsing bitstream remarks is not supported.");
return createStringError(std::errc::invalid_argument,
"Unknown remark serializer format.");
case Format::YAML:
- return llvm::make_unique<YAMLRemarkSerializer>(OS, Mode);
+ return std::make_unique<YAMLRemarkSerializer>(OS, Mode);
case Format::YAMLStrTab:
- return llvm::make_unique<YAMLStrTabRemarkSerializer>(OS, Mode);
+ return std::make_unique<YAMLStrTabRemarkSerializer>(OS, Mode);
case Format::Bitstream:
- return llvm::make_unique<BitstreamRemarkSerializer>(OS, Mode);
+ return std::make_unique<BitstreamRemarkSerializer>(OS, Mode);
}
llvm_unreachable("Unknown remarks::Format enum");
}
"Unable to use a string table with the yaml "
"format. Use 'yaml-strtab' instead.");
case Format::YAMLStrTab:
- return llvm::make_unique<YAMLStrTabRemarkSerializer>(OS, Mode,
+ return std::make_unique<YAMLStrTabRemarkSerializer>(OS, Mode,
std::move(StrTab));
case Format::Bitstream:
- return llvm::make_unique<BitstreamRemarkSerializer>(OS, Mode,
+ return std::make_unique<BitstreamRemarkSerializer>(OS, Mode,
std::move(StrTab));
}
llvm_unreachable("Unknown remarks::Format enum");
std::unique_ptr<YAMLRemarkParser> Result =
StrTab
- ? llvm::make_unique<YAMLStrTabRemarkParser>(Buf, std::move(*StrTab))
- : llvm::make_unique<YAMLRemarkParser>(Buf);
+ ? std::make_unique<YAMLStrTabRemarkParser>(Buf, std::move(*StrTab))
+ : std::make_unique<YAMLRemarkParser>(Buf);
if (SeparateBuf)
Result->SeparateBuf = std::move(SeparateBuf);
return std::move(Result);
if (!Root)
return error("document root is not of mapping type.", *YAMLRoot);
- std::unique_ptr<Remark> Result = llvm::make_unique<Remark>();
+ std::unique_ptr<Remark> Result = std::make_unique<Remark>();
Remark &TheRemark = *Result;
// First, the type. It needs special handling since is not part of the
std::unique_ptr<MetaSerializer>
YAMLRemarkSerializer::metaSerializer(raw_ostream &OS,
Optional<StringRef> ExternalFilename) {
- return llvm::make_unique<YAMLMetaSerializer>(OS, ExternalFilename);
+ return std::make_unique<YAMLMetaSerializer>(OS, ExternalFilename);
}
std::unique_ptr<MetaSerializer> YAMLStrTabRemarkSerializer::metaSerializer(
raw_ostream &OS, Optional<StringRef> ExternalFilename) {
assert(StrTab);
- return llvm::make_unique<YAMLStrTabMetaSerializer>(OS, ExternalFilename,
+ return std::make_unique<YAMLStrTabMetaSerializer>(OS, ExternalFilename,
std::move(*StrTab));
}
std::error_code EC;
sys::fs::OpenFlags OpenFlags = sys::fs::OF_Append;
std::unique_ptr<ToolOutputFile> CoverageFile =
- llvm::make_unique<ToolOutputFile>(CoverageFilename, EC, OpenFlags);
+ std::make_unique<ToolOutputFile>(CoverageFilename, EC, OpenFlags);
if (EC)
return false;
Error errorCodeToError(std::error_code EC) {
if (!EC)
return Error::success();
- return Error(llvm::make_unique<ECError>(ECError(EC)));
+ return Error(std::make_unique<ECError>(ECError(EC)));
}
std::error_code errorToErrorCode(Error Err) {
"numeric variable '" + Name +
"' defined from input on the same line as used");
- return llvm::make_unique<FileCheckNumericVariableUse>(Name, NumericVariable);
+ return std::make_unique<FileCheckNumericVariableUse>(Name, NumericVariable);
}
Expected<std::unique_ptr<FileCheckExpressionAST>>
// Otherwise, parse it as a literal.
uint64_t LiteralValue;
if (!Expr.consumeInteger(/*Radix=*/10, LiteralValue))
- return llvm::make_unique<FileCheckExpressionLiteral>(LiteralValue);
+ return std::make_unique<FileCheckExpressionLiteral>(LiteralValue);
return FileCheckErrorDiagnostic::get(SM, Expr,
"invalid operand format '" + Expr + "'");
return RightOpResult;
Expr = Expr.ltrim(SpaceChars);
- return llvm::make_unique<FileCheckASTBinop>(EvalBinop, std::move(LeftOp),
+ return std::make_unique<FileCheckASTBinop>(EvalBinop, std::move(LeftOp),
std::move(*RightOpResult));
}
FileCheckNumericVariable *
FileCheckPatternContext::makeNumericVariable(Types... args) {
NumericVariables.push_back(
- llvm::make_unique<FileCheckNumericVariable>(args...));
+ std::make_unique<FileCheckNumericVariable>(args...));
return NumericVariables.back().get();
}
FileCheckPatternContext::makeStringSubstitution(StringRef VarName,
size_t InsertIdx) {
Substitutions.push_back(
- llvm::make_unique<FileCheckStringSubstitution>(this, VarName, InsertIdx));
+ std::make_unique<FileCheckStringSubstitution>(this, VarName, InsertIdx));
return Substitutions.back().get();
}
FileCheckSubstitution *FileCheckPatternContext::makeNumericSubstitution(
StringRef ExpressionStr,
std::unique_ptr<FileCheckExpressionAST> ExpressionAST, size_t InsertIdx) {
- Substitutions.push_back(llvm::make_unique<FileCheckNumericSubstitution>(
+ Substitutions.push_back(std::make_unique<FileCheckNumericSubstitution>(
this, ExpressionStr, std::move(ExpressionAST), InsertIdx));
return Substitutions.back().get();
}
Size, nullptr, sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC);
if (EC)
return errorCodeToError(EC);
- return llvm::make_unique<InMemoryBuffer>(Path, MB, Size, Mode);
+ return std::make_unique<InMemoryBuffer>(Path, MB, Size, Mode);
}
static Expected<std::unique_ptr<FileOutputBuffer>>
// Mmap it.
std::error_code EC;
- auto MappedFile = llvm::make_unique<fs::mapped_file_region>(
+ auto MappedFile = std::make_unique<fs::mapped_file_region>(
fs::convertFDToNativeFile(File.FD), fs::mapped_file_region::readwrite,
Size, 0, EC);
return createInMemoryBuffer(Path, Size, Mode);
}
- return llvm::make_unique<OnDiskBuffer>(Path, std::move(File),
+ return std::make_unique<OnDiskBuffer>(Path, std::move(File),
std::move(MappedFile));
}
}
}
Err.emplace(
- llvm::make_unique<ParseError>(Msg, Line, P - StartOfLine, P - Start));
+ std::make_unique<ParseError>(Msg, Line, P - StartOfLine, P - Start));
return false;
}
} // namespace
return false;
RegExes.emplace_back(
- std::make_pair(make_unique<Regex>(std::move(CheckRE)), LineNumber));
+ std::make_pair(std::make_unique<Regex>(std::move(CheckRE)), LineNumber));
return true;
}
// Create this section if it has not been seen before.
if (SectionsMap.find(Section) == SectionsMap.end()) {
- std::unique_ptr<Matcher> M = make_unique<Matcher>();
+ std::unique_ptr<Matcher> M = std::make_unique<Matcher>();
std::string REError;
if (!M->insert(Section, LineNo, REError)) {
Error = (Twine("malformed section ") + Section + ": '" + REError).str();
std::unique_ptr<raw_fd_ostream> llvm::CreateInfoOutputFile() {
const std::string &OutputFilename = getLibSupportInfoOutputFilename();
if (OutputFilename.empty())
- return llvm::make_unique<raw_fd_ostream>(2, false); // stderr.
+ return std::make_unique<raw_fd_ostream>(2, false); // stderr.
if (OutputFilename == "-")
- return llvm::make_unique<raw_fd_ostream>(1, false); // stdout.
+ return std::make_unique<raw_fd_ostream>(1, false); // stdout.
// Append mode is used because the info output file is opened and closed
// each time -stats or -time-passes wants to print output to it. To
// compensate for this, the test-suite Makefiles have code to delete the
// info output file before running commands which write to it.
std::error_code EC;
- auto Result = llvm::make_unique<raw_fd_ostream>(
+ auto Result = std::make_unique<raw_fd_ostream>(
OutputFilename, EC, sys::fs::OF_Append | sys::fs::OF_Text);
if (!EC)
return Result;
errs() << "Error opening info-output-file '"
<< OutputFilename << " for appending!\n";
- return llvm::make_unique<raw_fd_ostream>(2, false); // stderr.
+ return std::make_unique<raw_fd_ostream>(2, false); // stderr.
}
namespace {
std::unique_ptr<char[]> Buf;
int Tries = 3;
while (Tries--) {
- Buf = llvm::make_unique<char[]>(BufSize);
+ Buf = std::make_unique<char[]>(BufSize);
Ret = mntctl(MCTL_QUERY, BufSize, Buf.get());
if (Ret != 0)
break;
}
std::unique_ptr<FileSystem> vfs::createPhysicalFileSystem() {
- return llvm::make_unique<RealFileSystem>(false);
+ return std::make_unique<RealFileSystem>(false);
}
namespace {
ResolvedUser, ResolvedGroup, 0, sys::fs::file_type::directory_file,
NewDirectoryPerms);
Dir = cast<detail::InMemoryDirectory>(Dir->addChild(
- Name, llvm::make_unique<detail::InMemoryDirectory>(std::move(Stat))));
+ Name, std::make_unique<detail::InMemoryDirectory>(std::move(Stat))));
continue;
}
// ... or create a new one
std::unique_ptr<RedirectingFileSystem::Entry> E =
- llvm::make_unique<RedirectingFileSystem::RedirectingDirectoryEntry>(
+ std::make_unique<RedirectingFileSystem::RedirectingDirectoryEntry>(
Name, Status("", getNextVirtualUniqueID(),
std::chrono::system_clock::now(), 0, 0, 0,
file_type::directory_file, sys::fs::all_all));
auto *DE = dyn_cast<RedirectingFileSystem::RedirectingDirectoryEntry>(
NewParentE);
DE->addContent(
- llvm::make_unique<RedirectingFileSystem::RedirectingFileEntry>(
+ std::make_unique<RedirectingFileSystem::RedirectingFileEntry>(
Name, FE->getExternalContentsPath(), FE->getUseName()));
break;
}
std::unique_ptr<RedirectingFileSystem::Entry> Result;
switch (Kind) {
case RedirectingFileSystem::EK_File:
- Result = llvm::make_unique<RedirectingFileSystem::RedirectingFileEntry>(
+ Result = std::make_unique<RedirectingFileSystem::RedirectingFileEntry>(
LastComponent, std::move(ExternalContentsPath), UseExternalName);
break;
case RedirectingFileSystem::EK_Directory:
Result =
- llvm::make_unique<RedirectingFileSystem::RedirectingDirectoryEntry>(
+ std::make_unique<RedirectingFileSystem::RedirectingDirectoryEntry>(
LastComponent, std::move(EntryArrayContents),
Status("", getNextVirtualUniqueID(),
std::chrono::system_clock::now(), 0, 0, 0,
std::vector<std::unique_ptr<RedirectingFileSystem::Entry>> Entries;
Entries.push_back(std::move(Result));
Result =
- llvm::make_unique<RedirectingFileSystem::RedirectingDirectoryEntry>(
+ std::make_unique<RedirectingFileSystem::RedirectingDirectoryEntry>(
*I, std::move(Entries),
Status("", getNextVirtualUniqueID(),
std::chrono::system_clock::now(), 0, 0, 0,
Status S = getRedirectedFileStatus(Path, F->useExternalName(UseExternalNames),
*ExternalStatus);
return std::unique_ptr<File>(
- llvm::make_unique<FileWithFixedStatus>(std::move(*Result), S));
+ std::make_unique<FileWithFixedStatus>(std::move(*Result), S));
}
std::error_code
// Copy string to permanent storage
KeyStr = StringStorage.str().copy(StringAllocator);
}
- return llvm::make_unique<ScalarHNode>(N, KeyStr);
+ return std::make_unique<ScalarHNode>(N, KeyStr);
} else if (BlockScalarNode *BSN = dyn_cast<BlockScalarNode>(N)) {
StringRef ValueCopy = BSN->getValue().copy(StringAllocator);
- return llvm::make_unique<ScalarHNode>(N, ValueCopy);
+ return std::make_unique<ScalarHNode>(N, ValueCopy);
} else if (SequenceNode *SQ = dyn_cast<SequenceNode>(N)) {
- auto SQHNode = llvm::make_unique<SequenceHNode>(N);
+ auto SQHNode = std::make_unique<SequenceHNode>(N);
for (Node &SN : *SQ) {
auto Entry = createHNodes(&SN);
if (EC)
}
return std::move(SQHNode);
} else if (MappingNode *Map = dyn_cast<MappingNode>(N)) {
- auto mapHNode = llvm::make_unique<MapHNode>(N);
+ auto mapHNode = std::make_unique<MapHNode>(N);
for (KeyValueNode &KVN : *Map) {
Node *KeyNode = KVN.getKey();
ScalarNode *Key = dyn_cast<ScalarNode>(KeyNode);
}
return std::move(mapHNode);
} else if (isa<NullNode>(N)) {
- return llvm::make_unique<EmptyHNode>(N);
+ return std::make_unique<EmptyHNode>(N);
} else {
setError(N, "unknown node kind");
return nullptr;
llvm::SMTSolverRef llvm::CreateZ3Solver() {
#if LLVM_WITH_Z3
- return llvm::make_unique<Z3Solver>();
+ return std::make_unique<Z3Solver>();
#else
llvm::report_fatal_error("LLVM was not compiled with Z3 support, rebuild "
"with -DLLVM_ENABLE_Z3_SOLVER=ON",
DefInit *VarDefInit::instantiate() {
if (!Def) {
RecordKeeper &Records = Class->getRecords();
- auto NewRecOwner = make_unique<Record>(Records.getNewAnonymousName(),
+ auto NewRecOwner = std::make_unique<Record>(Records.getNewAnonymousName(),
Class->getLoc(), Records,
/*IsAnonymous=*/true);
Record *NewRec = NewRecOwner.get();
void SetTheory::Expander::anchor() {}
SetTheory::SetTheory() {
- addOperator("add", llvm::make_unique<AddOp>());
- addOperator("sub", llvm::make_unique<SubOp>());
- addOperator("and", llvm::make_unique<AndOp>());
- addOperator("shl", llvm::make_unique<ShlOp>());
- addOperator("trunc", llvm::make_unique<TruncOp>());
- addOperator("rotl", llvm::make_unique<RotOp>(false));
- addOperator("rotr", llvm::make_unique<RotOp>(true));
- addOperator("decimate", llvm::make_unique<DecimateOp>());
- addOperator("interleave", llvm::make_unique<InterleaveOp>());
- addOperator("sequence", llvm::make_unique<SequenceOp>());
+ addOperator("add", std::make_unique<AddOp>());
+ addOperator("sub", std::make_unique<SubOp>());
+ addOperator("and", std::make_unique<AndOp>());
+ addOperator("shl", std::make_unique<ShlOp>());
+ addOperator("trunc", std::make_unique<TruncOp>());
+ addOperator("rotl", std::make_unique<RotOp>(false));
+ addOperator("rotr", std::make_unique<RotOp>(true));
+ addOperator("decimate", std::make_unique<DecimateOp>());
+ addOperator("interleave", std::make_unique<InterleaveOp>());
+ addOperator("sequence", std::make_unique<SequenceOp>());
}
void SetTheory::addOperator(StringRef Name, std::unique_ptr<Operator> Op) {
}
void SetTheory::addFieldExpander(StringRef ClassName, StringRef FieldName) {
- addExpander(ClassName, llvm::make_unique<FieldExpander>(FieldName));
+ addExpander(ClassName, std::make_unique<FieldExpander>(FieldName));
}
void SetTheory::evaluate(Init *Expr, RecSet &Elts, ArrayRef<SMLoc> Loc) {
// Pretend that we enter the "top-level" include file.
PrepIncludeStack.push_back(
- make_unique<std::vector<PreprocessorControlDesc>>());
+ std::make_unique<std::vector<PreprocessorControlDesc>>());
// Put all macros defined in the command line into the DefinedMacros set.
std::for_each(Macros.begin(), Macros.end(),
CurPtr = CurBuf.begin();
PrepIncludeStack.push_back(
- make_unique<std::vector<PreprocessorControlDesc>>());
+ std::make_unique<std::vector<PreprocessorControlDesc>>());
return false;
}
auto LI = dyn_cast<ListInit>(List);
if (!LI) {
if (!Final) {
- Dest->emplace_back(make_unique<ForeachLoop>(Loop.Loc, Loop.IterVar,
+ Dest->emplace_back(std::make_unique<ForeachLoop>(Loop.Loc, Loop.IterVar,
List));
return resolve(Loop.Entries, Substs, Final, &Dest->back().Loop->Entries,
Loc);
if (E.Loop) {
Error = resolve(*E.Loop, Substs, Final, Dest);
} else {
- auto Rec = make_unique<Record>(*E.Rec);
+ auto Rec = std::make_unique<Record>(*E.Rec);
if (Loc)
Rec->appendLoc(*Loc);
std::unique_ptr<Record> ParseRecTmp;
Record *ParseRec = CurRec;
if (!ParseRec) {
- ParseRecTmp = make_unique<Record>(".parse", ArrayRef<SMLoc>{}, Records);
+ ParseRecTmp = std::make_unique<Record>(".parse", ArrayRef<SMLoc>{}, Records);
ParseRec = ParseRecTmp.get();
}
std::unique_ptr<Record> ParseRecTmp;
Record *ParseRec = CurRec;
if (!ParseRec) {
- ParseRecTmp = make_unique<Record>(".parse", ArrayRef<SMLoc>{}, Records);
+ ParseRecTmp = std::make_unique<Record>(".parse", ArrayRef<SMLoc>{}, Records);
ParseRec = ParseRecTmp.get();
}
return true;
if (isa<UnsetInit>(Name))
- CurRec = make_unique<Record>(Records.getNewAnonymousName(), DefLoc, Records,
+ CurRec = std::make_unique<Record>(Records.getNewAnonymousName(), DefLoc, Records,
/*Anonymous=*/true);
else
- CurRec = make_unique<Record>(Name, DefLoc, Records);
+ CurRec = std::make_unique<Record>(Name, DefLoc, Records);
if (ParseObjectBody(CurRec.get()))
return true;
Lex.Lex(); // Eat the in
// Create a loop object and remember it.
- Loops.push_back(llvm::make_unique<ForeachLoop>(Loc, IterName, ListValue));
+ Loops.push_back(std::make_unique<ForeachLoop>(Loc, IterName, ListValue));
if (Lex.getCode() != tgtok::l_brace) {
// FOREACH Declaration IN Object
} else {
// If this is the first reference to this class, create and add it.
auto NewRec =
- llvm::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), Records,
+ std::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), Records,
/*Class=*/true);
CurRec = NewRec.get();
Records.addClass(std::move(NewRec));
auto Result =
MultiClasses.insert(std::make_pair(Name,
- llvm::make_unique<MultiClass>(Name, Lex.getLoc(),Records)));
+ std::make_unique<MultiClass>(Name, Lex.getLoc(),Records)));
if (!Result.second)
return TokError("multiclass '" + Name + "' already defined");
LLVM_DEBUG(dbgs() << "New chain started for register "
<< printReg(DestReg, TRI) << " at " << *MI);
- auto G = llvm::make_unique<Chain>(MI, Idx, getColor(DestReg));
+ auto G = std::make_unique<Chain>(MI, Idx, getColor(DestReg));
ActiveChains[DestReg] = G.get();
AllChains.push_back(std::move(G));
LLVM_DEBUG(dbgs() << "Creating new chain for dest register "
<< printReg(DestReg, TRI) << "\n");
- auto G = llvm::make_unique<Chain>(MI, Idx, getColor(DestReg));
+ auto G = std::make_unique<Chain>(MI, Idx, getColor(DestReg));
ActiveChains[DestReg] = G.get();
AllChains.push_back(std::move(G));
std::unique_ptr<PBQPRAConstraint>
AArch64Subtarget::getCustomPBQPConstraints() const {
- return balanceFPOps() ? llvm::make_unique<A57ChainingConstraint>() : nullptr;
+ return balanceFPOps() ? std::make_unique<A57ChainingConstraint>() : nullptr;
}
void AArch64Subtarget::mirFileLoaded(MachineFunction &MF) const {
//===----------------------------------------------------------------------===//
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
if (TT.isOSBinFormatMachO())
- return llvm::make_unique<AArch64_MachoTargetObjectFile>();
+ return std::make_unique<AArch64_MachoTargetObjectFile>();
if (TT.isOSBinFormatCOFF())
- return llvm::make_unique<AArch64_COFFTargetObjectFile>();
+ return std::make_unique<AArch64_COFFTargetObjectFile>();
- return llvm::make_unique<AArch64_ELFTargetObjectFile>();
+ return std::make_unique<AArch64_ELFTargetObjectFile>();
}
// Helper function to build a DataLayout string
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<AArch64Subtarget>(TargetTriple, CPU, FS, *this,
+ I = std::make_unique<AArch64Subtarget>(TargetTriple, CPU, FS, *this,
isLittle);
}
return I.get();
static std::unique_ptr<AArch64Operand>
CreateToken(StringRef Str, bool IsSuffix, SMLoc S, MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_Token, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_Token, Ctx);
Op->Tok.Data = Str.data();
Op->Tok.Length = Str.size();
Op->Tok.IsSuffix = IsSuffix;
AArch64_AM::ShiftExtendType ExtTy = AArch64_AM::LSL,
unsigned ShiftAmount = 0,
unsigned HasExplicitAmount = false) {
- auto Op = make_unique<AArch64Operand>(k_Register, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_Register, Ctx);
Op->Reg.RegNum = RegNum;
Op->Reg.Kind = Kind;
Op->Reg.ElementWidth = 0;
CreateVectorList(unsigned RegNum, unsigned Count, unsigned NumElements,
unsigned ElementWidth, RegKind RegisterKind, SMLoc S, SMLoc E,
MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_VectorList, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_VectorList, Ctx);
Op->VectorList.RegNum = RegNum;
Op->VectorList.Count = Count;
Op->VectorList.NumElements = NumElements;
static std::unique_ptr<AArch64Operand>
CreateVectorIndex(unsigned Idx, SMLoc S, SMLoc E, MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_VectorIndex, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_VectorIndex, Ctx);
Op->VectorIndex.Val = Idx;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<AArch64Operand> CreateImm(const MCExpr *Val, SMLoc S,
SMLoc E, MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_Immediate, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_Immediate, Ctx);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
unsigned ShiftAmount,
SMLoc S, SMLoc E,
MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_ShiftedImm, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_ShiftedImm, Ctx);
Op->ShiftedImm .Val = Val;
Op->ShiftedImm.ShiftAmount = ShiftAmount;
Op->StartLoc = S;
static std::unique_ptr<AArch64Operand>
CreateCondCode(AArch64CC::CondCode Code, SMLoc S, SMLoc E, MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_CondCode, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_CondCode, Ctx);
Op->CondCode.Code = Code;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<AArch64Operand>
CreateFPImm(APFloat Val, bool IsExact, SMLoc S, MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_FPImm, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_FPImm, Ctx);
Op->FPImm.Val = Val.bitcastToAPInt().getSExtValue();
Op->FPImm.IsExact = IsExact;
Op->StartLoc = S;
StringRef Str,
SMLoc S,
MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_Barrier, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_Barrier, Ctx);
Op->Barrier.Val = Val;
Op->Barrier.Data = Str.data();
Op->Barrier.Length = Str.size();
uint32_t MSRReg,
uint32_t PStateField,
MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_SysReg, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_SysReg, Ctx);
Op->SysReg.Data = Str.data();
Op->SysReg.Length = Str.size();
Op->SysReg.MRSReg = MRSReg;
static std::unique_ptr<AArch64Operand> CreateSysCR(unsigned Val, SMLoc S,
SMLoc E, MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_SysCR, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_SysCR, Ctx);
Op->SysCRImm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
StringRef Str,
SMLoc S,
MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_Prefetch, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_Prefetch, Ctx);
Op->Prefetch.Val = Val;
Op->Barrier.Data = Str.data();
Op->Barrier.Length = Str.size();
StringRef Str,
SMLoc S,
MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_PSBHint, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_PSBHint, Ctx);
Op->PSBHint.Val = Val;
Op->PSBHint.Data = Str.data();
Op->PSBHint.Length = Str.size();
StringRef Str,
SMLoc S,
MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_BTIHint, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_BTIHint, Ctx);
Op->BTIHint.Val = Val << 1 | 32;
Op->BTIHint.Data = Str.data();
Op->BTIHint.Length = Str.size();
static std::unique_ptr<AArch64Operand>
CreateShiftExtend(AArch64_AM::ShiftExtendType ShOp, unsigned Val,
bool HasExplicitAmount, SMLoc S, SMLoc E, MCContext &Ctx) {
- auto Op = make_unique<AArch64Operand>(k_ShiftExtend, Ctx);
+ auto Op = std::make_unique<AArch64Operand>(k_ShiftExtend, Ctx);
Op->ShiftExtend.Type = ShOp;
Op->ShiftExtend.Amount = Val;
Op->ShiftExtend.HasExplicitAmount = HasExplicitAmount;
std::unique_ptr<MCObjectTargetWriter>
llvm::createAArch64ELFObjectWriter(uint8_t OSABI, bool IsILP32) {
- return llvm::make_unique<AArch64ELFObjectWriter>(OSABI, IsILP32);
+ return std::make_unique<AArch64ELFObjectWriter>(OSABI, IsILP32);
}
std::unique_ptr<MCObjectTargetWriter>
llvm::createAArch64MachObjectWriter(uint32_t CPUType, uint32_t CPUSubtype,
bool IsILP32) {
- return llvm::make_unique<AArch64MachObjectWriter>(CPUType, CPUSubtype,
+ return std::make_unique<AArch64MachObjectWriter>(CPUType, CPUSubtype,
IsILP32);
}
namespace llvm {
std::unique_ptr<MCObjectTargetWriter> createAArch64WinCOFFObjectWriter() {
- return llvm::make_unique<AArch64WinCOFFObjectWriter>();
+ return std::make_unique<AArch64WinCOFFObjectWriter>();
}
} // end namespace llvm
class MetadataStreamerV3 final : public MetadataStreamer {
private:
std::unique_ptr<msgpack::Document> HSAMetadataDoc =
- llvm::make_unique<msgpack::Document>();
+ std::make_unique<msgpack::Document>();
void dump(StringRef HSAMetadataString) const;
}
if (eatTerm(FuncName, "_Z"))
- F.Impl = make_unique<AMDGPUMangledLibFunc>();
+ F.Impl = std::make_unique<AMDGPUMangledLibFunc>();
else
- F.Impl = make_unique<AMDGPUUnmangledLibFunc>();
+ F.Impl = std::make_unique<AMDGPUUnmangledLibFunc>();
if (F.Impl->parseFuncName(FuncName))
return true;
void GCNSubtarget::getPostRAMutations(
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
- Mutations.push_back(llvm::make_unique<MemOpClusterMutation>(&InstrInfo));
- Mutations.push_back(llvm::make_unique<FillMFMAShadowMutation>(&InstrInfo));
+ Mutations.push_back(std::make_unique<MemOpClusterMutation>(&InstrInfo));
+ Mutations.push_back(std::make_unique<FillMFMAShadowMutation>(&InstrInfo));
}
const AMDGPUSubtarget &AMDGPUSubtarget::get(const MachineFunction &MF) {
}
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
- return llvm::make_unique<AMDGPUTargetObjectFile>();
+ return std::make_unique<AMDGPUTargetObjectFile>();
}
static ScheduleDAGInstrs *createR600MachineScheduler(MachineSchedContext *C) {
- return new ScheduleDAGMILive(C, llvm::make_unique<R600SchedStrategy>());
+ return new ScheduleDAGMILive(C, std::make_unique<R600SchedStrategy>());
}
static ScheduleDAGInstrs *createSIMachineScheduler(MachineSchedContext *C) {
static ScheduleDAGInstrs *
createGCNMaxOccupancyMachineScheduler(MachineSchedContext *C) {
ScheduleDAGMILive *DAG =
- new GCNScheduleDAGMILive(C, make_unique<GCNMaxOccupancySchedStrategy>(C));
+ new GCNScheduleDAGMILive(C, std::make_unique<GCNMaxOccupancySchedStrategy>(C));
DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI));
DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI));
DAG->addMutation(createAMDGPUMacroFusionDAGMutation());
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<R600Subtarget>(TargetTriple, GPU, FS, *this);
+ I = std::make_unique<R600Subtarget>(TargetTriple, GPU, FS, *this);
}
return I.get();
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<GCNSubtarget>(TargetTriple, GPU, FS, *this);
+ I = std::make_unique<GCNSubtarget>(TargetTriple, GPU, FS, *this);
}
I->setScalarizeGlobalBehavior(ScalarizeGlobal);
int64_t Val, SMLoc Loc,
ImmTy Type = ImmTyNone,
bool IsFPImm = false) {
- auto Op = llvm::make_unique<AMDGPUOperand>(Immediate, AsmParser);
+ auto Op = std::make_unique<AMDGPUOperand>(Immediate, AsmParser);
Op->Imm.Val = Val;
Op->Imm.IsFPImm = IsFPImm;
Op->Imm.Type = Type;
static AMDGPUOperand::Ptr CreateToken(const AMDGPUAsmParser *AsmParser,
StringRef Str, SMLoc Loc,
bool HasExplicitEncodingSize = true) {
- auto Res = llvm::make_unique<AMDGPUOperand>(Token, AsmParser);
+ auto Res = std::make_unique<AMDGPUOperand>(Token, AsmParser);
Res->Tok.Data = Str.data();
Res->Tok.Length = Str.size();
Res->StartLoc = Loc;
static AMDGPUOperand::Ptr CreateReg(const AMDGPUAsmParser *AsmParser,
unsigned RegNo, SMLoc S,
SMLoc E) {
- auto Op = llvm::make_unique<AMDGPUOperand>(Register, AsmParser);
+ auto Op = std::make_unique<AMDGPUOperand>(Register, AsmParser);
Op->Reg.RegNo = RegNo;
Op->Reg.Mods = Modifiers();
Op->StartLoc = S;
static AMDGPUOperand::Ptr CreateExpr(const AMDGPUAsmParser *AsmParser,
const class MCExpr *Expr, SMLoc S) {
- auto Op = llvm::make_unique<AMDGPUOperand>(Expression, AsmParser);
+ auto Op = std::make_unique<AMDGPUOperand>(Expression, AsmParser);
Op->Expr = Expr;
Op->StartLoc = S;
Op->EndLoc = S;
GCNIterativeScheduler::GCNIterativeScheduler(MachineSchedContext *C,
StrategyKind S)
- : BaseClass(C, llvm::make_unique<SchedStrategyStub>())
+ : BaseClass(C, std::make_unique<SchedStrategyStub>())
, Context(C)
, Strategy(S)
, UPTracker(*LIS) {
llvm::createAMDGPUELFObjectWriter(bool Is64Bit, uint8_t OSABI,
bool HasRelocationAddend,
uint8_t ABIVersion) {
- return llvm::make_unique<AMDGPUELFObjectWriter>(Is64Bit, OSABI,
+ return std::make_unique<AMDGPUELFObjectWriter>(Is64Bit, OSABI,
HasRelocationAddend,
ABIVersion);
}
if (BI.Incoming) {
if (!Brackets)
- Brackets = llvm::make_unique<WaitcntBrackets>(*BI.Incoming);
+ Brackets = std::make_unique<WaitcntBrackets>(*BI.Incoming);
else
*Brackets = *BI.Incoming;
} else {
if (!Brackets)
- Brackets = llvm::make_unique<WaitcntBrackets>(ST);
+ Brackets = std::make_unique<WaitcntBrackets>(ST);
else
Brackets->clear();
}
if (!MoveBracketsToSucc) {
MoveBracketsToSucc = &SuccBI;
} else {
- SuccBI.Incoming = llvm::make_unique<WaitcntBrackets>(*Brackets);
+ SuccBI.Incoming = std::make_unique<WaitcntBrackets>(*Brackets);
}
} else if (SuccBI.Incoming->merge(*Brackets)) {
SuccBI.Dirty = true;
assert(BufferRsrc);
auto PSV = BufferPSVs.try_emplace(
BufferRsrc,
- llvm::make_unique<AMDGPUBufferPseudoSourceValue>(TII));
+ std::make_unique<AMDGPUBufferPseudoSourceValue>(TII));
return PSV.first->second.get();
}
assert(ImgRsrc);
auto PSV = ImagePSVs.try_emplace(
ImgRsrc,
- llvm::make_unique<AMDGPUImagePseudoSourceValue>(TII));
+ std::make_unique<AMDGPUImagePseudoSourceValue>(TII));
return PSV.first->second.get();
}
const AMDGPUGWSResourcePseudoSourceValue *getGWSPSV(const SIInstrInfo &TII) {
if (!GWSResourcePSV) {
GWSResourcePSV =
- llvm::make_unique<AMDGPUGWSResourcePseudoSourceValue>(TII);
+ std::make_unique<AMDGPUGWSResourcePseudoSourceValue>(TII);
}
return GWSResourcePSV.get();
unsigned Color = CurrentColoring[SU->NodeNum];
if (RealID.find(Color) == RealID.end()) {
int ID = CurrentBlocks.size();
- BlockPtrs.push_back(llvm::make_unique<SIScheduleBlock>(DAG, this, ID));
+ BlockPtrs.push_back(std::make_unique<SIScheduleBlock>(DAG, this, ID));
CurrentBlocks.push_back(BlockPtrs.rbegin()->get());
RealID[Color] = ID;
}
// SIScheduleDAGMI //
SIScheduleDAGMI::SIScheduleDAGMI(MachineSchedContext *C) :
- ScheduleDAGMILive(C, llvm::make_unique<GenericScheduler>(C)) {
+ ScheduleDAGMILive(C, std::make_unique<GenericScheduler>(C)) {
SITII = static_cast<const SIInstrInfo*>(TII);
SITRI = static_cast<const SIRegisterInfo*>(TRI);
std::unique_ptr<SICacheControl> SICacheControl::create(const GCNSubtarget &ST) {
GCNSubtarget::Generation Generation = ST.getGeneration();
if (Generation <= AMDGPUSubtarget::SOUTHERN_ISLANDS)
- return make_unique<SIGfx6CacheControl>(ST);
+ return std::make_unique<SIGfx6CacheControl>(ST);
if (Generation < AMDGPUSubtarget::GFX10)
- return make_unique<SIGfx7CacheControl>(ST);
- return make_unique<SIGfx10CacheControl>(ST, ST.isCuModeEnabled());
+ return std::make_unique<SIGfx7CacheControl>(ST);
+ return std::make_unique<SIGfx10CacheControl>(ST, ST.isCuModeEnabled());
}
bool SIGfx6CacheControl::enableLoadCacheBypass(
// - on exit we have set the Require, Change, and initial Exit modes.
void SIModeRegister::processBlockPhase1(MachineBasicBlock &MBB,
const SIInstrInfo *TII) {
- auto NewInfo = llvm::make_unique<BlockData>();
+ auto NewInfo = std::make_unique<BlockData>();
MachineInstr *InsertionPoint = nullptr;
// RequirePending is used to indicate whether we are collecting the initial
// requirements for the block, and need to defer the first InsertionPoint to
if (Opcode == AMDGPU::V_LSHLREV_B32_e32 ||
Opcode == AMDGPU::V_LSHLREV_B32_e64) {
- return make_unique<SDWADstOperand>(
+ return std::make_unique<SDWADstOperand>(
Dst, Src1, *Imm == 16 ? WORD_1 : BYTE_3, UNUSED_PAD);
} else {
- return make_unique<SDWASrcOperand>(
+ return std::make_unique<SDWASrcOperand>(
Src1, Dst, *Imm == 16 ? WORD_1 : BYTE_3, false, false,
Opcode != AMDGPU::V_LSHRREV_B32_e32 &&
Opcode != AMDGPU::V_LSHRREV_B32_e64);
if (Opcode == AMDGPU::V_LSHLREV_B16_e32 ||
Opcode == AMDGPU::V_LSHLREV_B16_e64) {
- return make_unique<SDWADstOperand>(Dst, Src1, BYTE_1, UNUSED_PAD);
+ return std::make_unique<SDWADstOperand>(Dst, Src1, BYTE_1, UNUSED_PAD);
} else {
- return make_unique<SDWASrcOperand>(
+ return std::make_unique<SDWASrcOperand>(
Src1, Dst, BYTE_1, false, false,
Opcode != AMDGPU::V_LSHRREV_B16_e32 &&
Opcode != AMDGPU::V_LSHRREV_B16_e64);
Register::isPhysicalRegister(Dst->getReg()))
break;
- return make_unique<SDWASrcOperand>(
+ return std::make_unique<SDWASrcOperand>(
Src0, Dst, SrcSel, false, false, Opcode != AMDGPU::V_BFE_U32);
}
Register::isPhysicalRegister(Dst->getReg()))
break;
- return make_unique<SDWASrcOperand>(
+ return std::make_unique<SDWASrcOperand>(
ValSrc, Dst, *Imm == 0x0000ffff ? WORD_0 : BYTE_0);
}
MachineOperand *OrDst = TII->getNamedOperand(MI, AMDGPU::OpName::vdst);
assert(OrDst && OrDst->isReg());
- return make_unique<SDWADstPreserveOperand>(
+ return std::make_unique<SDWADstPreserveOperand>(
OrDst, OrSDWADef, OrOtherDef, DstSel);
}
"f32:32:32-i64:32-f64:32-a:0:32-n32",
TT, CPU, FS, Options, getRelocModel(RM),
getEffectiveCodeModel(CM, CodeModel::Small), OL),
- TLOF(make_unique<TargetLoweringObjectFileELF>()),
+ TLOF(std::make_unique<TargetLoweringObjectFileELF>()),
Subtarget(TT, CPU, FS, *this) {
initAsmInfo();
}
/// Record a MulCandidate, rooted at a Mul instruction, that is a part of
/// this reduction.
void InsertMul(Instruction *I, Value *LHS, Value *RHS) {
- Muls.push_back(make_unique<MulCandidate>(I, LHS, RHS));
+ Muls.push_back(std::make_unique<MulCandidate>(I, LHS, RHS));
}
/// Add the incoming accumulator value, returns true if a value had not
OffsetSExt->replaceAllUsesWith(NewOffsetSExt);
WideLoads.emplace(std::make_pair(Base,
- make_unique<WidenedLoad>(Loads, WideLoad)));
+ std::make_unique<WidenedLoad>(Loads, WideLoad)));
return WideLoad;
}
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
if (TT.isOSBinFormatMachO())
- return llvm::make_unique<TargetLoweringObjectFileMachO>();
+ return std::make_unique<TargetLoweringObjectFileMachO>();
if (TT.isOSWindows())
- return llvm::make_unique<TargetLoweringObjectFileCOFF>();
- return llvm::make_unique<ARMElfTargetObjectFile>();
+ return std::make_unique<TargetLoweringObjectFileCOFF>();
+ return std::make_unique<ARMElfTargetObjectFile>();
}
static ARMBaseTargetMachine::ARMABI
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<ARMSubtarget>(TargetTriple, CPU, FS, *this, isLittle,
+ I = std::make_unique<ARMSubtarget>(TargetTriple, CPU, FS, *this, isLittle,
F.hasMinSize());
if (!I->isThumb() && !I->hasARMOps())
void print(raw_ostream &OS) const override;
static std::unique_ptr<ARMOperand> CreateITMask(unsigned Mask, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_ITCondMask);
+ auto Op = std::make_unique<ARMOperand>(k_ITCondMask);
Op->ITMask.Mask = Mask;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<ARMOperand> CreateCondCode(ARMCC::CondCodes CC,
SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_CondCode);
+ auto Op = std::make_unique<ARMOperand>(k_CondCode);
Op->CC.Val = CC;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<ARMOperand> CreateVPTPred(ARMVCC::VPTCodes CC,
SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_VPTPred);
+ auto Op = std::make_unique<ARMOperand>(k_VPTPred);
Op->VCC.Val = CC;
Op->StartLoc = S;
Op->EndLoc = S;
}
static std::unique_ptr<ARMOperand> CreateCoprocNum(unsigned CopVal, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_CoprocNum);
+ auto Op = std::make_unique<ARMOperand>(k_CoprocNum);
Op->Cop.Val = CopVal;
Op->StartLoc = S;
Op->EndLoc = S;
}
static std::unique_ptr<ARMOperand> CreateCoprocReg(unsigned CopVal, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_CoprocReg);
+ auto Op = std::make_unique<ARMOperand>(k_CoprocReg);
Op->Cop.Val = CopVal;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<ARMOperand> CreateCoprocOption(unsigned Val, SMLoc S,
SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_CoprocOption);
+ auto Op = std::make_unique<ARMOperand>(k_CoprocOption);
Op->Cop.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
}
static std::unique_ptr<ARMOperand> CreateCCOut(unsigned RegNum, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_CCOut);
+ auto Op = std::make_unique<ARMOperand>(k_CCOut);
Op->Reg.RegNum = RegNum;
Op->StartLoc = S;
Op->EndLoc = S;
}
static std::unique_ptr<ARMOperand> CreateToken(StringRef Str, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_Token);
+ auto Op = std::make_unique<ARMOperand>(k_Token);
Op->Tok.Data = Str.data();
Op->Tok.Length = Str.size();
Op->StartLoc = S;
static std::unique_ptr<ARMOperand> CreateReg(unsigned RegNum, SMLoc S,
SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_Register);
+ auto Op = std::make_unique<ARMOperand>(k_Register);
Op->Reg.RegNum = RegNum;
Op->StartLoc = S;
Op->EndLoc = E;
CreateShiftedRegister(ARM_AM::ShiftOpc ShTy, unsigned SrcReg,
unsigned ShiftReg, unsigned ShiftImm, SMLoc S,
SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_ShiftedRegister);
+ auto Op = std::make_unique<ARMOperand>(k_ShiftedRegister);
Op->RegShiftedReg.ShiftTy = ShTy;
Op->RegShiftedReg.SrcReg = SrcReg;
Op->RegShiftedReg.ShiftReg = ShiftReg;
static std::unique_ptr<ARMOperand>
CreateShiftedImmediate(ARM_AM::ShiftOpc ShTy, unsigned SrcReg,
unsigned ShiftImm, SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_ShiftedImmediate);
+ auto Op = std::make_unique<ARMOperand>(k_ShiftedImmediate);
Op->RegShiftedImm.ShiftTy = ShTy;
Op->RegShiftedImm.SrcReg = SrcReg;
Op->RegShiftedImm.ShiftImm = ShiftImm;
static std::unique_ptr<ARMOperand> CreateShifterImm(bool isASR, unsigned Imm,
SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_ShifterImmediate);
+ auto Op = std::make_unique<ARMOperand>(k_ShifterImmediate);
Op->ShifterImm.isASR = isASR;
Op->ShifterImm.Imm = Imm;
Op->StartLoc = S;
static std::unique_ptr<ARMOperand> CreateRotImm(unsigned Imm, SMLoc S,
SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_RotateImmediate);
+ auto Op = std::make_unique<ARMOperand>(k_RotateImmediate);
Op->RotImm.Imm = Imm;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<ARMOperand> CreateModImm(unsigned Bits, unsigned Rot,
SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_ModifiedImmediate);
+ auto Op = std::make_unique<ARMOperand>(k_ModifiedImmediate);
Op->ModImm.Bits = Bits;
Op->ModImm.Rot = Rot;
Op->StartLoc = S;
static std::unique_ptr<ARMOperand>
CreateConstantPoolImm(const MCExpr *Val, SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_ConstantPoolImmediate);
+ auto Op = std::make_unique<ARMOperand>(k_ConstantPoolImmediate);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<ARMOperand>
CreateBitfield(unsigned LSB, unsigned Width, SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_BitfieldDescriptor);
+ auto Op = std::make_unique<ARMOperand>(k_BitfieldDescriptor);
Op->Bitfield.LSB = LSB;
Op->Bitfield.Width = Width;
Op->StartLoc = S;
assert(std::is_sorted(Regs.begin(), Regs.end()) &&
"Register list must be sorted by encoding");
- auto Op = make_unique<ARMOperand>(Kind);
+ auto Op = std::make_unique<ARMOperand>(Kind);
for (const auto &P : Regs)
Op->Registers.push_back(P.second);
unsigned Count,
bool isDoubleSpaced,
SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_VectorList);
+ auto Op = std::make_unique<ARMOperand>(k_VectorList);
Op->VectorList.RegNum = RegNum;
Op->VectorList.Count = Count;
Op->VectorList.isDoubleSpaced = isDoubleSpaced;
static std::unique_ptr<ARMOperand>
CreateVectorListAllLanes(unsigned RegNum, unsigned Count, bool isDoubleSpaced,
SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_VectorListAllLanes);
+ auto Op = std::make_unique<ARMOperand>(k_VectorListAllLanes);
Op->VectorList.RegNum = RegNum;
Op->VectorList.Count = Count;
Op->VectorList.isDoubleSpaced = isDoubleSpaced;
static std::unique_ptr<ARMOperand>
CreateVectorListIndexed(unsigned RegNum, unsigned Count, unsigned Index,
bool isDoubleSpaced, SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_VectorListIndexed);
+ auto Op = std::make_unique<ARMOperand>(k_VectorListIndexed);
Op->VectorList.RegNum = RegNum;
Op->VectorList.Count = Count;
Op->VectorList.LaneIndex = Index;
static std::unique_ptr<ARMOperand>
CreateVectorIndex(unsigned Idx, SMLoc S, SMLoc E, MCContext &Ctx) {
- auto Op = make_unique<ARMOperand>(k_VectorIndex);
+ auto Op = std::make_unique<ARMOperand>(k_VectorIndex);
Op->VectorIndex.Val = Idx;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<ARMOperand> CreateImm(const MCExpr *Val, SMLoc S,
SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_Immediate);
+ auto Op = std::make_unique<ARMOperand>(k_Immediate);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
unsigned OffsetRegNum, ARM_AM::ShiftOpc ShiftType,
unsigned ShiftImm, unsigned Alignment, bool isNegative, SMLoc S,
SMLoc E, SMLoc AlignmentLoc = SMLoc()) {
- auto Op = make_unique<ARMOperand>(k_Memory);
+ auto Op = std::make_unique<ARMOperand>(k_Memory);
Op->Memory.BaseRegNum = BaseRegNum;
Op->Memory.OffsetImm = OffsetImm;
Op->Memory.OffsetRegNum = OffsetRegNum;
static std::unique_ptr<ARMOperand>
CreatePostIdxReg(unsigned RegNum, bool isAdd, ARM_AM::ShiftOpc ShiftTy,
unsigned ShiftImm, SMLoc S, SMLoc E) {
- auto Op = make_unique<ARMOperand>(k_PostIndexRegister);
+ auto Op = std::make_unique<ARMOperand>(k_PostIndexRegister);
Op->PostIdxReg.RegNum = RegNum;
Op->PostIdxReg.isAdd = isAdd;
Op->PostIdxReg.ShiftTy = ShiftTy;
static std::unique_ptr<ARMOperand> CreateMemBarrierOpt(ARM_MB::MemBOpt Opt,
SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_MemBarrierOpt);
+ auto Op = std::make_unique<ARMOperand>(k_MemBarrierOpt);
Op->MBOpt.Val = Opt;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<ARMOperand>
CreateInstSyncBarrierOpt(ARM_ISB::InstSyncBOpt Opt, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_InstSyncBarrierOpt);
+ auto Op = std::make_unique<ARMOperand>(k_InstSyncBarrierOpt);
Op->ISBOpt.Val = Opt;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<ARMOperand>
CreateTraceSyncBarrierOpt(ARM_TSB::TraceSyncBOpt Opt, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_TraceSyncBarrierOpt);
+ auto Op = std::make_unique<ARMOperand>(k_TraceSyncBarrierOpt);
Op->TSBOpt.Val = Opt;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<ARMOperand> CreateProcIFlags(ARM_PROC::IFlags IFlags,
SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_ProcIFlags);
+ auto Op = std::make_unique<ARMOperand>(k_ProcIFlags);
Op->IFlags.Val = IFlags;
Op->StartLoc = S;
Op->EndLoc = S;
}
static std::unique_ptr<ARMOperand> CreateMSRMask(unsigned MMask, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_MSRMask);
+ auto Op = std::make_unique<ARMOperand>(k_MSRMask);
Op->MMask.Val = MMask;
Op->StartLoc = S;
Op->EndLoc = S;
}
static std::unique_ptr<ARMOperand> CreateBankedReg(unsigned Reg, SMLoc S) {
- auto Op = make_unique<ARMOperand>(k_BankedReg);
+ auto Op = std::make_unique<ARMOperand>(k_BankedReg);
Op->BankedReg.Val = Reg;
Op->StartLoc = S;
Op->EndLoc = S;
std::unique_ptr<MCObjectTargetWriter>
llvm::createARMELFObjectWriter(uint8_t OSABI) {
- return llvm::make_unique<ARMELFObjectWriter>(OSABI);
+ return std::make_unique<ARMELFObjectWriter>(OSABI);
}
std::unique_ptr<MCObjectTargetWriter>
llvm::createARMMachObjectWriter(bool Is64Bit, uint32_t CPUType,
uint32_t CPUSubtype) {
- return llvm::make_unique<ARMMachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
+ return std::make_unique<ARMMachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
}
std::unique_ptr<MCObjectTargetWriter>
createARMWinCOFFObjectWriter(bool Is64Bit) {
- return llvm::make_unique<ARMWinCOFFObjectWriter>(Is64Bit);
+ return std::make_unique<ARMWinCOFFObjectWriter>(Is64Bit);
}
} // end namespace llvm
getEffectiveRelocModel(RM),
getEffectiveCodeModel(CM, CodeModel::Small), OL),
SubTarget(TT, getCPU(CPU), FS, *this) {
- this->TLOF = make_unique<AVRTargetObjectFile>();
+ this->TLOF = std::make_unique<AVRTargetObjectFile>();
initAsmInfo();
}
}
static std::unique_ptr<AVROperand> CreateToken(StringRef Str, SMLoc S) {
- return make_unique<AVROperand>(Str, S);
+ return std::make_unique<AVROperand>(Str, S);
}
static std::unique_ptr<AVROperand> CreateReg(unsigned RegNum, SMLoc S,
SMLoc E) {
- return make_unique<AVROperand>(RegNum, S, E);
+ return std::make_unique<AVROperand>(RegNum, S, E);
}
static std::unique_ptr<AVROperand> CreateImm(const MCExpr *Val, SMLoc S,
SMLoc E) {
- return make_unique<AVROperand>(Val, S, E);
+ return std::make_unique<AVROperand>(Val, S, E);
}
static std::unique_ptr<AVROperand>
CreateMemri(unsigned RegNum, const MCExpr *Val, SMLoc S, SMLoc E) {
- return make_unique<AVROperand>(RegNum, Val, S, E);
+ return std::make_unique<AVROperand>(RegNum, Val, S, E);
}
void makeToken(StringRef Token) {
}
std::unique_ptr<MCObjectTargetWriter> createAVRELFObjectWriter(uint8_t OSABI) {
- return make_unique<AVRELFObjectWriter>(OSABI);
+ return std::make_unique<AVRELFObjectWriter>(OSABI);
}
} // end of namespace llvm
}
static std::unique_ptr<BPFOperand> createToken(StringRef Str, SMLoc S) {
- auto Op = make_unique<BPFOperand>(Token);
+ auto Op = std::make_unique<BPFOperand>(Token);
Op->Tok = Str;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<BPFOperand> createReg(unsigned RegNo, SMLoc S,
SMLoc E) {
- auto Op = make_unique<BPFOperand>(Register);
+ auto Op = std::make_unique<BPFOperand>(Register);
Op->Reg.RegNum = RegNo;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<BPFOperand> createImm(const MCExpr *Val, SMLoc S,
SMLoc E) {
- auto Op = make_unique<BPFOperand>(Immediate);
+ auto Op = std::make_unique<BPFOperand>(Immediate);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
: LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options,
getEffectiveRelocModel(RM),
getEffectiveCodeModel(CM, CodeModel::Small), OL),
- TLOF(make_unique<TargetLoweringObjectFileELF>()),
+ TLOF(std::make_unique<TargetLoweringObjectFileELF>()),
Subtarget(TT, CPU, FS, *this) {
initAsmInfo();
// Create a BTF type instance for this DIBasicType and put it into
// DIToIdMap for cross-type reference check.
- auto TypeEntry = llvm::make_unique<BTFTypeInt>(
+ auto TypeEntry = std::make_unique<BTFTypeInt>(
Encoding, BTy->getSizeInBits(), BTy->getOffsetInBits(), BTy->getName());
TypeId = addType(std::move(TypeEntry), BTy);
}
// a function pointer has an empty name. The subprogram type will
// not be added to DIToIdMap as it should not be referenced by
// any other types.
- auto TypeEntry = llvm::make_unique<BTFTypeFuncProto>(STy, VLen, FuncArgNames);
+ auto TypeEntry = std::make_unique<BTFTypeFuncProto>(STy, VLen, FuncArgNames);
if (ForSubprog)
TypeId = addType(std::move(TypeEntry)); // For subprogram
else
}
auto TypeEntry =
- llvm::make_unique<BTFTypeStruct>(CTy, IsStruct, HasBitField, VLen);
+ std::make_unique<BTFTypeStruct>(CTy, IsStruct, HasBitField, VLen);
StructTypes.push_back(TypeEntry.get());
TypeId = addType(std::move(TypeEntry), CTy);
ElemSize = ElemType->getSizeInBits() >> 3;
if (!CTy->getSizeInBits()) {
- auto TypeEntry = llvm::make_unique<BTFTypeArray>(ElemTypeId, 0);
+ auto TypeEntry = std::make_unique<BTFTypeArray>(ElemTypeId, 0);
ElemTypeId = addType(std::move(TypeEntry), CTy);
} else {
// Visit array dimensions.
int64_t Count = CI->getSExtValue();
auto TypeEntry =
- llvm::make_unique<BTFTypeArray>(ElemTypeId, Count);
+ std::make_unique<BTFTypeArray>(ElemTypeId, Count);
if (I == 0)
ElemTypeId = addType(std::move(TypeEntry), CTy);
else
// The IR does not have a type for array index while BTF wants one.
// So create an array index type if there is none.
if (!ArrayIndexTypeId) {
- auto TypeEntry = llvm::make_unique<BTFTypeInt>(dwarf::DW_ATE_unsigned, 32,
+ auto TypeEntry = std::make_unique<BTFTypeInt>(dwarf::DW_ATE_unsigned, 32,
0, "__ARRAY_SIZE_TYPE__");
ArrayIndexTypeId = addType(std::move(TypeEntry));
}
if (VLen > BTF::MAX_VLEN)
return;
- auto TypeEntry = llvm::make_unique<BTFTypeEnum>(CTy, VLen);
+ auto TypeEntry = std::make_unique<BTFTypeEnum>(CTy, VLen);
TypeId = addType(std::move(TypeEntry), CTy);
// No need to visit base type as BTF does not encode it.
}
/// Handle structure/union forward declarations.
void BTFDebug::visitFwdDeclType(const DICompositeType *CTy, bool IsUnion,
uint32_t &TypeId) {
- auto TypeEntry = llvm::make_unique<BTFTypeFwd>(CTy->getName(), IsUnion);
+ auto TypeEntry = std::make_unique<BTFTypeFwd>(CTy->getName(), IsUnion);
TypeId = addType(std::move(TypeEntry), CTy);
}
/// Find a candidate, generate a fixup. Later on the struct/union
/// pointee type will be replaced with either a real type or
/// a forward declaration.
- auto TypeEntry = llvm::make_unique<BTFTypeDerived>(DTy, Tag, true);
+ auto TypeEntry = std::make_unique<BTFTypeDerived>(DTy, Tag, true);
auto &Fixup = FixupDerivedTypes[CTy->getName()];
Fixup.first = CTag == dwarf::DW_TAG_union_type;
Fixup.second.push_back(TypeEntry.get());
if (Tag == dwarf::DW_TAG_pointer_type || Tag == dwarf::DW_TAG_typedef ||
Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type ||
Tag == dwarf::DW_TAG_restrict_type) {
- auto TypeEntry = llvm::make_unique<BTFTypeDerived>(DTy, Tag, false);
+ auto TypeEntry = std::make_unique<BTFTypeDerived>(DTy, Tag, false);
TypeId = addType(std::move(TypeEntry), DTy);
} else if (Tag != dwarf::DW_TAG_member) {
return;
}
auto TypeEntry =
- llvm::make_unique<BTFTypeStruct>(CTy, true, HasBitField, Elements.size());
+ std::make_unique<BTFTypeStruct>(CTy, true, HasBitField, Elements.size());
StructTypes.push_back(TypeEntry.get());
TypeId = addType(std::move(TypeEntry), CTy);
// Construct subprogram func type
auto FuncTypeEntry =
- llvm::make_unique<BTFTypeFunc>(SP->getName(), ProtoTypeId);
+ std::make_unique<BTFTypeFunc>(SP->getName(), ProtoTypeId);
uint32_t FuncTypeId = addType(std::move(FuncTypeEntry));
for (const auto &TypeEntry : TypeEntries)
? BTF::VAR_GLOBAL_ALLOCATED
: BTF::VAR_STATIC;
auto VarEntry =
- llvm::make_unique<BTFKindVar>(Global.getName(), GVTypeId, GVarInfo);
+ std::make_unique<BTFKindVar>(Global.getName(), GVTypeId, GVarInfo);
uint32_t VarId = addType(std::move(VarEntry));
// Find or create a DataSec
if (DataSecEntries.find(SecName) == DataSecEntries.end()) {
- DataSecEntries[SecName] = llvm::make_unique<BTFKindDataSec>(Asm, SecName);
+ DataSecEntries[SecName] = std::make_unique<BTFKindDataSec>(Asm, SecName);
}
// Calculate symbol size
}
if (StructTypeId == 0) {
- auto FwdTypeEntry = llvm::make_unique<BTFTypeFwd>(TypeName, IsUnion);
+ auto FwdTypeEntry = std::make_unique<BTFTypeFwd>(TypeName, IsUnion);
StructTypeId = addType(std::move(FwdTypeEntry));
}
std::unique_ptr<MCObjectTargetWriter>
llvm::createBPFELFObjectWriter(uint8_t OSABI) {
- return llvm::make_unique<BPFELFObjectWriter>(OSABI);
+ return std::make_unique<BPFELFObjectWriter>(OSABI);
}
void HexagonSubtarget::getPostRAMutations(
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
- Mutations.push_back(llvm::make_unique<UsrOverflowMutation>());
- Mutations.push_back(llvm::make_unique<HVXMemLatencyMutation>());
- Mutations.push_back(llvm::make_unique<BankConflictMutation>());
+ Mutations.push_back(std::make_unique<UsrOverflowMutation>());
+ Mutations.push_back(std::make_unique<HVXMemLatencyMutation>());
+ Mutations.push_back(std::make_unique<BankConflictMutation>());
}
void HexagonSubtarget::getSMSMutations(
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
- Mutations.push_back(llvm::make_unique<UsrOverflowMutation>());
- Mutations.push_back(llvm::make_unique<HVXMemLatencyMutation>());
+ Mutations.push_back(std::make_unique<UsrOverflowMutation>());
+ Mutations.push_back(std::make_unique<HVXMemLatencyMutation>());
}
// Pin the vtable to this file.
static ScheduleDAGInstrs *createVLIWMachineSched(MachineSchedContext *C) {
ScheduleDAGMILive *DAG =
- new VLIWMachineScheduler(C, make_unique<ConvergingVLIWScheduler>());
- DAG->addMutation(make_unique<HexagonSubtarget::UsrOverflowMutation>());
- DAG->addMutation(make_unique<HexagonSubtarget::HVXMemLatencyMutation>());
- DAG->addMutation(make_unique<HexagonSubtarget::CallMutation>());
+ new VLIWMachineScheduler(C, std::make_unique<ConvergingVLIWScheduler>());
+ DAG->addMutation(std::make_unique<HexagonSubtarget::UsrOverflowMutation>());
+ DAG->addMutation(std::make_unique<HexagonSubtarget::HVXMemLatencyMutation>());
+ DAG->addMutation(std::make_unique<HexagonSubtarget::CallMutation>());
DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI));
return DAG;
}
TT, CPU, FS, Options, getEffectiveRelocModel(RM),
getEffectiveCodeModel(CM, CodeModel::Small),
(HexagonNoOpt ? CodeGenOpt::None : OL)),
- TLOF(make_unique<HexagonTargetObjectFile>()) {
+ TLOF(std::make_unique<HexagonTargetObjectFile>()) {
initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry());
initAsmInfo();
}
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<HexagonSubtarget>(TargetTriple, CPU, FS, *this);
+ I = std::make_unique<HexagonSubtarget>(TargetTriple, CPU, FS, *this);
}
return I.get();
}
HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();
HRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
- addMutation(llvm::make_unique<HexagonSubtarget::UsrOverflowMutation>());
- addMutation(llvm::make_unique<HexagonSubtarget::HVXMemLatencyMutation>());
- addMutation(llvm::make_unique<HexagonSubtarget::BankConflictMutation>());
+ addMutation(std::make_unique<HexagonSubtarget::UsrOverflowMutation>());
+ addMutation(std::make_unique<HexagonSubtarget::HVXMemLatencyMutation>());
+ addMutation(std::make_unique<HexagonSubtarget::BankConflictMutation>());
}
// Check if FirstI modifies a register that SecondI reads.
std::unique_ptr<MCObjectTargetWriter>
llvm::createHexagonELFObjectWriter(uint8_t OSABI, StringRef CPU) {
- return llvm::make_unique<HexagonELFObjectWriter>(OSABI, CPU);
+ return std::make_unique<HexagonELFObjectWriter>(OSABI, CPU);
}
}
static std::unique_ptr<LanaiOperand> CreateToken(StringRef Str, SMLoc Start) {
- auto Op = make_unique<LanaiOperand>(TOKEN);
+ auto Op = std::make_unique<LanaiOperand>(TOKEN);
Op->Tok.Data = Str.data();
Op->Tok.Length = Str.size();
Op->StartLoc = Start;
static std::unique_ptr<LanaiOperand> createReg(unsigned RegNum, SMLoc Start,
SMLoc End) {
- auto Op = make_unique<LanaiOperand>(REGISTER);
+ auto Op = std::make_unique<LanaiOperand>(REGISTER);
Op->Reg.RegNum = RegNum;
Op->StartLoc = Start;
Op->EndLoc = End;
static std::unique_ptr<LanaiOperand> createImm(const MCExpr *Value,
SMLoc Start, SMLoc End) {
- auto Op = make_unique<LanaiOperand>(IMMEDIATE);
+ auto Op = std::make_unique<LanaiOperand>(IMMEDIATE);
Op->Imm.Value = Value;
Op->StartLoc = Start;
Op->EndLoc = End;
std::unique_ptr<MCObjectTargetWriter>
llvm::createLanaiELFObjectWriter(uint8_t OSABI) {
- return llvm::make_unique<LanaiELFObjectWriter>(OSABI);
+ return std::make_unique<LanaiELFObjectWriter>(OSABI);
}
}
static std::unique_ptr<MSP430Operand> CreateToken(StringRef Str, SMLoc S) {
- return make_unique<MSP430Operand>(Str, S);
+ return std::make_unique<MSP430Operand>(Str, S);
}
static std::unique_ptr<MSP430Operand> CreateReg(unsigned RegNum, SMLoc S,
SMLoc E) {
- return make_unique<MSP430Operand>(k_Reg, RegNum, S, E);
+ return std::make_unique<MSP430Operand>(k_Reg, RegNum, S, E);
}
static std::unique_ptr<MSP430Operand> CreateImm(const MCExpr *Val, SMLoc S,
SMLoc E) {
- return make_unique<MSP430Operand>(Val, S, E);
+ return std::make_unique<MSP430Operand>(Val, S, E);
}
static std::unique_ptr<MSP430Operand> CreateMem(unsigned RegNum,
const MCExpr *Val,
SMLoc S, SMLoc E) {
- return make_unique<MSP430Operand>(RegNum, Val, S, E);
+ return std::make_unique<MSP430Operand>(RegNum, Val, S, E);
}
static std::unique_ptr<MSP430Operand> CreateIndReg(unsigned RegNum, SMLoc S,
SMLoc E) {
- return make_unique<MSP430Operand>(k_IndReg, RegNum, S, E);
+ return std::make_unique<MSP430Operand>(k_IndReg, RegNum, S, E);
}
static std::unique_ptr<MSP430Operand> CreatePostIndReg(unsigned RegNum, SMLoc S,
SMLoc E) {
- return make_unique<MSP430Operand>(k_PostIndReg, RegNum, S, E);
+ return std::make_unique<MSP430Operand>(k_PostIndReg, RegNum, S, E);
}
SMLoc getStartLoc() const { return Start; }
std::unique_ptr<MCObjectTargetWriter>
llvm::createMSP430ELFObjectWriter(uint8_t OSABI) {
- return llvm::make_unique<MSP430ELFObjectWriter>(OSABI);
+ return std::make_unique<MSP430ELFObjectWriter>(OSABI);
}
: LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options), TT, CPU, FS,
Options, getEffectiveRelocModel(RM),
getEffectiveCodeModel(CM, CodeModel::Small), OL),
- TLOF(make_unique<TargetLoweringObjectFileELF>()),
+ TLOF(std::make_unique<TargetLoweringObjectFileELF>()),
Subtarget(TT, CPU, FS, *this) {
initAsmInfo();
}
// Remember the initial assembler options. The user can not modify these.
AssemblerOptions.push_back(
- llvm::make_unique<MipsAssemblerOptions>(getSTI().getFeatureBits()));
+ std::make_unique<MipsAssemblerOptions>(getSTI().getFeatureBits()));
// Create an assembler options environment for the user to modify.
AssemblerOptions.push_back(
- llvm::make_unique<MipsAssemblerOptions>(getSTI().getFeatureBits()));
+ std::make_unique<MipsAssemblerOptions>(getSTI().getFeatureBits()));
getTargetStreamer().updateABIInfo(*this);
const MCRegisterInfo *RegInfo,
SMLoc S, SMLoc E,
MipsAsmParser &Parser) {
- auto Op = llvm::make_unique<MipsOperand>(k_RegisterIndex, Parser);
+ auto Op = std::make_unique<MipsOperand>(k_RegisterIndex, Parser);
Op->RegIdx.Index = Index;
Op->RegIdx.RegInfo = RegInfo;
Op->RegIdx.Kind = RegKind;
static std::unique_ptr<MipsOperand> CreateToken(StringRef Str, SMLoc S,
MipsAsmParser &Parser) {
- auto Op = llvm::make_unique<MipsOperand>(k_Token, Parser);
+ auto Op = std::make_unique<MipsOperand>(k_Token, Parser);
Op->Tok.Data = Str.data();
Op->Tok.Length = Str.size();
Op->StartLoc = S;
static std::unique_ptr<MipsOperand>
CreateImm(const MCExpr *Val, SMLoc S, SMLoc E, MipsAsmParser &Parser) {
- auto Op = llvm::make_unique<MipsOperand>(k_Immediate, Parser);
+ auto Op = std::make_unique<MipsOperand>(k_Immediate, Parser);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<MipsOperand>
CreateMem(std::unique_ptr<MipsOperand> Base, const MCExpr *Off, SMLoc S,
SMLoc E, MipsAsmParser &Parser) {
- auto Op = llvm::make_unique<MipsOperand>(k_Memory, Parser);
+ auto Op = std::make_unique<MipsOperand>(k_Memory, Parser);
Op->Mem.Base = Base.release();
Op->Mem.Off = Off;
Op->StartLoc = S;
MipsAsmParser &Parser) {
assert(Regs.size() > 0 && "Empty list not allowed");
- auto Op = llvm::make_unique<MipsOperand>(k_RegList, Parser);
+ auto Op = std::make_unique<MipsOperand>(k_RegList, Parser);
Op->RegList.List = new SmallVector<unsigned, 10>(Regs.begin(), Regs.end());
Op->StartLoc = StartLoc;
Op->EndLoc = EndLoc;
// Create a copy of the current assembler options environment and push it.
AssemblerOptions.push_back(
- llvm::make_unique<MipsAssemblerOptions>(AssemblerOptions.back().get()));
+ std::make_unique<MipsAssemblerOptions>(AssemblerOptions.back().get()));
getTargetStreamer().emitDirectiveSetPush();
return false;
uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TT.getOS());
bool IsN64 = TT.isArch64Bit() && !IsN32;
bool HasRelocationAddend = TT.isArch64Bit();
- return llvm::make_unique<MipsELFObjectWriter>(OSABI, HasRelocationAddend,
+ return std::make_unique<MipsELFObjectWriter>(OSABI, HasRelocationAddend,
IsN64);
}
: LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options, isLittle), TT,
CPU, FS, Options, getEffectiveRelocModel(JIT, RM),
getEffectiveCodeModel(CM, CodeModel::Small), OL),
- isLittle(isLittle), TLOF(llvm::make_unique<MipsTargetObjectFile>()),
+ isLittle(isLittle), TLOF(std::make_unique<MipsTargetObjectFile>()),
ABI(MipsABIInfo::computeTargetABI(TT, CPU, Options.MCOptions)),
Subtarget(nullptr), DefaultSubtarget(TT, CPU, FS, isLittle, *this,
Options.StackAlignmentOverride),
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<MipsSubtarget>(TargetTriple, CPU, FS, isLittle, *this,
+ I = std::make_unique<MipsSubtarget>(TargetTriple, CPU, FS, isLittle, *this,
Options.StackAlignmentOverride);
}
return I.get();
CPU, FS, Options, Reloc::PIC_,
getEffectiveCodeModel(CM, CodeModel::Small), OL),
is64bit(is64bit), UseShortPointers(UseShortPointersOpt),
- TLOF(llvm::make_unique<NVPTXTargetObjectFile>()),
+ TLOF(std::make_unique<NVPTXTargetObjectFile>()),
Subtarget(TT, CPU, FS, *this) {
if (TT.getOS() == Triple::NVCL)
drvInterface = NVPTX::NVCL;
static std::unique_ptr<PPCOperand> CreateToken(StringRef Str, SMLoc S,
bool IsPPC64) {
- auto Op = make_unique<PPCOperand>(Token);
+ auto Op = std::make_unique<PPCOperand>(Token);
Op->Tok.Data = Str.data();
Op->Tok.Length = Str.size();
Op->StartLoc = S;
static std::unique_ptr<PPCOperand> CreateImm(int64_t Val, SMLoc S, SMLoc E,
bool IsPPC64) {
- auto Op = make_unique<PPCOperand>(Immediate);
+ auto Op = std::make_unique<PPCOperand>(Immediate);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<PPCOperand> CreateExpr(const MCExpr *Val, SMLoc S,
SMLoc E, bool IsPPC64) {
- auto Op = make_unique<PPCOperand>(Expression);
+ auto Op = std::make_unique<PPCOperand>(Expression);
Op->Expr.Val = Val;
Op->Expr.CRVal = EvaluateCRExpr(Val);
Op->StartLoc = S;
static std::unique_ptr<PPCOperand>
CreateTLSReg(const MCSymbolRefExpr *Sym, SMLoc S, SMLoc E, bool IsPPC64) {
- auto Op = make_unique<PPCOperand>(TLSRegister);
+ auto Op = std::make_unique<PPCOperand>(TLSRegister);
Op->TLSReg.Sym = Sym;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<PPCOperand>
CreateContextImm(int64_t Val, SMLoc S, SMLoc E, bool IsPPC64) {
- auto Op = make_unique<PPCOperand>(ContextImmediate);
+ auto Op = std::make_unique<PPCOperand>(ContextImmediate);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
std::unique_ptr<MCObjectTargetWriter>
llvm::createPPCELFObjectWriter(bool Is64Bit, uint8_t OSABI) {
- return llvm::make_unique<PPCELFObjectWriter>(Is64Bit, OSABI);
+ return std::make_unique<PPCELFObjectWriter>(Is64Bit, OSABI);
}
std::unique_ptr<MCObjectTargetWriter>
llvm::createPPCMachObjectWriter(bool Is64Bit, uint32_t CPUType,
uint32_t CPUSubtype) {
- return llvm::make_unique<PPCMachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
+ return std::make_unique<PPCMachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
}
std::unique_ptr<MCObjectTargetWriter>
llvm::createPPCXCOFFObjectWriter(bool Is64Bit) {
- return llvm::make_unique<PPCXCOFFObjectWriter>(Is64Bit);
+ return std::make_unique<PPCXCOFFObjectWriter>(Is64Bit);
}
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
if (TT.isOSDarwin())
- return llvm::make_unique<TargetLoweringObjectFileMachO>();
+ return std::make_unique<TargetLoweringObjectFileMachO>();
if (TT.isOSAIX())
- return llvm::make_unique<TargetLoweringObjectFileXCOFF>();
+ return std::make_unique<TargetLoweringObjectFileXCOFF>();
- return llvm::make_unique<PPC64LinuxTargetObjectFile>();
+ return std::make_unique<PPC64LinuxTargetObjectFile>();
}
static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
ScheduleDAGMILive *DAG =
new ScheduleDAGMILive(C, ST.usePPCPreRASchedStrategy() ?
- llvm::make_unique<PPCPreRASchedStrategy>(C) :
- llvm::make_unique<GenericScheduler>(C));
+ std::make_unique<PPCPreRASchedStrategy>(C) :
+ std::make_unique<GenericScheduler>(C));
// add DAG Mutations here.
DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI));
return DAG;
const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
ScheduleDAGMI *DAG =
new ScheduleDAGMI(C, ST.usePPCPostRASchedStrategy() ?
- llvm::make_unique<PPCPostRASchedStrategy>(C) :
- llvm::make_unique<PostGenericScheduler>(C), true);
+ std::make_unique<PPCPostRASchedStrategy>(C) :
+ std::make_unique<PostGenericScheduler>(C), true);
// add DAG Mutations here.
return DAG;
}
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<PPCSubtarget>(
+ I = std::make_unique<PPCSubtarget>(
TargetTriple, CPU,
// FIXME: It would be good to have the subtarget additions here
// not necessary. Anything that turns them on/off (overrides) ends
static std::unique_ptr<RISCVOperand> createToken(StringRef Str, SMLoc S,
bool IsRV64) {
- auto Op = make_unique<RISCVOperand>(Token);
+ auto Op = std::make_unique<RISCVOperand>(Token);
Op->Tok = Str;
Op->StartLoc = S;
Op->EndLoc = S;
static std::unique_ptr<RISCVOperand> createReg(unsigned RegNo, SMLoc S,
SMLoc E, bool IsRV64) {
- auto Op = make_unique<RISCVOperand>(Register);
+ auto Op = std::make_unique<RISCVOperand>(Register);
Op->Reg.RegNum = RegNo;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<RISCVOperand> createImm(const MCExpr *Val, SMLoc S,
SMLoc E, bool IsRV64) {
- auto Op = make_unique<RISCVOperand>(Immediate);
+ auto Op = std::make_unique<RISCVOperand>(Immediate);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<RISCVOperand>
createSysReg(StringRef Str, SMLoc S, unsigned Encoding, bool IsRV64) {
- auto Op = make_unique<RISCVOperand>(SystemRegister);
+ auto Op = std::make_unique<RISCVOperand>(SystemRegister);
Op->SysReg.Data = Str.data();
Op->SysReg.Length = Str.size();
Op->SysReg.Encoding = Encoding;
std::unique_ptr<MCObjectTargetWriter>
llvm::createRISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit) {
- return llvm::make_unique<RISCVELFObjectWriter>(OSABI, Is64Bit);
+ return std::make_unique<RISCVELFObjectWriter>(OSABI, Is64Bit);
}
: LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options,
getEffectiveRelocModel(TT, RM),
getEffectiveCodeModel(CM, CodeModel::Small), OL),
- TLOF(make_unique<RISCVELFTargetObjectFile>()),
+ TLOF(std::make_unique<RISCVELFTargetObjectFile>()),
Subtarget(TT, CPU, FS, Options.MCOptions.getABIName(), *this) {
initAsmInfo();
}
}
static std::unique_ptr<SparcOperand> CreateToken(StringRef Str, SMLoc S) {
- auto Op = make_unique<SparcOperand>(k_Token);
+ auto Op = std::make_unique<SparcOperand>(k_Token);
Op->Tok.Data = Str.data();
Op->Tok.Length = Str.size();
Op->StartLoc = S;
static std::unique_ptr<SparcOperand> CreateReg(unsigned RegNum, unsigned Kind,
SMLoc S, SMLoc E) {
- auto Op = make_unique<SparcOperand>(k_Register);
+ auto Op = std::make_unique<SparcOperand>(k_Register);
Op->Reg.RegNum = RegNum;
Op->Reg.Kind = (SparcOperand::RegisterKind)Kind;
Op->StartLoc = S;
static std::unique_ptr<SparcOperand> CreateImm(const MCExpr *Val, SMLoc S,
SMLoc E) {
- auto Op = make_unique<SparcOperand>(k_Immediate);
+ auto Op = std::make_unique<SparcOperand>(k_Immediate);
Op->Imm.Val = Val;
Op->StartLoc = S;
Op->EndLoc = E;
static std::unique_ptr<SparcOperand>
CreateMEMr(unsigned Base, SMLoc S, SMLoc E) {
- auto Op = make_unique<SparcOperand>(k_MemoryReg);
+ auto Op = std::make_unique<SparcOperand>(k_MemoryReg);
Op->Mem.Base = Base;
Op->Mem.OffsetReg = Sparc::G0; // always 0
Op->Mem.Off = nullptr;
std::unique_ptr<MCObjectTargetWriter>
llvm::createSparcELFObjectWriter(bool Is64Bit, uint8_t OSABI) {
- return llvm::make_unique<SparcELFObjectWriter>(Is64Bit, OSABI);
+ return std::make_unique<SparcELFObjectWriter>(Is64Bit, OSABI);
}
getEffectiveSparcCodeModel(
CM, getEffectiveRelocModel(RM), is64bit, JIT),
OL),
- TLOF(make_unique<SparcELFTargetObjectFile>()),
+ TLOF(std::make_unique<SparcELFTargetObjectFile>()),
Subtarget(TT, CPU, FS, *this, is64bit), is64Bit(is64bit) {
initAsmInfo();
}
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<SparcSubtarget>(TargetTriple, CPU, FS, *this,
+ I = std::make_unique<SparcSubtarget>(TargetTriple, CPU, FS, *this,
this->is64Bit);
}
return I.get();
// Create particular kinds of operand.
static std::unique_ptr<SystemZOperand> createInvalid(SMLoc StartLoc,
SMLoc EndLoc) {
- return make_unique<SystemZOperand>(KindInvalid, StartLoc, EndLoc);
+ return std::make_unique<SystemZOperand>(KindInvalid, StartLoc, EndLoc);
}
static std::unique_ptr<SystemZOperand> createToken(StringRef Str, SMLoc Loc) {
- auto Op = make_unique<SystemZOperand>(KindToken, Loc, Loc);
+ auto Op = std::make_unique<SystemZOperand>(KindToken, Loc, Loc);
Op->Token.Data = Str.data();
Op->Token.Length = Str.size();
return Op;
static std::unique_ptr<SystemZOperand>
createReg(RegisterKind Kind, unsigned Num, SMLoc StartLoc, SMLoc EndLoc) {
- auto Op = make_unique<SystemZOperand>(KindReg, StartLoc, EndLoc);
+ auto Op = std::make_unique<SystemZOperand>(KindReg, StartLoc, EndLoc);
Op->Reg.Kind = Kind;
Op->Reg.Num = Num;
return Op;
static std::unique_ptr<SystemZOperand>
createImm(const MCExpr *Expr, SMLoc StartLoc, SMLoc EndLoc) {
- auto Op = make_unique<SystemZOperand>(KindImm, StartLoc, EndLoc);
+ auto Op = std::make_unique<SystemZOperand>(KindImm, StartLoc, EndLoc);
Op->Imm = Expr;
return Op;
}
createMem(MemoryKind MemKind, RegisterKind RegKind, unsigned Base,
const MCExpr *Disp, unsigned Index, const MCExpr *LengthImm,
unsigned LengthReg, SMLoc StartLoc, SMLoc EndLoc) {
- auto Op = make_unique<SystemZOperand>(KindMem, StartLoc, EndLoc);
+ auto Op = std::make_unique<SystemZOperand>(KindMem, StartLoc, EndLoc);
Op->Mem.MemKind = MemKind;
Op->Mem.RegKind = RegKind;
Op->Mem.Base = Base;
static std::unique_ptr<SystemZOperand>
createImmTLS(const MCExpr *Imm, const MCExpr *Sym,
SMLoc StartLoc, SMLoc EndLoc) {
- auto Op = make_unique<SystemZOperand>(KindImmTLS, StartLoc, EndLoc);
+ auto Op = std::make_unique<SystemZOperand>(KindImmTLS, StartLoc, EndLoc);
Op->ImmTLS.Imm = Imm;
Op->ImmTLS.Sym = Sym;
return Op;
std::unique_ptr<MCObjectTargetWriter>
llvm::createSystemZObjectWriter(uint8_t OSABI) {
- return llvm::make_unique<SystemZObjectWriter>(OSABI);
+ return std::make_unique<SystemZObjectWriter>(OSABI);
}
getEffectiveRelocModel(RM),
getEffectiveSystemZCodeModel(CM, getEffectiveRelocModel(RM), JIT),
OL),
- TLOF(llvm::make_unique<TargetLoweringObjectFileELF>()),
+ TLOF(std::make_unique<TargetLoweringObjectFileELF>()),
Subtarget(TT, CPU, FS, *this) {
initAsmInfo();
}
ScheduleDAGInstrs *
createPostMachineScheduler(MachineSchedContext *C) const override {
return new ScheduleDAGMI(C,
- llvm::make_unique<SystemZPostRASchedStrategy>(C),
+ std::make_unique<SystemZPostRASchedStrategy>(C),
/*RemoveKillFlags=*/true);
}
int64_t Val = Int.getIntVal();
if (IsNegative)
Val = -Val;
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Integer, Int.getLoc(), Int.getEndLoc(),
WebAssemblyOperand::IntOp{Val}));
Parser.Lex();
return error("Cannot parse real: ", Flt);
if (IsNegative)
Val = -Val;
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Float, Flt.getLoc(), Flt.getEndLoc(),
WebAssemblyOperand::FltOp{Val}));
Parser.Lex();
}
if (IsNegative)
Val = -Val;
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Float, Flt.getLoc(), Flt.getEndLoc(),
WebAssemblyOperand::FltOp{Val}));
Parser.Lex();
// an opcode until after the assembly matcher, so set a default to fix
// up later.
auto Tok = Lexer.getTok();
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Integer, Tok.getLoc(), Tok.getEndLoc(),
WebAssemblyOperand::IntOp{-1}));
}
void addBlockTypeOperand(OperandVector &Operands, SMLoc NameLoc,
WebAssembly::ExprType BT) {
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Integer, NameLoc, NameLoc,
WebAssemblyOperand::IntOp{static_cast<int64_t>(BT)}));
}
}
// Now construct the name as first operand.
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Token, NameLoc, SMLoc::getFromPointer(Name.end()),
WebAssemblyOperand::TokOp{Name}));
// attach it to an anonymous symbol, which is what WasmObjectWriter
// expects to be able to recreate the actual unique-ified type indices.
auto Loc = Parser.getTok();
- auto Signature = make_unique<wasm::WasmSignature>();
+ auto Signature = std::make_unique<wasm::WasmSignature>();
if (parseSignature(Signature.get()))
return true;
auto &Ctx = getStreamer().getContext();
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION);
const MCExpr *Expr = MCSymbolRefExpr::create(
WasmSym, MCSymbolRefExpr::VK_WASM_TYPEINDEX, Ctx);
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Symbol, Loc.getLoc(), Loc.getEndLoc(),
WebAssemblyOperand::SymOp{Expr}));
}
SMLoc End;
if (Parser.parseExpression(Val, End))
return error("Cannot parse symbol: ", Lexer.getTok());
- Operands.push_back(make_unique<WebAssemblyOperand>(
+ Operands.push_back(std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Symbol, Id.getLoc(), Id.getEndLoc(),
WebAssemblyOperand::SymOp{Val}));
if (checkForP2AlignIfLoadStore(Operands, Name))
}
case AsmToken::LCurly: {
Parser.Lex();
- auto Op = make_unique<WebAssemblyOperand>(
+ auto Op = std::make_unique<WebAssemblyOperand>(
WebAssemblyOperand::BrList, Tok.getLoc(), Tok.getEndLoc());
if (!Lexer.is(AsmToken::RCurly))
for (;;) {
LastFunctionLabel = LastLabel;
push(Function);
}
- auto Signature = make_unique<wasm::WasmSignature>();
+ auto Signature = std::make_unique<wasm::WasmSignature>();
if (parseSignature(Signature.get()))
return true;
WasmSym->setSignature(Signature.get());
if (SymName.empty())
return true;
auto WasmSym = cast<MCSymbolWasm>(Ctx.getOrCreateSymbol(SymName));
- auto Signature = make_unique<wasm::WasmSignature>();
+ auto Signature = std::make_unique<wasm::WasmSignature>();
if (parseRegTypeList(Signature->Params))
return true;
WasmSym->setSignature(Signature.get());
std::unique_ptr<MCObjectTargetWriter>
llvm::createWebAssemblyWasmObjectWriter(bool Is64Bit) {
- return llvm::make_unique<WebAssemblyWasmObjectWriter>(Is64Bit);
+ return std::make_unique<WebAssemblyWasmObjectWriter>(Is64Bit);
}
// If the smallest region containing MBB is a loop
if (LoopMap.count(ML))
return LoopMap[ML].get();
- LoopMap[ML] = llvm::make_unique<ConcreteRegion<MachineLoop>>(ML);
+ LoopMap[ML] = std::make_unique<ConcreteRegion<MachineLoop>>(ML);
return LoopMap[ML].get();
} else {
// If the smallest region containing MBB is an exception
if (ExceptionMap.count(WE))
return ExceptionMap[WE].get();
ExceptionMap[WE] =
- llvm::make_unique<ConcreteRegion<WebAssemblyException>>(WE);
+ std::make_unique<ConcreteRegion<WebAssemblyException>>(WE);
return ExceptionMap[WE].get();
}
}
getLibcallSignature(Subtarget, Name, Returns, Params);
}
auto Signature =
- make_unique<wasm::WasmSignature>(std::move(Returns), std::move(Params));
+ std::make_unique<wasm::WasmSignature>(std::move(Returns), std::move(Params));
WasmSym->setSignature(Signature.get());
Printer.addSignature(std::move(Signature));
}
auto *WasmSym = cast<MCSymbolWasm>(Sym);
- auto Signature = make_unique<wasm::WasmSignature>(std::move(Returns),
+ auto Signature = std::make_unique<wasm::WasmSignature>(std::move(Returns),
std::move(Params));
WasmSym->setSignature(Signature.get());
Printer.addSignature(std::move(Signature));
std::unique_ptr<wasm::WasmSignature>
llvm::signatureFromMVTs(const SmallVectorImpl<MVT> &Results,
const SmallVectorImpl<MVT> &Params) {
- auto Sig = make_unique<wasm::WasmSignature>();
+ auto Sig = std::make_unique<wasm::WasmSignature>();
valTypesFromMVTs(Results, Sig->Returns);
valTypesFromMVTs(Params, Sig->Params);
return Sig;
std::string FS) const {
auto &I = SubtargetMap[CPU + FS];
if (!I) {
- I = llvm::make_unique<WebAssemblySubtarget>(TargetTriple, CPU, FS, *this);
+ I = std::make_unique<WebAssemblySubtarget>(TargetTriple, CPU, FS, *this);
}
return I.get();
}
static std::unique_ptr<X86Operand> CreateToken(StringRef Str, SMLoc Loc) {
SMLoc EndLoc = SMLoc::getFromPointer(Loc.getPointer() + Str.size());
- auto Res = llvm::make_unique<X86Operand>(Token, Loc, EndLoc);
+ auto Res = std::make_unique<X86Operand>(Token, Loc, EndLoc);
Res->Tok.Data = Str.data();
Res->Tok.Length = Str.size();
return Res;
CreateReg(unsigned RegNo, SMLoc StartLoc, SMLoc EndLoc,
bool AddressOf = false, SMLoc OffsetOfLoc = SMLoc(),
StringRef SymName = StringRef(), void *OpDecl = nullptr) {
- auto Res = llvm::make_unique<X86Operand>(Register, StartLoc, EndLoc);
+ auto Res = std::make_unique<X86Operand>(Register, StartLoc, EndLoc);
Res->Reg.RegNo = RegNo;
Res->AddressOf = AddressOf;
Res->OffsetOfLoc = OffsetOfLoc;
static std::unique_ptr<X86Operand>
CreateDXReg(SMLoc StartLoc, SMLoc EndLoc) {
- return llvm::make_unique<X86Operand>(DXRegister, StartLoc, EndLoc);
+ return std::make_unique<X86Operand>(DXRegister, StartLoc, EndLoc);
}
static std::unique_ptr<X86Operand>
CreatePrefix(unsigned Prefixes, SMLoc StartLoc, SMLoc EndLoc) {
- auto Res = llvm::make_unique<X86Operand>(Prefix, StartLoc, EndLoc);
+ auto Res = std::make_unique<X86Operand>(Prefix, StartLoc, EndLoc);
Res->Pref.Prefixes = Prefixes;
return Res;
}
static std::unique_ptr<X86Operand> CreateImm(const MCExpr *Val,
SMLoc StartLoc, SMLoc EndLoc) {
- auto Res = llvm::make_unique<X86Operand>(Immediate, StartLoc, EndLoc);
+ auto Res = std::make_unique<X86Operand>(Immediate, StartLoc, EndLoc);
Res->Imm.Val = Val;
return Res;
}
CreateMem(unsigned ModeSize, const MCExpr *Disp, SMLoc StartLoc, SMLoc EndLoc,
unsigned Size = 0, StringRef SymName = StringRef(),
void *OpDecl = nullptr, unsigned FrontendSize = 0) {
- auto Res = llvm::make_unique<X86Operand>(Memory, StartLoc, EndLoc);
+ auto Res = std::make_unique<X86Operand>(Memory, StartLoc, EndLoc);
Res->Mem.SegReg = 0;
Res->Mem.Disp = Disp;
Res->Mem.BaseReg = 0;
// The scale should always be one of {1,2,4,8}.
assert(((Scale == 1 || Scale == 2 || Scale == 4 || Scale == 8)) &&
"Invalid scale!");
- auto Res = llvm::make_unique<X86Operand>(Memory, StartLoc, EndLoc);
+ auto Res = std::make_unique<X86Operand>(Memory, StartLoc, EndLoc);
Res->Mem.SegReg = SegReg;
Res->Mem.Disp = Disp;
Res->Mem.BaseReg = BaseReg;
std::unique_ptr<MCObjectTargetWriter>
llvm::createX86ELFObjectWriter(bool IsELF64, uint8_t OSABI, uint16_t EMachine) {
- return llvm::make_unique<X86ELFObjectWriter>(IsELF64, OSABI, EMachine);
+ return std::make_unique<X86ELFObjectWriter>(IsELF64, OSABI, EMachine);
}
std::unique_ptr<MCObjectTargetWriter>
llvm::createX86MachObjectWriter(bool Is64Bit, uint32_t CPUType,
uint32_t CPUSubtype) {
- return llvm::make_unique<X86MachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
+ return std::make_unique<X86MachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
}
std::unique_ptr<MCObjectTargetWriter>
llvm::createX86WinCOFFObjectWriter(bool Is64Bit) {
- return llvm::make_unique<X86WinCOFFObjectWriter>(Is64Bit);
+ return std::make_unique<X86WinCOFFObjectWriter>(Is64Bit);
}
L, "opening new .cv_fpo_proc before closing previous frame");
return true;
}
- CurFPOData = llvm::make_unique<FPOData>();
+ CurFPOData = std::make_unique<FPOData>();
CurFPOData->Function = ProcSym;
CurFPOData->Begin = emitFPOLabel();
CurFPOData->ParamsSize = ParamsSize;
Modified = false;
break;
}
- return llvm::make_unique<TargetMBBInfo>(TargetMBBInfo{
+ return std::make_unique<TargetMBBInfo>(TargetMBBInfo{
TBB, FBB, BrInstr, CmpInstr, CC, SrcReg, CmpValue, Modified, CmpBrOnly});
}
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
if (TT.isOSBinFormatMachO()) {
if (TT.getArch() == Triple::x86_64)
- return llvm::make_unique<X86_64MachoTargetObjectFile>();
- return llvm::make_unique<TargetLoweringObjectFileMachO>();
+ return std::make_unique<X86_64MachoTargetObjectFile>();
+ return std::make_unique<TargetLoweringObjectFileMachO>();
}
if (TT.isOSFreeBSD())
- return llvm::make_unique<X86FreeBSDTargetObjectFile>();
+ return std::make_unique<X86FreeBSDTargetObjectFile>();
if (TT.isOSLinux() || TT.isOSNaCl() || TT.isOSIAMCU())
- return llvm::make_unique<X86LinuxNaClTargetObjectFile>();
+ return std::make_unique<X86LinuxNaClTargetObjectFile>();
if (TT.isOSSolaris())
- return llvm::make_unique<X86SolarisTargetObjectFile>();
+ return std::make_unique<X86SolarisTargetObjectFile>();
if (TT.isOSFuchsia())
- return llvm::make_unique<X86FuchsiaTargetObjectFile>();
+ return std::make_unique<X86FuchsiaTargetObjectFile>();
if (TT.isOSBinFormatELF())
- return llvm::make_unique<X86ELFTargetObjectFile>();
+ return std::make_unique<X86ELFTargetObjectFile>();
if (TT.isOSBinFormatCOFF())
- return llvm::make_unique<TargetLoweringObjectFileCOFF>();
+ return std::make_unique<TargetLoweringObjectFileCOFF>();
llvm_unreachable("unknown subtarget type");
}
// creation will depend on the TM and the code generation flags on the
// function that reside in TargetOptions.
resetTargetOptions(F);
- I = llvm::make_unique<X86Subtarget>(TargetTriple, CPU, FS, *this,
+ I = std::make_unique<X86Subtarget>(TargetTriple, CPU, FS, *this,
Options.StackAlignmentOverride,
PreferVectorWidthOverride,
RequiredVectorWidth);
T, "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32-f64:32-a:0:32-n32",
TT, CPU, FS, Options, getEffectiveRelocModel(RM),
getEffectiveXCoreCodeModel(CM), OL),
- TLOF(llvm::make_unique<XCoreTargetObjectFile>()),
+ TLOF(std::make_unique<XCoreTargetObjectFile>()),
Subtarget(TT, CPU, FS, *this) {
initAsmInfo();
}
"llvm.coro.subfn.addr", "llvm.coro.free",
"llvm.coro.id", "llvm.coro.id.retcon",
"llvm.coro.id.retcon.once"}))
- L = llvm::make_unique<Lowerer>(M);
+ L = std::make_unique<Lowerer>(M);
return false;
}
"llvm.coro.promise",
"llvm.coro.resume",
"llvm.coro.suspend"}))
- L = llvm::make_unique<Lowerer>(M);
+ L = std::make_unique<Lowerer>(M);
return false;
}
bool doInitialization(Module &M) override {
if (coro::declaresIntrinsics(M, {"llvm.coro.id"}))
- L = llvm::make_unique<Lowerer>(M);
+ L = std::make_unique<Lowerer>(M);
return false;
}
} else if (PrintImportFailures) {
assert(!FailureInfo &&
"Expected no FailureInfo for newly rejected candidate");
- FailureInfo = llvm::make_unique<FunctionImporter::ImportFailureInfo>(
+ FailureInfo = std::make_unique<FunctionImporter::ImportFailureInfo>(
VI, Edge.second.getHotness(), Reason, 1);
}
LLVM_DEBUG(
});
if (!DT)
- DT = make_unique<DominatorTree>(F);
+ DT = std::make_unique<DominatorTree>(F);
if (!PDT)
- PDT = make_unique<PostDominatorTree>(F);
+ PDT = std::make_unique<PostDominatorTree>(F);
auto Regions = OutliningRegion::create(*BB, *DT, *PDT);
for (OutliningRegion &Region : Regions) {
if (!ImportedFunctionsStats &&
InlinerFunctionImportStats != InlinerFunctionImportStatsOpts::No) {
ImportedFunctionsStats =
- llvm::make_unique<ImportedFunctionsInliningStatistics>();
+ std::make_unique<ImportedFunctionsInliningStatistics>();
ImportedFunctionsStats->setModuleInfo(M);
}
return std::unique_ptr<FunctionOutliningMultiRegionInfo>();
std::unique_ptr<FunctionOutliningMultiRegionInfo> OutliningInfo =
- llvm::make_unique<FunctionOutliningMultiRegionInfo>();
+ std::make_unique<FunctionOutliningMultiRegionInfo>();
auto IsSingleEntry = [](SmallVectorImpl<BasicBlock *> &BlockList) {
BasicBlock *Dom = BlockList.front();
};
std::unique_ptr<FunctionOutliningInfo> OutliningInfo =
- llvm::make_unique<FunctionOutliningInfo>();
+ std::make_unique<FunctionOutliningInfo>();
BasicBlock *CurrEntry = EntryBlock;
bool CandidateFound = false;
Function *F, FunctionOutliningInfo *OI, OptimizationRemarkEmitter &ORE,
function_ref<AssumptionCache *(Function &)> LookupAC)
: OrigFunc(F), ORE(ORE), LookupAC(LookupAC) {
- ClonedOI = llvm::make_unique<FunctionOutliningInfo>();
+ ClonedOI = std::make_unique<FunctionOutliningInfo>();
// Clone the function, so that we can hack away on it.
ValueToValueMapTy VMap;
OptimizationRemarkEmitter &ORE,
function_ref<AssumptionCache *(Function &)> LookupAC)
: OrigFunc(F), ORE(ORE), LookupAC(LookupAC) {
- ClonedOMRI = llvm::make_unique<FunctionOutliningMultiRegionInfo>();
+ ClonedOMRI = std::make_unique<FunctionOutliningMultiRegionInfo>();
// Clone the function, so that we can hack away on it.
ValueToValueMapTy VMap;
auto getAnalysis = [&FAM](Function &F) -> AnalysisResultsForFn {
DominatorTree &DT = FAM.getResult<DominatorTreeAnalysis>(F);
return {
- make_unique<PredicateInfo>(F, DT, FAM.getResult<AssumptionAnalysis>(F)),
+ std::make_unique<PredicateInfo>(F, DT, FAM.getResult<AssumptionAnalysis>(F)),
&DT, FAM.getCachedResult<PostDominatorTreeAnalysis>(F)};
};
DominatorTree &DT =
this->getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();
return {
- make_unique<PredicateInfo>(
+ std::make_unique<PredicateInfo>(
F, DT,
this->getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
F)),
.getManager();
ORE = &FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
} else {
- OwnedORE = make_unique<OptimizationRemarkEmitter>(&F);
+ OwnedORE = std::make_unique<OptimizationRemarkEmitter>(&F);
ORE = OwnedORE.get();
}
Samples = Reader->getSamplesFor(F);
// splitAndWriteThinLTOBitcode). Just always build it once via the
// buildModuleSummaryIndex when Module(s) are ready.
ProfileSummaryInfo PSI(M);
- NewIndex = llvm::make_unique<ModuleSummaryIndex>(
+ NewIndex = std::make_unique<ModuleSummaryIndex>(
buildModuleSummaryIndex(M, nullptr, &PSI));
Index = NewIndex.get();
}
// an optimization remark emitter on the fly, when we need it.
std::unique_ptr<OptimizationRemarkEmitter> ORE;
auto OREGetter = [&](Function *F) -> OptimizationRemarkEmitter & {
- ORE = make_unique<OptimizationRemarkEmitter>(F);
+ ORE = std::make_unique<OptimizationRemarkEmitter>(F);
return *ORE;
};
std::tie(Iter, Inserted) = BBInfos.insert(std::make_pair(Src, nullptr));
if (Inserted) {
// Newly inserted, update the real info.
- Iter->second = std::move(llvm::make_unique<BBInfo>(Index));
+ Iter->second = std::move(std::make_unique<BBInfo>(Index));
Index++;
}
std::tie(Iter, Inserted) = BBInfos.insert(std::make_pair(Dest, nullptr));
if (Inserted)
// Newly inserted, update the real info.
- Iter->second = std::move(llvm::make_unique<BBInfo>(Index));
+ Iter->second = std::move(std::make_unique<BBInfo>(Index));
AllEdges.emplace_back(new Edge(Src, Dest, W));
return *AllEdges.back();
}
getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
RegionInfo &RI = getAnalysis<RegionInfoPass>().getRegionInfo();
std::unique_ptr<OptimizationRemarkEmitter> OwnedORE =
- llvm::make_unique<OptimizationRemarkEmitter>(&F);
+ std::make_unique<OptimizationRemarkEmitter>(&F);
return CHR(F, BFI, DT, PSI, RI, *OwnedORE.get()).run();
}
++It;
EntryBlock.splitBasicBlock(It);
- Funcs.push_back(make_unique<GCOVFunction>(SP, &F, &out, FunctionIdent++,
+ Funcs.push_back(std::make_unique<GCOVFunction>(SP, &F, &out, FunctionIdent++,
Options.UseCfgChecksum,
Options.ExitBlockBeforeBody));
GCOVFunction &Func = *Funcs.back();
StringRef getPassName() const override { return "HWAddressSanitizer"; }
bool doInitialization(Module &M) override {
- HWASan = llvm::make_unique<HWAddressSanitizer>(M, CompileKernel, Recover);
+ HWASan = std::make_unique<HWAddressSanitizer>(M, CompileKernel, Recover);
return true;
}
AM->getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
ORE = &FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
} else {
- OwnedORE = llvm::make_unique<OptimizationRemarkEmitter>(&F);
+ OwnedORE = std::make_unique<OptimizationRemarkEmitter>(&F);
ORE = OwnedORE.get();
}
F.getName().equals(ViewBlockFreqFuncName))) {
LoopInfo LI{DominatorTree(F)};
std::unique_ptr<BranchProbabilityInfo> NewBPI =
- llvm::make_unique<BranchProbabilityInfo>(F, LI);
+ std::make_unique<BranchProbabilityInfo>(F, LI);
std::unique_ptr<BlockFrequencyInfo> NewBFI =
- llvm::make_unique<BlockFrequencyInfo>(F, *NewBPI, LI);
+ std::make_unique<BlockFrequencyInfo>(F, *NewBPI, LI);
if (PGOViewCounts == PGOVCT_Graph)
NewBFI->view();
else if (PGOViewCounts == PGOVCT_Text) {
OptimizationRemarkEmitter &ORE, DominatorTree *DT)
: Func(Func), BFI(BFI), ORE(ORE), DT(DT), Changed(false) {
ValueDataArray =
- llvm::make_unique<InstrProfValueData[]>(MemOPMaxVersion + 2);
+ std::make_unique<InstrProfValueData[]>(MemOPMaxVersion + 2);
// Get the MemOPSize range information from option MemOPSizeRange,
getMemOPSizeRangeFromOption(MemOPSizeRange, PreciseRangeStart,
PreciseRangeLast);
const TargetTransformInfo &TTI, DominatorTree &DT,
AssumptionCache &AC, MemorySSA *MSSA)
: TLI(TLI), TTI(TTI), DT(DT), AC(AC), SQ(DL, &TLI, &DT, &AC), MSSA(MSSA),
- MSSAUpdater(llvm::make_unique<MemorySSAUpdater>(MSSA)) {}
+ MSSAUpdater(std::make_unique<MemorySSAUpdater>(MSSA)) {}
bool run();
GVNHoist(DominatorTree *DT, PostDominatorTree *PDT, AliasAnalysis *AA,
MemoryDependenceResults *MD, MemorySSA *MSSA)
: DT(DT), PDT(PDT), AA(AA), MD(MD), MSSA(MSSA),
- MSSAUpdater(llvm::make_unique<MemorySSAUpdater>(MSSA)) {}
+ MSSAUpdater(std::make_unique<MemorySSAUpdater>(MSSA)) {}
bool run(Function &F) {
NumFuncArgs = F.arg_size();
CurAST = collectAliasInfoForLoop(L, LI, AA);
} else {
LLVM_DEBUG(dbgs() << "LICM: Using MemorySSA.\n");
- MSSAU = make_unique<MemorySSAUpdater>(MSSA);
+ MSSAU = std::make_unique<MemorySSAUpdater>(MSSA);
unsigned AccessCapCount = 0;
for (auto *BB : L->getBlocks()) {
LoopToAliasSetMap.erase(MapI);
}
if (!CurAST)
- CurAST = make_unique<AliasSetTracker>(*AA);
+ CurAST = std::make_unique<AliasSetTracker>(*AA);
// Add everything from the sub loops that are no longer directly available.
for (Loop *InnerL : RecomputeLoops)
LoopInvariantCodeMotion::collectAliasInfoForLoopWithMSSA(
Loop *L, AliasAnalysis *AA, MemorySSAUpdater *MSSAU) {
auto *MSSA = MSSAU->getMemorySSA();
- auto CurAST = make_unique<AliasSetTracker>(*AA, MSSA, L);
+ auto CurAST = std::make_unique<AliasSetTracker>(*AA, MSSA, L);
CurAST->addAllInstructionsInLoopUsingMSSA();
return CurAST;
}
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
if (EnableMSSALoopDependency) {
MSSA = &getAnalysis<MemorySSAWrapperPass>().getMSSA();
- MSSAU = make_unique<MemorySSAUpdater>(MSSA);
+ MSSAU = std::make_unique<MemorySSAUpdater>(MSSA);
assert(DT && "Cannot update MemorySSA without a valid DomTree.");
}
currentLoop = L;
TargetLibraryInfo *TLI, AliasAnalysis *AA, MemorySSA *MSSA,
const DataLayout &DL)
: F(F), DT(DT), TLI(TLI), AA(AA), MSSA(MSSA), DL(DL),
- PredInfo(make_unique<PredicateInfo>(F, *DT, *AC)),
+ PredInfo(std::make_unique<PredicateInfo>(F, *DT, *AC)),
SQ(DL, TLI, DT, AC, /*CtxI=*/nullptr, /*UseInstrInfo=*/false) {}
bool runGVN();
function_ref<bool(const GlobalValue *)> ShouldCloneDefinition) {
// First off, we need to create the new module.
std::unique_ptr<Module> New =
- llvm::make_unique<Module>(M.getModuleIdentifier(), M.getContext());
+ std::make_unique<Module>(M.getModuleIdentifier(), M.getContext());
New->setSourceFileName(M.getSourceFileName());
New->setDataLayout(M.getDataLayout());
New->setTargetTriple(M.getTargetTriple());
return false; // Cannot handle array allocs.
}
Type *Ty = AI->getAllocatedType();
- AllocaTmps.push_back(llvm::make_unique<GlobalVariable>(
+ AllocaTmps.push_back(std::make_unique<GlobalVariable>(
Ty, false, GlobalValue::InternalLinkage, UndefValue::get(Ty),
AI->getName(), /*TLMode=*/GlobalValue::NotThreadLocal,
AI->getType()->getPointerAddressSpace()));
auto &ValueLookup = NodesMap[F.getName()];
if (!ValueLookup) {
- ValueLookup = llvm::make_unique<InlineGraphNode>();
+ ValueLookup = std::make_unique<InlineGraphNode>();
ValueLookup->Imported = F.getMetadata("thinlto_src_module") != nullptr;
}
return *ValueLookup;
auto *MSSAAnalysis = getAnalysisIfAvailable<MemorySSAWrapperPass>();
if (MSSAAnalysis) {
MSSA = &MSSAAnalysis->getMSSA();
- MSSAU = make_unique<MemorySSAUpdater>(MSSA);
+ MSSAU = std::make_unique<MemorySSAUpdater>(MSSA);
}
}
std::unique_ptr<MemorySSAUpdater> MSSAU;
if (MSSAAnalysis) {
auto *MSSA = &MSSAAnalysis->getMSSA();
- MSSAU = make_unique<MemorySSAUpdater>(MSSA);
+ MSSAU = std::make_unique<MemorySSAUpdater>(MSSA);
}
bool PredicateInfoPrinterLegacyPass::runOnFunction(Function &F) {
auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
- auto PredInfo = make_unique<PredicateInfo>(F, DT, AC);
+ auto PredInfo = std::make_unique<PredicateInfo>(F, DT, AC);
PredInfo->print(dbgs());
if (VerifyPredicateInfo)
PredInfo->verifyPredicateInfo();
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &AC = AM.getResult<AssumptionAnalysis>(F);
OS << "PredicateInfo for function: " << F.getName() << "\n";
- auto PredInfo = make_unique<PredicateInfo>(F, DT, AC);
+ auto PredInfo = std::make_unique<PredicateInfo>(F, DT, AC);
PredInfo->print(OS);
replaceCreatedSSACopys(*PredInfo, F);
FunctionAnalysisManager &AM) {
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &AC = AM.getResult<AssumptionAnalysis>(F);
- make_unique<PredicateInfo>(F, DT, AC)->verifyPredicateInfo();
+ std::make_unique<PredicateInfo>(F, DT, AC)->verifyPredicateInfo();
return PreservedAnalyses::all();
}
// TODO see if there is a more elegant solution to selecting the rewrite
// descriptor type
if (!Target.empty())
- DL->push_back(llvm::make_unique<ExplicitRewriteFunctionDescriptor>(
+ DL->push_back(std::make_unique<ExplicitRewriteFunctionDescriptor>(
Source, Target, Naked));
else
DL->push_back(
- llvm::make_unique<PatternRewriteFunctionDescriptor>(Source, Transform));
+ std::make_unique<PatternRewriteFunctionDescriptor>(Source, Transform));
return true;
}
}
if (!Target.empty())
- DL->push_back(llvm::make_unique<ExplicitRewriteGlobalVariableDescriptor>(
+ DL->push_back(std::make_unique<ExplicitRewriteGlobalVariableDescriptor>(
Source, Target,
/*Naked*/ false));
else
- DL->push_back(llvm::make_unique<PatternRewriteGlobalVariableDescriptor>(
+ DL->push_back(std::make_unique<PatternRewriteGlobalVariableDescriptor>(
Source, Transform));
return true;
}
if (!Target.empty())
- DL->push_back(llvm::make_unique<ExplicitRewriteNamedAliasDescriptor>(
+ DL->push_back(std::make_unique<ExplicitRewriteNamedAliasDescriptor>(
Source, Target,
/*Naked*/ false));
else
- DL->push_back(llvm::make_unique<PatternRewriteNamedAliasDescriptor>(
+ DL->push_back(std::make_unique<PatternRewriteNamedAliasDescriptor>(
Source, Transform));
return true;
// We currently don't use LoopVersioning for the actual loop cloning but we
// still use it to add the noalias metadata.
- LVer = llvm::make_unique<LoopVersioning>(*Legal->getLAI(), OrigLoop, LI, DT,
+ LVer = std::make_unique<LoopVersioning>(*Legal->getLAI(), OrigLoop, LI, DT,
PSE.getSE());
LVer->prepareNoAliasMetadata();
}
// Create a dummy pre-entry VPBasicBlock to start building the VPlan.
VPBasicBlock *VPBB = new VPBasicBlock("Pre-Entry");
- auto Plan = llvm::make_unique<VPlan>(VPBB);
+ auto Plan = std::make_unique<VPlan>(VPBB);
VPRecipeBuilder RecipeBuilder(OrigLoop, TLI, Legal, CM, Builder);
// Represent values that will have defs inside VPlan.
assert(EnableVPlanNativePath && "VPlan-native path is not enabled.");
// Create new empty VPlan
- auto Plan = llvm::make_unique<VPlan>();
+ auto Plan = std::make_unique<VPlan>();
// Build hierarchical CFG
VPlanHCFGBuilder HCFGBuilder(OrigLoop, LI, *Plan);
const EdgeInfo &UserTreeIdx,
ArrayRef<unsigned> ReuseShuffleIndices = None,
ArrayRef<unsigned> ReorderIndices = None) {
- VectorizableTree.push_back(llvm::make_unique<TreeEntry>(VectorizableTree));
+ VectorizableTree.push_back(std::make_unique<TreeEntry>(VectorizableTree));
TreeEntry *Last = VectorizableTree.back().get();
Last->Idx = VectorizableTree.size() - 1;
Last->Scalars.insert(Last->Scalars.begin(), VL.begin(), VL.end());
auto &BSRef = BlocksSchedules[BB];
if (!BSRef)
- BSRef = llvm::make_unique<BlockScheduling>(BB);
+ BSRef = std::make_unique<BlockScheduling>(BB);
BlockScheduling &BS = *BSRef.get();
BoUpSLP::ScheduleData *BoUpSLP::BlockScheduling::allocateScheduleDataChunks() {
// Allocate a new ScheduleData for the instruction.
if (ChunkPos >= ChunkSize) {
- ScheduleDataChunks.push_back(llvm::make_unique<ScheduleData[]>(ChunkSize));
+ ScheduleDataChunks.push_back(std::make_unique<ScheduleData[]>(ChunkSize));
ChunkPos = 0;
}
return &(ScheduleDataChunks.back()[ChunkPos++]);
#endif
WindowsManifestMerger::WindowsManifestMerger()
- : Impl(make_unique<WindowsManifestMergerImpl>()) {}
+ : Impl(std::make_unique<WindowsManifestMergerImpl>()) {}
WindowsManifestMerger::~WindowsManifestMerger() {}
"Invalid metadata record type: %d", T);
switch (T) {
case MetadataRecordKinds::NewBufferKind:
- return make_unique<NewBufferRecord>();
+ return std::make_unique<NewBufferRecord>();
case MetadataRecordKinds::EndOfBufferKind:
if (Header.Version >= 2)
return createStringError(
std::make_error_code(std::errc::executable_format_error),
"End of buffer records are no longer supported starting version "
"2 of the log.");
- return make_unique<EndBufferRecord>();
+ return std::make_unique<EndBufferRecord>();
case MetadataRecordKinds::NewCPUIdKind:
- return make_unique<NewCPUIDRecord>();
+ return std::make_unique<NewCPUIDRecord>();
case MetadataRecordKinds::TSCWrapKind:
- return make_unique<TSCWrapRecord>();
+ return std::make_unique<TSCWrapRecord>();
case MetadataRecordKinds::WalltimeMarkerKind:
- return make_unique<WallclockRecord>();
+ return std::make_unique<WallclockRecord>();
case MetadataRecordKinds::CustomEventMarkerKind:
if (Header.Version >= 5)
- return make_unique<CustomEventRecordV5>();
- return make_unique<CustomEventRecord>();
+ return std::make_unique<CustomEventRecordV5>();
+ return std::make_unique<CustomEventRecord>();
case MetadataRecordKinds::CallArgumentKind:
- return make_unique<CallArgRecord>();
+ return std::make_unique<CallArgRecord>();
case MetadataRecordKinds::BufferExtentsKind:
- return make_unique<BufferExtents>();
+ return std::make_unique<BufferExtents>();
case MetadataRecordKinds::TypedEventMarkerKind:
- return make_unique<TypedEventRecord>();
+ return std::make_unique<TypedEventRecord>();
case MetadataRecordKinds::PidKind:
- return make_unique<PIDRecord>();
+ return std::make_unique<PIDRecord>();
case MetadataRecordKinds::EnumEndMarker:
llvm_unreachable("Invalid MetadataRecordKind");
}
LoadedType, PreReadOffset));
R = std::move(MetadataRecordOrErr.get());
} else {
- R = llvm::make_unique<FunctionRecord>();
+ R = std::make_unique<FunctionRecord>();
}
RecordInitializer RI(E, OffsetPtr);
if (Options.NoOutput)
return true;
- Streamer = llvm::make_unique<DwarfStreamer>(OutFile, Options);
+ Streamer = std::make_unique<DwarfStreamer>(OutFile, Options);
return Streamer->init(TheTriple);
}
} else {
// Add to abbreviation list.
Abbreviations.push_back(
- llvm::make_unique<DIEAbbrev>(Abbrev.getTag(), Abbrev.hasChildren()));
+ std::make_unique<DIEAbbrev>(Abbrev.getTag(), Abbrev.hasChildren()));
for (const auto &Attr : Abbrev.getData())
Abbreviations.back()->AddAttribute(Attr.getAttribute(), Attr.getForm());
AbbreviationsSet.InsertNode(Abbreviations.back().get(), InsertToken);
}
// Add this module.
- Unit = llvm::make_unique<CompileUnit>(*CU, UnitID++, !Options.NoODR,
+ Unit = std::make_unique<CompileUnit>(*CU, UnitID++, !Options.NoODR,
ModuleName);
Unit->setHasInterestingContent();
analyzeContextInfo(CUDie, 0, *Unit, &ODRContexts.getRoot(),
LinkContext.Ranges, OffsetsStringPool,
UniquingStringPool, ODRContexts,
ModulesEndOffset, UnitID, Quiet)) {
- LinkContext.CompileUnits.push_back(llvm::make_unique<CompileUnit>(
+ LinkContext.CompileUnits.push_back(std::make_unique<CompileUnit>(
*CU, UnitID++, !Options.NoODR && !Options.Update, ""));
}
}
MIP = TheTarget->createMCInstPrinter(TheTriple, MAI->getAssemblerDialect(),
*MAI, *MII, *MRI);
MS = TheTarget->createAsmStreamer(
- *MC, llvm::make_unique<formatted_raw_ostream>(OutFile), true, true, MIP,
+ *MC, std::make_unique<formatted_raw_ostream>(OutFile), true, true, MIP,
std::unique_ptr<MCCodeEmitter>(MCE), std::unique_ptr<MCAsmBackend>(MAB),
true);
break;
StringRef BinaryPath) {
loadMainBinarySymbols(MainBinary);
ArrayRef<uint8_t> UUID = MainBinary.getUuid();
- Result = make_unique<DebugMap>(MainBinary.getArchTriple(), BinaryPath, UUID);
+ Result = std::make_unique<DebugMap>(MainBinary.getArchTriple(), BinaryPath, UUID);
MainBinaryStrings = MainBinary.getStringTableData();
for (const SymbolRef &Symbol : MainBinary.symbols()) {
const DataRefImpl &DRI = Symbol.getRawDataRefImpl();
if (!T)
return T.takeError();
- File = llvm::make_unique<sys::fs::TempFile>(std::move(*T));
+ File = std::make_unique<sys::fs::TempFile>(std::move(*T));
return Error::success();
}
std::unique_ptr<ld_plugin_input_file> File;
PluginInputFile(void *Handle) : Handle(Handle) {
- File = llvm::make_unique<ld_plugin_input_file>();
+ File = std::make_unique<ld_plugin_input_file>();
if (get_input_file(Handle, File.get()) != LDPS_OK)
message(LDPL_FATAL, "Failed to get file information");
}
Conf.DebugPassManager = options::debug_pass_manager;
Conf.StatsFile = options::stats_file;
- return llvm::make_unique<LTO>(std::move(Conf), Backend,
+ return std::make_unique<LTO>(std::move(Conf), Backend,
options::ParallelCodeGenParallelismLevel);
}
return nullptr;
assert(options::thinlto_index_only);
std::error_code EC;
- auto LinkedObjectsFile = llvm::make_unique<raw_fd_ostream>(
+ auto LinkedObjectsFile = std::make_unique<raw_fd_ostream>(
options::thinlto_linked_objects_file, EC, sys::fs::OpenFlags::OF_None);
if (EC)
message(LDPL_FATAL, "Failed to create '%s': %s",
for (claimed_file &F : Modules) {
if (options::thinlto && !HandleToInputFile.count(F.leader_handle))
HandleToInputFile.insert(std::make_pair(
- F.leader_handle, llvm::make_unique<PluginInputFile>(F.handle)));
+ F.leader_handle, std::make_unique<PluginInputFile>(F.handle)));
// In case we are thin linking with a minimized bitcode file, ensure
// the module paths encoded in the index reflect where the backends
// will locate the full bitcode files for compiling/importing.
Files[Task].second = !SaveTemps;
int FD = getOutputFileName(Filename, /* TempOutFile */ !SaveTemps,
Files[Task].first, Task);
- return llvm::make_unique<lto::NativeObjectStream>(
- llvm::make_unique<llvm::raw_fd_ostream>(FD, true));
+ return std::make_unique<lto::NativeObjectStream>(
+ std::make_unique<llvm::raw_fd_ostream>(FD, true));
};
auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB) {
sys::fs::OpenFlags OpenFlags = sys::fs::OF_None;
if (!Binary)
OpenFlags |= sys::fs::OF_Text;
- auto FDOut = llvm::make_unique<ToolOutputFile>(OutputFilename, EC, OpenFlags);
+ auto FDOut = std::make_unique<ToolOutputFile>(OutputFilename, EC, OpenFlags);
if (EC) {
WithColor::error() << EC.message() << '\n';
return nullptr;
// Set a diagnostic handler that doesn't exit on the first error
bool HasError = false;
Context.setDiagnosticHandler(
- llvm::make_unique<LLCDiagnosticHandler>(&HasError));
+ std::make_unique<LLCDiagnosticHandler>(&HasError));
Context.setInlineAsmDiagnosticHandler(InlineAsmDiagHandler, &HasError);
Expected<std::unique_ptr<ToolOutputFile>> RemarksFileOrErr =
std::unique_ptr<ToolOutputFile> DwoOut;
if (!SplitDwarfOutputFile.empty()) {
std::error_code EC;
- DwoOut = llvm::make_unique<ToolOutputFile>(SplitDwarfOutputFile, EC,
+ DwoOut = std::make_unique<ToolOutputFile>(SplitDwarfOutputFile, EC,
sys::fs::OF_None);
if (EC) {
WithColor::error(errs(), argv[0]) << EC.message() << '\n';
if ((FileType != TargetMachine::CGFT_AssemblyFile &&
!Out->os().supportsSeeking()) ||
CompileTwice) {
- BOS = make_unique<raw_svector_ostream>(Buffer);
+ BOS = std::make_unique<raw_svector_ostream>(Buffer);
OS = BOS.get();
}
Triple TargetTriple(TargetTripleStr);
// Create a new module.
- std::unique_ptr<Module> M = make_unique<Module>("CygMingHelper", Context);
+ std::unique_ptr<Module> M = std::make_unique<Module>("CygMingHelper", Context);
M->setTargetTriple(TargetTripleStr);
// Create an empty function named "__main".
// Start setting up the JIT environment.
// Parse the main module.
- orc::ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ orc::ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
SMDiagnostic Err;
auto MainModule = parseIRFile(InputFile, Err, *TSCtx.getContext());
if (!MainModule)
close(PipeFD[1][1]);
// Return an RPC channel connected to our end of the pipes.
- return llvm::make_unique<FDRawChannel>(PipeFD[1][0], PipeFD[0][1]);
+ return std::make_unique<FDRawChannel>(PipeFD[1][0], PipeFD[0][1]);
#endif
}
// Create the function filters
if (!NameFilters.empty() || NameWhitelist || !NameRegexFilters.empty()) {
- auto NameFilterer = llvm::make_unique<CoverageFilters>();
+ auto NameFilterer = std::make_unique<CoverageFilters>();
for (const auto &Name : NameFilters)
- NameFilterer->push_back(llvm::make_unique<NameCoverageFilter>(Name));
+ NameFilterer->push_back(std::make_unique<NameCoverageFilter>(Name));
if (NameWhitelist)
NameFilterer->push_back(
- llvm::make_unique<NameWhitelistCoverageFilter>(*NameWhitelist));
+ std::make_unique<NameWhitelistCoverageFilter>(*NameWhitelist));
for (const auto &Regex : NameRegexFilters)
NameFilterer->push_back(
- llvm::make_unique<NameRegexCoverageFilter>(Regex));
+ std::make_unique<NameRegexCoverageFilter>(Regex));
Filters.push_back(std::move(NameFilterer));
}
RegionCoverageGtFilter.getNumOccurrences() ||
LineCoverageLtFilter.getNumOccurrences() ||
LineCoverageGtFilter.getNumOccurrences()) {
- auto StatFilterer = llvm::make_unique<CoverageFilters>();
+ auto StatFilterer = std::make_unique<CoverageFilters>();
if (RegionCoverageLtFilter.getNumOccurrences())
- StatFilterer->push_back(llvm::make_unique<RegionCoverageFilter>(
+ StatFilterer->push_back(std::make_unique<RegionCoverageFilter>(
RegionCoverageFilter::LessThan, RegionCoverageLtFilter));
if (RegionCoverageGtFilter.getNumOccurrences())
- StatFilterer->push_back(llvm::make_unique<RegionCoverageFilter>(
+ StatFilterer->push_back(std::make_unique<RegionCoverageFilter>(
RegionCoverageFilter::GreaterThan, RegionCoverageGtFilter));
if (LineCoverageLtFilter.getNumOccurrences())
- StatFilterer->push_back(llvm::make_unique<LineCoverageFilter>(
+ StatFilterer->push_back(std::make_unique<LineCoverageFilter>(
LineCoverageFilter::LessThan, LineCoverageLtFilter));
if (LineCoverageGtFilter.getNumOccurrences())
- StatFilterer->push_back(llvm::make_unique<LineCoverageFilter>(
+ StatFilterer->push_back(std::make_unique<LineCoverageFilter>(
RegionCoverageFilter::GreaterThan, LineCoverageGtFilter));
Filters.push_back(std::move(StatFilterer));
}
// Create the ignore filename filters.
for (const auto &RE : IgnoreFilenameRegexFilters)
IgnoreFilenameFilters.push_back(
- llvm::make_unique<NameRegexCoverageFilter>(RE));
+ std::make_unique<NameRegexCoverageFilter>(RE));
if (!Arches.empty()) {
for (const std::string &Arch : Arches) {
switch (ViewOpts.Format) {
case CoverageViewOptions::OutputFormat::Text:
- Exporter = llvm::make_unique<CoverageExporterJson>(*Coverage.get(),
+ Exporter = std::make_unique<CoverageExporterJson>(*Coverage.get(),
ViewOpts, outs());
break;
case CoverageViewOptions::OutputFormat::HTML:
// above.
llvm_unreachable("Export in HTML is not supported!");
case CoverageViewOptions::OutputFormat::Lcov:
- Exporter = llvm::make_unique<CoverageExporterLcov>(*Coverage.get(),
+ Exporter = std::make_unique<CoverageExporterLcov>(*Coverage.get(),
ViewOpts, outs());
break;
}
CoveragePrinter::create(const CoverageViewOptions &Opts) {
switch (Opts.Format) {
case CoverageViewOptions::OutputFormat::Text:
- return llvm::make_unique<CoveragePrinterText>(Opts);
+ return std::make_unique<CoveragePrinterText>(Opts);
case CoverageViewOptions::OutputFormat::HTML:
- return llvm::make_unique<CoveragePrinterHTML>(Opts);
+ return std::make_unique<CoveragePrinterHTML>(Opts);
case CoverageViewOptions::OutputFormat::Lcov:
// Unreachable because CodeCoverage.cpp should terminate with an error
// before we get here.
CoverageData &&CoverageInfo) {
switch (Options.Format) {
case CoverageViewOptions::OutputFormat::Text:
- return llvm::make_unique<SourceCoverageViewText>(
+ return std::make_unique<SourceCoverageViewText>(
SourceName, File, Options, std::move(CoverageInfo));
case CoverageViewOptions::OutputFormat::HTML:
- return llvm::make_unique<SourceCoverageViewHTML>(
+ return std::make_unique<SourceCoverageViewHTML>(
SourceName, File, Options, std::move(CoverageInfo));
case CoverageViewOptions::OutputFormat::Lcov:
// Unreachable because CodeCoverage.cpp should terminate with an error
LLVMContext Context;
Context.setDiagnosticHandler(
- llvm::make_unique<LLVMDisDiagnosticHandler>(argv[0]));
+ std::make_unique<LLVMDisDiagnosticHandler>(argv[0]));
cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n");
std::unique_ptr<MemoryBuffer> MB =
using Elf_Phdr_Range = typename ELFT::PhdrRange;
using Elf_Sym_Range = typename ELFT::SymRange;
using Elf_Sym = typename ELFT::Sym;
- std::unique_ptr<ELFStub> DestStub = make_unique<ELFStub>();
+ std::unique_ptr<ELFStub> DestStub = std::make_unique<ELFStub>();
const ELFFile<ELFT> *ElfFile = ElfObj.getELFFile();
// Fetch .dynamic table.
Expected<Elf_Dyn_Range> DynTable = ElfFile->dynamicEntries();
llvm::Triple(FirstPoint.LLVMTriple), 0 /*default variant*/, *AsmInfo_,
*InstrInfo_, *RegInfo_));
- Context_ = llvm::make_unique<llvm::MCContext>(AsmInfo_.get(), RegInfo_.get(),
+ Context_ = std::make_unique<llvm::MCContext>(AsmInfo_.get(), RegInfo_.get(),
&ObjectFileInfo_);
Disasm_.reset(Target.createMCDisassembler(*SubtargetInfo_, *Context_));
assert(Disasm_ && "cannot create MCDisassembler. missing call to "
static std::unique_ptr<llvm::Module>
createModule(const std::unique_ptr<llvm::LLVMContext> &Context,
const llvm::DataLayout DL) {
- auto Module = llvm::make_unique<llvm::Module>(ModuleID, *Context);
+ auto Module = std::make_unique<llvm::Module>(ModuleID, *Context);
Module->setDataLayout(DL);
return Module;
}
llvm::BitVector getFunctionReservedRegs(const llvm::TargetMachine &TM) {
std::unique_ptr<llvm::LLVMContext> Context =
- llvm::make_unique<llvm::LLVMContext>();
+ std::make_unique<llvm::LLVMContext>();
std::unique_ptr<llvm::Module> Module =
createModule(Context, TM.createDataLayout());
// TODO: This only works for targets implementing LLVMTargetMachine.
const LLVMTargetMachine &LLVMTM = static_cast<const LLVMTargetMachine&>(TM);
std::unique_ptr<llvm::MachineModuleInfo> MMI =
- llvm::make_unique<llvm::MachineModuleInfo>(&LLVMTM);
+ std::make_unique<llvm::MachineModuleInfo>(&LLVMTM);
llvm::MachineFunction &MF =
createVoidVoidPtrMachineFunction(FunctionID, Module.get(), MMI.get());
// Saving reserved registers for client.
llvm::ArrayRef<llvm::MCInst> Instructions,
llvm::raw_pwrite_stream &AsmStream) {
std::unique_ptr<llvm::LLVMContext> Context =
- llvm::make_unique<llvm::LLVMContext>();
+ std::make_unique<llvm::LLVMContext>();
std::unique_ptr<llvm::Module> Module =
createModule(Context, TM->createDataLayout());
std::unique_ptr<llvm::MachineModuleInfo> MMI =
- llvm::make_unique<llvm::MachineModuleInfo>(TM.get());
+ std::make_unique<llvm::MachineModuleInfo>(TM.get());
llvm::MachineFunction &MF =
createVoidVoidPtrMachineFunction(FunctionID, Module.get(), MMI.get());
ExecutableFunction::ExecutableFunction(
std::unique_ptr<llvm::LLVMTargetMachine> TM,
llvm::object::OwningBinary<llvm::object::ObjectFile> &&ObjectFileHolder)
- : Context(llvm::make_unique<llvm::LLVMContext>()) {
+ : Context(std::make_unique<llvm::LLVMContext>()) {
assert(ObjectFileHolder.getBinary() && "cannot create object file");
// Initializing the execution engine.
// We need to use the JIT EngineKind to be able to add an object file.
.setMCPU(TM->getTargetCPU())
.setEngineKind(llvm::EngineKind::JIT)
.setMCJITMemoryManager(
- llvm::make_unique<TrackingSectionMemoryManager>(&CodeSize))
+ std::make_unique<TrackingSectionMemoryManager>(&CodeSize))
.create(TM.release()));
if (!ExecEngine)
llvm::report_fatal_error(Error);
BenchmarkRunner::BenchmarkRunner(const LLVMState &State,
InstructionBenchmark::ModeE Mode)
- : State(State), Mode(Mode), Scratch(llvm::make_unique<ScratchSpace>()) {}
+ : State(State), Mode(Mode), Scratch(std::make_unique<ScratchSpace>()) {}
BenchmarkRunner::~BenchmarkRunner() = default;
static constexpr const size_t kAlignment = 1024;
static constexpr const size_t kSize = 1 << 20; // 1MB.
ScratchSpace()
- : UnalignedPtr(llvm::make_unique<char[]>(kSize + kAlignment)),
+ : UnalignedPtr(std::make_unique<char[]>(kSize + kAlignment)),
AlignedPtr(
UnalignedPtr.get() + kAlignment -
(reinterpret_cast<intptr_t>(UnalignedPtr.get()) % kAlignment)) {}
std::unique_ptr<SnippetGenerator>
ExegesisTarget::createLatencySnippetGenerator(const LLVMState &State) const {
- return llvm::make_unique<LatencySnippetGenerator>(State);
+ return std::make_unique<LatencySnippetGenerator>(State);
}
std::unique_ptr<SnippetGenerator>
ExegesisTarget::createUopsSnippetGenerator(const LLVMState &State) const {
- return llvm::make_unique<UopsSnippetGenerator>(State);
+ return std::make_unique<UopsSnippetGenerator>(State);
}
std::unique_ptr<BenchmarkRunner> ExegesisTarget::createLatencyBenchmarkRunner(
const LLVMState &State, InstructionBenchmark::ModeE Mode) const {
- return llvm::make_unique<LatencyBenchmarkRunner>(State, Mode);
+ return std::make_unique<LatencyBenchmarkRunner>(State, Mode);
}
std::unique_ptr<BenchmarkRunner>
ExegesisTarget::createUopsBenchmarkRunner(const LLVMState &State) const {
- return llvm::make_unique<UopsBenchmarkRunner>(State);
+ return std::make_unique<UopsBenchmarkRunner>(State);
}
void ExegesisTarget::randomizeMCOperand(
std::unique_ptr<SnippetGenerator>
createLatencySnippetGenerator(const LLVMState &State) const override {
- return llvm::make_unique<X86LatencySnippetGenerator>(State);
+ return std::make_unique<X86LatencySnippetGenerator>(State);
}
std::unique_ptr<SnippetGenerator>
createUopsSnippetGenerator(const LLVMState &State) const override {
- return llvm::make_unique<X86UopsSnippetGenerator>(State);
+ return std::make_unique<X86UopsSnippetGenerator>(State);
}
bool matchesArch(llvm::Triple::ArchType Arch) const override {
new InjectorIRStrategy(InjectorIRStrategy::getDefaultOps()));
Strategies.emplace_back(new InstDeleterIRStrategy());
- return llvm::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
+ return std::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
}
extern "C" LLVM_ATTRIBUTE_USED size_t LLVMFuzzerCustomMutator(
};
if (!NoExec && !TT.isOSWindows())
- ObjLayer.addPlugin(llvm::make_unique<EHFrameRegistrationPlugin>(
+ ObjLayer.addPlugin(std::make_unique<EHFrameRegistrationPlugin>(
InProcessEHFrameRegistrar::getInstance()));
- ObjLayer.addPlugin(llvm::make_unique<JITLinkSessionPlugin>(*this));
+ ObjLayer.addPlugin(std::make_unique<JITLinkSessionPlugin>(*this));
}
void Session::dumpSessionInfo(raw_ostream &OS) {
assert(EntryPoint.getAddress() && "Entry point address should not be null");
constexpr const char *JITProgramName = "<llvm-jitlink jit'd code>";
- auto PNStorage = llvm::make_unique<char[]>(strlen(JITProgramName) + 1);
+ auto PNStorage = std::make_unique<char[]>(strlen(JITProgramName) + 1);
strcpy(PNStorage.get(), JITProgramName);
std::vector<const char *> EntryPointArgs;
LLVMContext Context;
Context.setDiagnosticHandler(
- llvm::make_unique<LLVMLinkDiagnosticHandler>(), true);
+ std::make_unique<LLVMLinkDiagnosticHandler>(), true);
cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
if (!DisableDITypeMap)
Context.enableDebugTypeODRUniquing();
- auto Composite = make_unique<Module>("llvm-link", Context);
+ auto Composite = std::make_unique<Module>("llvm-link", Context);
Linker L(*Composite);
unsigned Flags = Linker::Flags::None;
error(BufferOrErr, "error loading file '" + Path + "'");
Buffer = std::move(BufferOrErr.get());
CurrentActivity = ("loading file '" + Path + "'").str();
- std::unique_ptr<LLVMContext> Context = llvm::make_unique<LLVMContext>();
- Context->setDiagnosticHandler(llvm::make_unique<LLVMLTODiagnosticHandler>(),
+ std::unique_ptr<LLVMContext> Context = std::make_unique<LLVMContext>();
+ Context->setDiagnosticHandler(std::make_unique<LLVMLTODiagnosticHandler>(),
true);
ErrorOr<std::unique_ptr<LTOModule>> Ret = LTOModule::createInLocalContext(
std::move(Context), Buffer->getBufferStart(), Buffer->getBufferSize(),
unsigned BaseArg = 0;
LLVMContext Context;
- Context.setDiagnosticHandler(llvm::make_unique<LLVMLTODiagnosticHandler>(),
+ Context.setDiagnosticHandler(std::make_unique<LLVMLTODiagnosticHandler>(),
true);
LTOCodeGenerator CodeGen(Context);
std::string Path = OutputFilename + "." + utostr(Task);
std::error_code EC;
- auto S = llvm::make_unique<raw_fd_ostream>(Path, EC, sys::fs::OF_None);
+ auto S = std::make_unique<raw_fd_ostream>(Path, EC, sys::fs::OF_None);
check(EC, Path);
- return llvm::make_unique<lto::NativeObjectStream>(std::move(S));
+ return std::make_unique<lto::NativeObjectStream>(std::move(S));
};
auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB) {
std::string OutputString;
raw_string_ostream Out(OutputString);
- auto FOut = llvm::make_unique<formatted_raw_ostream>(Out);
+ auto FOut = std::make_unique<formatted_raw_ostream>(Out);
std::unique_ptr<MCStreamer> Str;
std::error_code EC;
const std::string OutputFilename = "-";
auto Out =
- llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::OF_None);
+ std::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::OF_None);
if (EC) {
errs() << EC.message() << '\n';
abort();
std::unique_ptr<buffer_ostream> BOS;
raw_pwrite_stream *OS = &Out->os();
if (!Out->os().supportsSeeking()) {
- BOS = make_unique<buffer_ostream>(Out->os());
+ BOS = std::make_unique<buffer_ostream>(Out->os());
OS = BOS.get();
}
static std::unique_ptr<ToolOutputFile> GetOutputStream(StringRef Path) {
std::error_code EC;
- auto Out = llvm::make_unique<ToolOutputFile>(Path, EC, sys::fs::OF_None);
+ auto Out = std::make_unique<ToolOutputFile>(Path, EC, sys::fs::OF_None);
if (EC) {
WithColor::error() << EC.message() << '\n';
return nullptr;
std::unique_ptr<MCAsmBackend> MAB(
TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions));
- auto FOut = llvm::make_unique<formatted_raw_ostream>(*OS);
+ auto FOut = std::make_unique<formatted_raw_ostream>(*OS);
Str.reset(
TheTarget->createAsmStreamer(Ctx, std::move(FOut), /*asmverbose*/ true,
/*useDwarfDirectory*/ true, IP,
Ctx.setUseNamesOnTempLabels(false);
if (!Out->os().supportsSeeking()) {
- BOS = make_unique<buffer_ostream>(Out->os());
+ BOS = std::make_unique<buffer_ostream>(Out->os());
OS = BOS.get();
}
CodeRegions::CodeRegions(llvm::SourceMgr &S) : SM(S), FoundErrors(false) {
// Create a default region for the input code sequence.
- Regions.emplace_back(make_unique<CodeRegion>("", SMLoc()));
+ Regions.emplace_back(std::make_unique<CodeRegion>("", SMLoc()));
}
bool CodeRegion::isLocInRange(SMLoc Loc) const {
if (Regions.size() == 1 && !Regions[0]->startLoc().isValid() &&
!Regions[0]->endLoc().isValid()) {
ActiveRegions[Description] = 0;
- Regions[0] = make_unique<CodeRegion>(Description, Loc);
+ Regions[0] = std::make_unique<CodeRegion>(Description, Loc);
return;
}
} else {
}
ActiveRegions[Description] = Regions.size();
- Regions.emplace_back(make_unique<CodeRegion>(Description, Loc));
+ Regions.emplace_back(std::make_unique<CodeRegion>(Description, Loc));
return;
}
OutputFilename = "-";
std::error_code EC;
auto Out =
- llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::OF_None);
+ std::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::OF_None);
if (!EC)
return std::move(Out);
return EC;
if (PrintInstructionTables) {
// Create a pipeline, stages, and a printer.
- auto P = llvm::make_unique<mca::Pipeline>();
- P->appendStage(llvm::make_unique<mca::EntryStage>(S));
- P->appendStage(llvm::make_unique<mca::InstructionTables>(SM));
+ auto P = std::make_unique<mca::Pipeline>();
+ P->appendStage(std::make_unique<mca::EntryStage>(S));
+ P->appendStage(std::make_unique<mca::InstructionTables>(SM));
mca::PipelinePrinter Printer(*P);
// Create the views for this pipeline, execute, and emit a report.
if (PrintInstructionInfoView) {
- Printer.addView(llvm::make_unique<mca::InstructionInfoView>(
+ Printer.addView(std::make_unique<mca::InstructionInfoView>(
*STI, *MCII, CE, ShowEncoding, Insts, *IP));
}
Printer.addView(
- llvm::make_unique<mca::ResourcePressureView>(*STI, *IP, Insts));
+ std::make_unique<mca::ResourcePressureView>(*STI, *IP, Insts));
if (!runPipeline(*P))
return 1;
if (PrintSummaryView)
Printer.addView(
- llvm::make_unique<mca::SummaryView>(SM, Insts, DispatchWidth));
+ std::make_unique<mca::SummaryView>(SM, Insts, DispatchWidth));
if (EnableBottleneckAnalysis) {
- Printer.addView(llvm::make_unique<mca::BottleneckAnalysis>(
+ Printer.addView(std::make_unique<mca::BottleneckAnalysis>(
*STI, *IP, Insts, S.getNumIterations()));
}
if (PrintInstructionInfoView)
- Printer.addView(llvm::make_unique<mca::InstructionInfoView>(
+ Printer.addView(std::make_unique<mca::InstructionInfoView>(
*STI, *MCII, CE, ShowEncoding, Insts, *IP));
if (PrintDispatchStats)
- Printer.addView(llvm::make_unique<mca::DispatchStatistics>());
+ Printer.addView(std::make_unique<mca::DispatchStatistics>());
if (PrintSchedulerStats)
- Printer.addView(llvm::make_unique<mca::SchedulerStatistics>(*STI));
+ Printer.addView(std::make_unique<mca::SchedulerStatistics>(*STI));
if (PrintRetireStats)
- Printer.addView(llvm::make_unique<mca::RetireControlUnitStatistics>(SM));
+ Printer.addView(std::make_unique<mca::RetireControlUnitStatistics>(SM));
if (PrintRegisterFileStats)
- Printer.addView(llvm::make_unique<mca::RegisterFileStatistics>(*STI));
+ Printer.addView(std::make_unique<mca::RegisterFileStatistics>(*STI));
if (PrintResourcePressureView)
Printer.addView(
- llvm::make_unique<mca::ResourcePressureView>(*STI, *IP, Insts));
+ std::make_unique<mca::ResourcePressureView>(*STI, *IP, Insts));
if (PrintTimelineView) {
unsigned TimelineIterations =
TimelineMaxIterations ? TimelineMaxIterations : 10;
- Printer.addView(llvm::make_unique<mca::TimelineView>(
+ Printer.addView(std::make_unique<mca::TimelineView>(
*STI, *IP, Insts, std::min(TimelineIterations, S.getNumIterations()),
TimelineMaxCycles));
}
}
Expected<std::unique_ptr<Object>> COFFReader::create() const {
- auto Obj = llvm::make_unique<Object>();
+ auto Obj = std::make_unique<Object>();
const coff_file_header *CFH = nullptr;
const coff_bigobj_file_header *CBFH = nullptr;
// Depending on the initial ELFT and OutputFormat we need a different Writer.
switch (OutputElfType) {
case ELFT_ELF32LE:
- return llvm::make_unique<ELFWriter<ELF32LE>>(Obj, Buf,
+ return std::make_unique<ELFWriter<ELF32LE>>(Obj, Buf,
!Config.StripSections);
case ELFT_ELF64LE:
- return llvm::make_unique<ELFWriter<ELF64LE>>(Obj, Buf,
+ return std::make_unique<ELFWriter<ELF64LE>>(Obj, Buf,
!Config.StripSections);
case ELFT_ELF32BE:
- return llvm::make_unique<ELFWriter<ELF32BE>>(Obj, Buf,
+ return std::make_unique<ELFWriter<ELF32BE>>(Obj, Buf,
!Config.StripSections);
case ELFT_ELF64BE:
- return llvm::make_unique<ELFWriter<ELF64BE>>(Obj, Buf,
+ return std::make_unique<ELFWriter<ELF64BE>>(Obj, Buf,
!Config.StripSections);
}
llvm_unreachable("Invalid output format");
ElfType OutputElfType) {
switch (Config.OutputFormat) {
case FileFormat::Binary:
- return llvm::make_unique<BinaryWriter>(Obj, Buf);
+ return std::make_unique<BinaryWriter>(Obj, Buf);
case FileFormat::IHex:
- return llvm::make_unique<IHexWriter>(Obj, Buf);
+ return std::make_unique<IHexWriter>(Obj, Buf);
default:
return createELFWriter(Config, Obj, Buf, OutputElfType);
}
Sym.Visibility = Visibility;
Sym.Size = SymbolSize;
Sym.Index = Symbols.size();
- Symbols.emplace_back(llvm::make_unique<Symbol>(Sym));
+ Symbols.emplace_back(std::make_unique<Symbol>(Sym));
Size += this->EntrySize;
}
}
std::unique_ptr<Object> ELFReader::create() const {
- auto Obj = llvm::make_unique<Object>();
+ auto Obj = std::make_unique<Object>();
if (auto *O = dyn_cast<ELFObjectFile<ELF32LE>>(Bin)) {
ELFBuilder<ELF32LE> Builder(*O, *Obj, ExtractPartition);
Builder.build();
// Also, the output arch may not be the same as the input arch, so fix up
// size-related fields before doing layout calculations.
uint64_t Index = 0;
- auto SecSizer = llvm::make_unique<ELFSectionSizer<ELFT>>();
+ auto SecSizer = std::make_unique<ELFSectionSizer<ELFT>>();
for (auto &Sec : Obj.sections()) {
Sec.Index = Index++;
Sec.accept(*SecSizer);
if (Error E = Buf.allocate(totalSize()))
return E;
- SecWriter = llvm::make_unique<ELFSectionWriter<ELFT>>(Buf);
+ SecWriter = std::make_unique<ELFSectionWriter<ELFT>>(Buf);
return Error::success();
}
if (Error E = Buf.allocate(TotalSize))
return E;
- SecWriter = llvm::make_unique<BinarySectionWriter>(Buf);
+ SecWriter = std::make_unique<BinarySectionWriter>(Buf);
return Error::success();
}
public:
BasicELFBuilder(uint16_t EM)
- : EMachine(EM), Obj(llvm::make_unique<Object>()) {}
+ : EMachine(EM), Obj(std::make_unique<Object>()) {}
};
class BinaryELFBuilder : public BasicELFBuilder {
std::function<bool(const SectionBase &)> ToRemove);
Error removeSymbols(function_ref<bool(const Symbol &)> ToRemove);
template <class T, class... Ts> T &addSection(Ts &&... Args) {
- auto Sec = llvm::make_unique<T>(std::forward<Ts>(Args)...);
+ auto Sec = std::make_unique<T>(std::forward<Ts>(Args)...);
auto Ptr = Sec.get();
MustBeRelocatable |= isa<RelocationSection>(*Ptr);
Sections.emplace_back(std::move(Sec));
return *Ptr;
}
Segment &addSegment(ArrayRef<uint8_t> Data) {
- Segments.emplace_back(llvm::make_unique<Segment>(Data));
+ Segments.emplace_back(std::make_unique<Segment>(Data));
return *Segments.back();
}
bool isRelocatable() const {
StrTable,
MachOObj.getSymbolTableEntry(Symbol.getRawDataRefImpl())));
- O.SymTable.Symbols.push_back(llvm::make_unique<SymbolEntry>(SE));
+ O.SymTable.Symbols.push_back(std::make_unique<SymbolEntry>(SE));
}
}
}
std::unique_ptr<Object> MachOReader::create() const {
- auto Obj = llvm::make_unique<Object>();
+ auto Obj = std::make_unique<Object>();
readHeader(*Obj);
readLoadCommands(*Obj);
readSymbolTable(*Obj);
if (strcmp(*ReferenceName, "_objc_msgSend") == 0) {
if (info->selector_name != nullptr) {
if (info->class_name != nullptr) {
- info->method = llvm::make_unique<char[]>(
+ info->method = std::make_unique<char[]>(
5 + strlen(info->class_name) + strlen(info->selector_name));
char *method = info->method.get();
if (method != nullptr) {
}
} else {
info->method =
- llvm::make_unique<char[]>(9 + strlen(info->selector_name));
+ std::make_unique<char[]>(9 + strlen(info->selector_name));
char *method = info->method.get();
if (method != nullptr) {
if (Arch == Triple::x86_64)
} else if (strcmp(*ReferenceName, "_objc_msgSendSuper2") == 0) {
if (info->selector_name != nullptr) {
info->method =
- llvm::make_unique<char[]>(17 + strlen(info->selector_name));
+ std::make_unique<char[]>(17 + strlen(info->selector_name));
char *method = info->method.get();
if (method != nullptr) {
if (Arch == Triple::x86_64)
static const char *get_dyld_bind_info_symbolname(uint64_t ReferenceValue,
struct DisassembleInfo *info) {
if (info->bindtable == nullptr) {
- info->bindtable = llvm::make_unique<SymbolAddressMap>();
+ info->bindtable = std::make_unique<SymbolAddressMap>();
Error Err = Error::success();
for (const object::MachOBindEntry &Entry : info->O->bindTable(Err)) {
uint64_t Address = Entry.address();
std::vector<std::unique_ptr<IRMutationStrategy>> Strategies;
Strategies.push_back(
- llvm::make_unique<InjectorIRStrategy>(
+ std::make_unique<InjectorIRStrategy>(
InjectorIRStrategy::getDefaultOps()));
Strategies.push_back(
- llvm::make_unique<InstDeleterIRStrategy>());
+ std::make_unique<InstDeleterIRStrategy>());
- return llvm::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
+ return std::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
}
extern "C" LLVM_ATTRIBUTE_USED size_t LLVMFuzzerCustomMutator(
uint32_t Count = Tpi->getNumTypeRecords();
auto Offsets = Tpi->getTypeIndexOffsets();
TypeCollection =
- llvm::make_unique<LazyRandomTypeCollection>(Types, Count, Offsets);
+ std::make_unique<LazyRandomTypeCollection>(Types, Count, Offsets);
return *TypeCollection;
}
Dumper.setSymbolGroup(&Strings);
for (auto Symbol : Symbols) {
if (auto EC = Visitor.visitSymbolRecord(Symbol)) {
- SymbolError = llvm::make_unique<Error>(std::move(EC));
+ SymbolError = std::make_unique<Error>(std::move(EC));
return;
}
}
Error ExplainOutputStyle::explainBinaryFile() {
std::unique_ptr<BinaryByteStream> Stream =
- llvm::make_unique<BinaryByteStream>(File.unknown().getBuffer(),
+ std::make_unique<BinaryByteStream>(File.unknown().getBuffer(),
llvm::support::little);
switch (opts::explain::InputType) {
case opts::explain::InputFileType::DBIStream: {
uint32_t Count = Stream.getNumTypeRecords();
auto Offsets = Stream.getTypeIndexOffsets();
Collection =
- llvm::make_unique<LazyRandomTypeCollection>(Array, Count, Offsets);
+ std::make_unique<LazyRandomTypeCollection>(Array, Count, Offsets);
return *Collection;
}
if (!isDebugTSection(Section, Records))
continue;
- Types = llvm::make_unique<LazyRandomTypeCollection>(Records, 100);
+ Types = std::make_unique<LazyRandomTypeCollection>(Records, 100);
return *Types;
}
- Types = llvm::make_unique<LazyRandomTypeCollection>(100);
+ Types = std::make_unique<LazyRandomTypeCollection>(100);
return *Types;
}
continue;
}
- auto Layout = llvm::make_unique<ClassLayout>(std::move(Class));
+ auto Layout = std::make_unique<ClassLayout>(std::move(Class));
if (Layout->deepPaddingSize() < opts::pretty::PaddingThreshold) {
++Discarded;
continue;
continue;
}
- auto Layout = llvm::make_unique<ClassLayout>(std::move(Class));
+ auto Layout = std::make_unique<ClassLayout>(std::move(Class));
if (Layout->deepPaddingSize() < opts::pretty::PaddingThreshold)
continue;
std::unique_ptr<IPDBSession> Session;
auto &File = loadPDB(Path, Session);
- auto O = llvm::make_unique<YAMLOutputStyle>(File);
- O = llvm::make_unique<YAMLOutputStyle>(File);
+ auto O = std::make_unique<YAMLOutputStyle>(File);
+ O = std::make_unique<YAMLOutputStyle>(File);
ExitOnErr(O->dump());
}
static void dumpRaw(StringRef Path) {
InputFile IF = ExitOnErr(InputFile::open(Path));
- auto O = llvm::make_unique<DumpOutputStyle>(IF);
+ auto O = std::make_unique<DumpOutputStyle>(IF);
ExitOnErr(O->dump());
}
std::unique_ptr<IPDBSession> Session;
auto &File = loadPDB(Path, Session);
- auto O = llvm::make_unique<BytesOutputStyle>(File);
+ auto O = std::make_unique<BytesOutputStyle>(File);
ExitOnErr(O->dump());
}
ExitOnErr(InputFile::open(opts::explain::InputFilename.front(), true));
for (uint64_t Off : opts::explain::Offsets) {
- auto O = llvm::make_unique<ExplainOutputStyle>(IF, Off);
+ auto O = std::make_unique<ExplainOutputStyle>(IF, Off);
ExitOnErr(O->dump());
}
if (!BufOrError)
exitWithErrorCode(BufOrError.getError(), InputFile);
- auto Remapper = llvm::make_unique<SymbolRemapper>();
+ auto Remapper = std::make_unique<SymbolRemapper>();
Remapper->File = std::move(BufOrError.get());
for (line_iterator LineIt(*Remapper->File, /*SkipBlanks=*/true, '#');
// Initialize the writer contexts.
SmallVector<std::unique_ptr<WriterContext>, 4> Contexts;
for (unsigned I = 0; I < NumThreads; ++I)
- Contexts.emplace_back(llvm::make_unique<WriterContext>(
+ Contexts.emplace_back(std::make_unique<WriterContext>(
OutputSparse, ErrorLock, WriterErrorCodes));
if (NumThreads == 1) {
ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements());
RETURN_IF_ERROR(consumeType(Kind::BlockBegin));
- auto Accels = llvm::make_unique<AcceleratorsResource>(
+ auto Accels = std::make_unique<AcceleratorsResource>(
std::move(*OptStatements), MemoryFlags);
while (!consumeOptionalType(Kind::BlockEnd)) {
uint16_t MemoryFlags =
parseMemoryFlags(CursorResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<CursorResource>(*Arg, MemoryFlags);
+ return std::make_unique<CursorResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseDialogResource(bool IsExtended) {
"parseOptionalStatements, when successful, halts on BlockBegin.");
consume();
- auto Dialog = llvm::make_unique<DialogResource>(
+ auto Dialog = std::make_unique<DialogResource>(
(*LocResult)[0], (*LocResult)[1], (*LocResult)[2], (*LocResult)[3],
HelpID, std::move(*OptStatements), IsExtended, MemoryFlags);
switch (look().kind()) {
case Kind::String:
case Kind::Identifier:
- return llvm::make_unique<UserDefinedResource>(Type, read().value(),
+ return std::make_unique<UserDefinedResource>(Type, read().value(),
MemoryFlags);
default:
break;
Data.push_back(*Item);
}
- return llvm::make_unique<UserDefinedResource>(Type, std::move(Data),
+ return std::make_unique<UserDefinedResource>(Type, std::move(Data),
MemoryFlags);
}
parseMemoryFlags(VersionInfoResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(FixedResult, parseVersionInfoFixed());
ASSIGN_OR_RETURN(BlockResult, parseVersionInfoBlockContents(StringRef()));
- return llvm::make_unique<VersionInfoResource>(
+ return std::make_unique<VersionInfoResource>(
std::move(**BlockResult), std::move(*FixedResult), MemoryFlags);
}
uint16_t MemoryFlags =
parseMemoryFlags(BitmapResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<BitmapResource>(*Arg, MemoryFlags);
+ return std::make_unique<BitmapResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseIconResource() {
uint16_t MemoryFlags =
parseMemoryFlags(IconResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<IconResource>(*Arg, MemoryFlags);
+ return std::make_unique<IconResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseHTMLResource() {
uint16_t MemoryFlags =
parseMemoryFlags(HTMLResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<HTMLResource>(*Arg, MemoryFlags);
+ return std::make_unique<HTMLResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseMenuResource() {
parseMemoryFlags(MenuResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements());
ASSIGN_OR_RETURN(Items, parseMenuItemsList());
- return llvm::make_unique<MenuResource>(std::move(*OptStatements),
+ return std::make_unique<MenuResource>(std::move(*OptStatements),
std::move(*Items), MemoryFlags);
}
// Now, expecting SEPARATOR.
ASSIGN_OR_RETURN(SeparatorResult, readIdentifier());
if (SeparatorResult->equals_lower("SEPARATOR")) {
- List.addDefinition(llvm::make_unique<MenuSeparator>());
+ List.addDefinition(std::make_unique<MenuSeparator>());
continue;
}
if (IsPopup) {
// If POPUP, read submenu items recursively.
ASSIGN_OR_RETURN(SubMenuResult, parseMenuItemsList());
- List.addDefinition(llvm::make_unique<PopupItem>(
+ List.addDefinition(std::make_unique<PopupItem>(
*CaptionResult, *FlagsResult, std::move(*SubMenuResult)));
continue;
}
assert(IsMenuItem);
List.addDefinition(
- llvm::make_unique<MenuItem>(*CaptionResult, MenuResult, *FlagsResult));
+ std::make_unique<MenuItem>(*CaptionResult, MenuResult, *FlagsResult));
}
return std::move(List);
ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements());
RETURN_IF_ERROR(consumeType(Kind::BlockBegin));
- auto Table = llvm::make_unique<StringTableResource>(std::move(*OptStatements),
+ auto Table = std::make_unique<StringTableResource>(std::move(*OptStatements),
MemoryFlags);
// Read strings until we reach the end of the block.
RCParser::parseVersionInfoBlockContents(StringRef BlockName) {
RETURN_IF_ERROR(consumeType(Kind::BlockBegin));
- auto Contents = llvm::make_unique<VersionInfoBlock>(BlockName);
+ auto Contents = std::make_unique<VersionInfoBlock>(BlockName);
while (!isNextTokenKind(Kind::BlockEnd)) {
ASSIGN_OR_RETURN(Stmt, parseVersionInfoStmt());
Values.push_back(*ValueResult);
PrecedingCommas.push_back(HadComma);
}
- return llvm::make_unique<VersionInfoValue>(*KeyResult, std::move(Values),
+ return std::make_unique<VersionInfoValue>(*KeyResult, std::move(Values),
std::move(PrecedingCommas));
}
RCParser::ParseOptionType RCParser::parseLanguageStmt() {
ASSIGN_OR_RETURN(Args, readIntsWithCommas(/* min = */ 2, /* max = */ 2));
- return llvm::make_unique<LanguageResource>((*Args)[0], (*Args)[1]);
+ return std::make_unique<LanguageResource>((*Args)[0], (*Args)[1]);
}
RCParser::ParseOptionType RCParser::parseCharacteristicsStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<CharacteristicsStmt>(*Arg);
+ return std::make_unique<CharacteristicsStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseVersionStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<VersionStmt>(*Arg);
+ return std::make_unique<VersionStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseCaptionStmt() {
ASSIGN_OR_RETURN(Arg, readString());
- return llvm::make_unique<CaptionStmt>(*Arg);
+ return std::make_unique<CaptionStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseClassStmt() {
ASSIGN_OR_RETURN(Arg, readIntOrString());
- return llvm::make_unique<ClassStmt>(*Arg);
+ return std::make_unique<ClassStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseFontStmt(OptStmtType DialogType) {
FontCharset = (*Args)[2];
}
}
- return llvm::make_unique<FontStmt>(*SizeResult, *NameResult, FontWeight,
+ return std::make_unique<FontStmt>(*SizeResult, *NameResult, FontWeight,
FontItalic, FontCharset);
}
RCParser::ParseOptionType RCParser::parseStyleStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<StyleStmt>(*Arg);
+ return std::make_unique<StyleStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseExStyleStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<ExStyleStmt>(*Arg);
+ return std::make_unique<ExStyleStmt>(*Arg);
}
Error RCParser::getExpectedError(const Twine &Message, bool IsAlreadyRead) {
OptStatementsRCResource(OptionalStmtList &&Stmts,
uint16_t Flags = RCResource::getDefaultMemoryFlags())
: RCResource(Flags),
- OptStatements(llvm::make_unique<OptionalStmtList>(std::move(Stmts))) {}
+ OptStatements(std::make_unique<OptionalStmtList>(std::move(Stmts))) {}
virtual Error applyStmts(Visitor *V) const { return OptStatements->visit(V); }
};
"No more than one output file should be provided (using /FO flag).");
std::error_code EC;
- auto FOut = llvm::make_unique<raw_fd_ostream>(
+ auto FOut = std::make_unique<raw_fd_ostream>(
OutArgsInfo[0], EC, sys::fs::FA_Read | sys::fs::FA_Write);
if (EC)
fatalError("Error opening output file '" + OutArgsInfo[0] +
"': " + EC.message());
- Visitor = llvm::make_unique<ResourceFileWriter>(Params, std::move(FOut));
+ Visitor = std::make_unique<ResourceFileWriter>(Params, std::move(FOut));
Visitor->AppendNull = InputArgs.hasArg(OPT_ADD_NULL);
ExitOnErr(NullResource().visit(Visitor.get()));
StringRef SectionContents) {
ArrayRef<uint8_t> BinaryData(Subsection.bytes_begin(),
Subsection.bytes_end());
- auto CODD = llvm::make_unique<COFFObjectDumpDelegate>(*this, Section, Obj,
+ auto CODD = std::make_unique<COFFObjectDumpDelegate>(*this, Section, Obj,
SectionContents);
CVSymbolDumper CVSD(W, Types, CodeViewContainer::ObjectFile, std::move(CODD),
CompilationCPUType, opts::CodeViewSubsectionBytes);
ObjectFile &Obj = **MaybeObj;
if (!Checker)
- Checker = llvm::make_unique<RuntimeDyldChecker>(
+ Checker = std::make_unique<RuntimeDyldChecker>(
IsSymbolValid, GetSymbolInfo, GetSectionInfo, GetStubInfo,
GetStubInfo, Obj.isLittleEndian() ? support::little : support::big,
Disassembler.get(), InstPrinter.get(), dbgs());
cl::ParseCommandLineOptions(argc, argv, "llvm codegen stress-tester\n");
llvm_shutdown_obj Y;
- auto M = llvm::make_unique<Module>("/tmp/autogen.bc", Context);
+ auto M = std::make_unique<Module>("/tmp/autogen.bc", Context);
Function *F = GenEmptyFunction(M.get());
// Pick an initial seed value
static LLVMContext Context;
LTOContext = &Context;
LTOContext->setDiagnosticHandler(
- llvm::make_unique<LTOToolDiagnosticHandler>(), true);
+ std::make_unique<LTOToolDiagnosticHandler>(), true);
initialized = true;
}
}
llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
// Create a local context. Ownership will be transferred to LTOModule.
- std::unique_ptr<LLVMContext> Context = llvm::make_unique<LLVMContext>();
- Context->setDiagnosticHandler(llvm::make_unique<LTOToolDiagnosticHandler>(),
+ std::unique_ptr<LLVMContext> Context = std::make_unique<LLVMContext>();
+ Context->setDiagnosticHandler(std::make_unique<LTOToolDiagnosticHandler>(),
true);
ErrorOr<std::unique_ptr<LTOModule>> M = LTOModule::createInLocalContext(
TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
LibLTOCodeGenerator *CodeGen =
- InLocalContext ? new LibLTOCodeGenerator(make_unique<LLVMContext>())
+ InLocalContext ? new LibLTOCodeGenerator(std::make_unique<LLVMContext>())
: new LibLTOCodeGenerator();
CodeGen->setTargetOptions(Options);
return wrap(CodeGen);
}
template <class ELFT> Expected<ELFYAML::Object *> ELFDumper<ELFT>::dump() {
- auto Y = make_unique<ELFYAML::Object>();
+ auto Y = std::make_unique<ELFYAML::Object>();
// Dump header. We do not dump SHEntSize, SHOffset, SHNum and SHStrNdx field.
// When not explicitly set, the values are set by yaml2obj automatically
template <class ELFT>
Expected<ELFYAML::DynamicSection *>
ELFDumper<ELFT>::dumpDynamicSection(const Elf_Shdr *Shdr) {
- auto S = make_unique<ELFYAML::DynamicSection>();
+ auto S = std::make_unique<ELFYAML::DynamicSection>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
template <class ELFT>
Expected<ELFYAML::RelocationSection *>
ELFDumper<ELFT>::dumpRelocSection(const Elf_Shdr *Shdr) {
- auto S = make_unique<ELFYAML::RelocationSection>();
+ auto S = std::make_unique<ELFYAML::RelocationSection>();
if (auto E = dumpCommonRelocationSection(Shdr, *S))
return std::move(E);
template <class ELFT>
Expected<ELFYAML::RawContentSection *>
ELFDumper<ELFT>::dumpContentSection(const Elf_Shdr *Shdr) {
- auto S = make_unique<ELFYAML::RawContentSection>();
+ auto S = std::make_unique<ELFYAML::RawContentSection>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
template <class ELFT>
Expected<ELFYAML::SymtabShndxSection *>
ELFDumper<ELFT>::dumpSymtabShndxSection(const Elf_Shdr *Shdr) {
- auto S = make_unique<ELFYAML::SymtabShndxSection>();
+ auto S = std::make_unique<ELFYAML::SymtabShndxSection>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
template <class ELFT>
Expected<ELFYAML::NoBitsSection *>
ELFDumper<ELFT>::dumpNoBitsSection(const Elf_Shdr *Shdr) {
- auto S = make_unique<ELFYAML::NoBitsSection>();
+ auto S = std::make_unique<ELFYAML::NoBitsSection>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
S->Size = Shdr->sh_size;
typedef typename ELFT::Verdef Elf_Verdef;
typedef typename ELFT::Verdaux Elf_Verdaux;
- auto S = make_unique<ELFYAML::VerdefSection>();
+ auto S = std::make_unique<ELFYAML::VerdefSection>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
ELFDumper<ELFT>::dumpSymverSection(const Elf_Shdr *Shdr) {
typedef typename ELFT::Half Elf_Half;
- auto S = make_unique<ELFYAML::SymverSection>();
+ auto S = std::make_unique<ELFYAML::SymverSection>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
typedef typename ELFT::Verneed Elf_Verneed;
typedef typename ELFT::Vernaux Elf_Vernaux;
- auto S = make_unique<ELFYAML::VerneedSection>();
+ auto S = std::make_unique<ELFYAML::VerneedSection>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
template <class ELFT>
Expected<ELFYAML::Group *> ELFDumper<ELFT>::dumpGroup(const Elf_Shdr *Shdr) {
- auto S = make_unique<ELFYAML::Group>();
+ auto S = std::make_unique<ELFYAML::Group>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
ELFDumper<ELFT>::dumpMipsABIFlags(const Elf_Shdr *Shdr) {
assert(Shdr->sh_type == ELF::SHT_MIPS_ABIFLAGS &&
"Section type is not SHT_MIPS_ABIFLAGS");
- auto S = make_unique<ELFYAML::MipsABIFlags>();
+ auto S = std::make_unique<ELFYAML::MipsABIFlags>();
if (Error E = dumpCommonSection(Shdr, *S))
return std::move(E);
}
Expected<std::unique_ptr<MachOYAML::Object>> MachODumper::dump() {
- auto Y = make_unique<MachOYAML::Object>();
+ auto Y = std::make_unique<MachOYAML::Object>();
Y->IsLittleEndian = Obj.isLittleEndian();
dumpHeader(Y);
dumpLoadCommands(Y);
std::unique_ptr<WasmYAML::CustomSection> CustomSec;
if (WasmSec.Name == "dylink") {
std::unique_ptr<WasmYAML::DylinkSection> DylinkSec =
- make_unique<WasmYAML::DylinkSection>();
+ std::make_unique<WasmYAML::DylinkSection>();
const wasm::WasmDylinkInfo& Info = Obj.dylinkInfo();
DylinkSec->MemorySize = Info.MemorySize;
DylinkSec->MemoryAlignment = Info.MemoryAlignment;
CustomSec = std::move(DylinkSec);
} else if (WasmSec.Name == "name") {
std::unique_ptr<WasmYAML::NameSection> NameSec =
- make_unique<WasmYAML::NameSection>();
+ std::make_unique<WasmYAML::NameSection>();
for (const llvm::wasm::WasmFunctionName &Func : Obj.debugNames()) {
WasmYAML::NameEntry NameEntry;
NameEntry.Name = Func.Name;
CustomSec = std::move(NameSec);
} else if (WasmSec.Name == "linking") {
std::unique_ptr<WasmYAML::LinkingSection> LinkingSec =
- make_unique<WasmYAML::LinkingSection>();
+ std::make_unique<WasmYAML::LinkingSection>();
LinkingSec->Version = Obj.linkingData().Version;
ArrayRef<StringRef> Comdats = Obj.linkingData().Comdats;
CustomSec = std::move(LinkingSec);
} else if (WasmSec.Name == "producers") {
std::unique_ptr<WasmYAML::ProducersSection> ProducersSec =
- make_unique<WasmYAML::ProducersSection>();
+ std::make_unique<WasmYAML::ProducersSection>();
const llvm::wasm::WasmProducerInfo &Info = Obj.getProducerInfo();
for (auto &E : Info.Languages) {
WasmYAML::ProducerEntry Producer;
CustomSec = std::move(ProducersSec);
} else if (WasmSec.Name == "target_features") {
std::unique_ptr<WasmYAML::TargetFeaturesSection> TargetFeaturesSec =
- make_unique<WasmYAML::TargetFeaturesSection>();
+ std::make_unique<WasmYAML::TargetFeaturesSection>();
for (auto &E : Obj.getTargetFeatures()) {
WasmYAML::FeatureEntry Feature;
Feature.Prefix = E.Prefix;
}
CustomSec = std::move(TargetFeaturesSec);
} else {
- CustomSec = make_unique<WasmYAML::CustomSection>(WasmSec.Name);
+ CustomSec = std::make_unique<WasmYAML::CustomSection>(WasmSec.Name);
}
CustomSec->Payload = yaml::BinaryRef(WasmSec.Content);
return CustomSec;
}
ErrorOr<WasmYAML::Object *> WasmDumper::dump() {
- auto Y = make_unique<WasmYAML::Object>();
+ auto Y = std::make_unique<WasmYAML::Object>();
// Dump header
Y->Header.Version = Obj.getHeader().Version;
break;
}
case wasm::WASM_SEC_TYPE: {
- auto TypeSec = make_unique<WasmYAML::TypeSection>();
+ auto TypeSec = std::make_unique<WasmYAML::TypeSection>();
uint32_t Index = 0;
for (const auto &FunctionSig : Obj.types()) {
WasmYAML::Signature Sig;
break;
}
case wasm::WASM_SEC_IMPORT: {
- auto ImportSec = make_unique<WasmYAML::ImportSection>();
+ auto ImportSec = std::make_unique<WasmYAML::ImportSection>();
for (auto &Import : Obj.imports()) {
WasmYAML::Import Im;
Im.Module = Import.Module;
break;
}
case wasm::WASM_SEC_FUNCTION: {
- auto FuncSec = make_unique<WasmYAML::FunctionSection>();
+ auto FuncSec = std::make_unique<WasmYAML::FunctionSection>();
for (const auto &Func : Obj.functionTypes()) {
FuncSec->FunctionTypes.push_back(Func);
}
break;
}
case wasm::WASM_SEC_TABLE: {
- auto TableSec = make_unique<WasmYAML::TableSection>();
+ auto TableSec = std::make_unique<WasmYAML::TableSection>();
for (const wasm::WasmTable &Table : Obj.tables()) {
TableSec->Tables.push_back(makeTable(Table));
}
break;
}
case wasm::WASM_SEC_MEMORY: {
- auto MemorySec = make_unique<WasmYAML::MemorySection>();
+ auto MemorySec = std::make_unique<WasmYAML::MemorySection>();
for (const wasm::WasmLimits &Memory : Obj.memories()) {
MemorySec->Memories.push_back(makeLimits(Memory));
}
break;
}
case wasm::WASM_SEC_GLOBAL: {
- auto GlobalSec = make_unique<WasmYAML::GlobalSection>();
+ auto GlobalSec = std::make_unique<WasmYAML::GlobalSection>();
for (auto &Global : Obj.globals()) {
WasmYAML::Global G;
G.Index = Global.Index;
break;
}
case wasm::WASM_SEC_EVENT: {
- auto EventSec = make_unique<WasmYAML::EventSection>();
+ auto EventSec = std::make_unique<WasmYAML::EventSection>();
for (auto &Event : Obj.events()) {
WasmYAML::Event E;
E.Index = Event.Index;
break;
}
case wasm::WASM_SEC_START: {
- auto StartSec = make_unique<WasmYAML::StartSection>();
+ auto StartSec = std::make_unique<WasmYAML::StartSection>();
StartSec->StartFunction = Obj.startFunction();
S = std::move(StartSec);
break;
}
case wasm::WASM_SEC_EXPORT: {
- auto ExportSec = make_unique<WasmYAML::ExportSection>();
+ auto ExportSec = std::make_unique<WasmYAML::ExportSection>();
for (auto &Export : Obj.exports()) {
WasmYAML::Export Ex;
Ex.Name = Export.Name;
break;
}
case wasm::WASM_SEC_ELEM: {
- auto ElemSec = make_unique<WasmYAML::ElemSection>();
+ auto ElemSec = std::make_unique<WasmYAML::ElemSection>();
for (auto &Segment : Obj.elements()) {
WasmYAML::ElemSegment Seg;
Seg.TableIndex = Segment.TableIndex;
break;
}
case wasm::WASM_SEC_CODE: {
- auto CodeSec = make_unique<WasmYAML::CodeSection>();
+ auto CodeSec = std::make_unique<WasmYAML::CodeSection>();
for (auto &Func : Obj.functions()) {
WasmYAML::Function Function;
Function.Index = Func.Index;
break;
}
case wasm::WASM_SEC_DATA: {
- auto DataSec = make_unique<WasmYAML::DataSection>();
+ auto DataSec = std::make_unique<WasmYAML::DataSection>();
for (const object::WasmSegment &Segment : Obj.dataSegments()) {
WasmYAML::DataSegment Seg;
Seg.SectionOffset = Segment.SectionOffset;
break;
}
case wasm::WASM_SEC_DATACOUNT: {
- auto DataCountSec = make_unique<WasmYAML::DataCountSection>();
+ auto DataCountSec = std::make_unique<WasmYAML::DataCountSection>();
DataCountSec->Count = Obj.dataSegments().size();
S = std::move(DataCountSec);
break;
OutputFilename = "-";
std::error_code EC;
- Out = llvm::make_unique<ToolOutputFile>(OutputFilename, EC,
+ Out = std::make_unique<ToolOutputFile>(OutputFilename, EC,
sys::fs::OF_None);
if (EC) {
errs() << EC.message() << '\n';
assert(Out);
OS = &Out->os();
if (RunTwice) {
- BOS = make_unique<raw_svector_ostream>(Buffer);
+ BOS = std::make_unique<raw_svector_ostream>(Buffer);
OS = BOS.get();
}
if (OutputAssembly) {
return make_error_code(errc::illegal_byte_sequence);
}
- auto Addrs = llvm::make_unique<std::set<uint64_t>>();
+ auto Addrs = std::make_unique<std::set<uint64_t>>();
switch (Header->Bitness) {
case Bitness64:
std::unique_ptr<SymbolizedCoverage>
SymbolizedCoverage::read(const std::string &InputFile) {
- auto Coverage(make_unique<SymbolizedCoverage>());
+ auto Coverage(std::make_unique<SymbolizedCoverage>());
std::map<std::string, CoveragePoint> Points;
ErrorOr<std::unique_ptr<MemoryBuffer>> BufOrErr =
static std::unique_ptr<SymbolizedCoverage>
symbolize(const RawCoverage &Data, const std::string ObjectFile) {
- auto Coverage = make_unique<SymbolizedCoverage>();
+ auto Coverage = std::make_unique<SymbolizedCoverage>();
ErrorOr<std::unique_ptr<MemoryBuffer>> BufOrErr =
MemoryBuffer::getFile(ObjectFile);
if (Coverages.empty())
return nullptr;
- auto Result = make_unique<SymbolizedCoverage>();
+ auto Result = std::make_unique<SymbolizedCoverage>();
for (size_t I = 0; I < Coverages.size(); ++I) {
const SymbolizedCoverage &Coverage = *Coverages[I];
-//===- llvm/unittest/ADT/MakeUniqueTest.cpp - make_unique unit tests ------===//
+//===- llvm/unittest/ADT/MakeUniqueTest.cpp - std::make_unique unit tests ------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
TEST(PointeeIteratorTest, SmartPointer) {
SmallVector<std::unique_ptr<int>, 4> V;
- V.push_back(make_unique<int>(1));
- V.push_back(make_unique<int>(2));
- V.push_back(make_unique<int>(3));
- V.push_back(make_unique<int>(4));
+ V.push_back(std::make_unique<int>(1));
+ V.push_back(std::make_unique<int>(2));
+ V.push_back(std::make_unique<int>(3));
+ V.push_back(std::make_unique<int>(4));
typedef pointee_iterator<
SmallVectorImpl<std::unique_ptr<int>>::const_iterator>
TEST(FilterIteratorTest, Composition) {
auto IsOdd = [](int N) { return N % 2 == 1; };
- std::unique_ptr<int> A[] = {make_unique<int>(0), make_unique<int>(1),
- make_unique<int>(2), make_unique<int>(3),
- make_unique<int>(4), make_unique<int>(5),
- make_unique<int>(6)};
+ std::unique_ptr<int> A[] = {make_unique<int>(0), std::make_unique<int>(1),
+ std::make_unique<int>(2), std::make_unique<int>(3),
+ std::make_unique<int>(4), std::make_unique<int>(5),
+ std::make_unique<int>(6)};
using PointeeIterator = pointee_iterator<std::unique_ptr<int> *>;
auto Range = make_filter_range(
make_range(PointeeIterator(std::begin(A)), PointeeIterator(std::end(A))),
-//===- llvm/unittest/ADT/MakeUniqueTest.cpp - make_unique unit tests ------===//
+//===- llvm/unittest/ADT/MakeUniqueTest.cpp - std::make_unique unit tests ------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
namespace {
TEST(MakeUniqueTest, SingleObject) {
- auto p0 = make_unique<int>();
+ auto p0 = std::make_unique<int>();
EXPECT_TRUE((bool)p0);
EXPECT_EQ(0, *p0);
- auto p1 = make_unique<int>(5);
+ auto p1 = std::make_unique<int>(5);
EXPECT_TRUE((bool)p1);
EXPECT_EQ(5, *p1);
- auto p2 = make_unique<std::tuple<int, int>>(0, 1);
+ auto p2 = std::make_unique<std::tuple<int, int>>(0, 1);
EXPECT_TRUE((bool)p2);
EXPECT_EQ(std::make_tuple(0, 1), *p2);
- auto p3 = make_unique<std::tuple<int, int, int>>(0, 1, 2);
+ auto p3 = std::make_unique<std::tuple<int, int, int>>(0, 1, 2);
EXPECT_TRUE((bool)p3);
EXPECT_EQ(std::make_tuple(0, 1, 2), *p3);
- auto p4 = make_unique<std::tuple<int, int, int, int>>(0, 1, 2, 3);
+ auto p4 = std::make_unique<std::tuple<int, int, int, int>>(0, 1, 2, 3);
EXPECT_TRUE((bool)p4);
EXPECT_EQ(std::make_tuple(0, 1, 2, 3), *p4);
- auto p5 = make_unique<std::tuple<int, int, int, int, int>>(0, 1, 2, 3, 4);
+ auto p5 = std::make_unique<std::tuple<int, int, int, int, int>>(0, 1, 2, 3, 4);
EXPECT_TRUE((bool)p5);
EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4), *p5);
auto p6 =
- make_unique<std::tuple<int, int, int, int, int, int>>(0, 1, 2, 3, 4, 5);
+ std::make_unique<std::tuple<int, int, int, int, int, int>>(0, 1, 2, 3, 4, 5);
EXPECT_TRUE((bool)p6);
EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5), *p6);
- auto p7 = make_unique<std::tuple<int, int, int, int, int, int, int>>(
+ auto p7 = std::make_unique<std::tuple<int, int, int, int, int, int, int>>(
0, 1, 2, 3, 4, 5, 6);
EXPECT_TRUE((bool)p7);
EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6), *p7);
- auto p8 = make_unique<std::tuple<int, int, int, int, int, int, int, int>>(
+ auto p8 = std::make_unique<std::tuple<int, int, int, int, int, int, int, int>>(
0, 1, 2, 3, 4, 5, 6, 7);
EXPECT_TRUE((bool)p8);
EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7), *p8);
auto p9 =
- make_unique<std::tuple<int, int, int, int, int, int, int, int, int>>(
+ std::make_unique<std::tuple<int, int, int, int, int, int, int, int, int>>(
0, 1, 2, 3, 4, 5, 6, 7, 8);
EXPECT_TRUE((bool)p9);
EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8), *p9);
auto p10 =
- make_unique<std::tuple<int, int, int, int, int, int, int, int, int, int>>(
+ std::make_unique<std::tuple<int, int, int, int, int, int, int, int, int, int>>(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
EXPECT_TRUE((bool)p10);
EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), *p10);
}
TEST(MakeUniqueTest, Array) {
- auto p1 = make_unique<int[]>(2);
+ auto p1 = std::make_unique<int[]>(2);
EXPECT_TRUE((bool)p1);
EXPECT_EQ(0, p1[0]);
EXPECT_EQ(0, p1[1]);
TEST(MapVectorTest, NonCopyable) {
MapVector<int, std::unique_ptr<int>> MV;
- MV.insert(std::make_pair(1, llvm::make_unique<int>(1)));
- MV.insert(std::make_pair(2, llvm::make_unique<int>(2)));
+ MV.insert(std::make_pair(1, std::make_unique<int>(1)));
+ MV.insert(std::make_pair(2, std::make_unique<int>(2)));
ASSERT_EQ(MV.count(1), 1u);
ASSERT_EQ(*MV.find(2)->second, 2);
TEST(SmallMapVectorSmallTest, NonCopyable) {
SmallMapVector<int, std::unique_ptr<int>, 8> MV;
- MV.insert(std::make_pair(1, llvm::make_unique<int>(1)));
- MV.insert(std::make_pair(2, llvm::make_unique<int>(2)));
+ MV.insert(std::make_pair(1, std::make_unique<int>(1)));
+ MV.insert(std::make_pair(2, std::make_unique<int>(2)));
ASSERT_EQ(MV.count(1), 1u);
ASSERT_EQ(*MV.find(2)->second, 2);
EXPECT_EQ(V1, to_address(V1));
// Check fancy pointer overload for unique_ptr
- std::unique_ptr<int> V2 = make_unique<int>(0);
+ std::unique_ptr<int> V2 = std::make_unique<int>(0);
EXPECT_EQ(V2.get(), to_address(V2));
V2.reset(V1);
: DT(*Test.F), AC(*Test.F), AA(Test.TLI),
BAA(Test.DL, *Test.F, Test.TLI, AC, &DT) {
AA.addAAResult(BAA);
- MSSA = make_unique<MemorySSA>(*Test.F, &AA, &DT);
+ MSSA = std::make_unique<MemorySSA>(*Test.F, &AA, &DT);
Walker = MSSA->getWalker();
}
};
MemorySSA &MSSA = *Analyses->MSSA;
MemorySSAWalker *Walker = Analyses->Walker;
std::unique_ptr<MemorySSAUpdater> MSSAU =
- make_unique<MemorySSAUpdater>(&MSSA);
+ std::make_unique<MemorySSAUpdater>(&MSSA);
MemoryPhi *Phi = MSSA.getMemoryAccess(Exit);
EXPECT_EQ(Phi, Walker->getClobberingMemoryAccess(S1));
MemorySSA &MSSA = *Analyses->MSSA;
MemorySSAWalker *Walker = Analyses->Walker;
std::unique_ptr<MemorySSAUpdater> MSSAU =
- make_unique<MemorySSAUpdater>(&MSSA);
+ std::make_unique<MemorySSAUpdater>(&MSSA);
MemoryDef *DefS1 = cast<MemoryDef>(MSSA.getMemoryAccess(S1));
EXPECT_EQ(DefS1, Walker->getClobberingMemoryAccess(S2));
setupAnalyses();
MemorySSA &MSSA = *Analyses->MSSA;
std::unique_ptr<MemorySSAUpdater> MSSAU =
- make_unique<MemorySSAUpdater>(&MSSA);
+ std::make_unique<MemorySSAUpdater>(&MSSA);
// Alter CFG, add edge: f -> c
FBlock->getTerminator()->eraseFromParent();
MachineModuleInfo MMI(TM.get());
- MF = make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F), 0,
+ MF = std::make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F), 0,
MMI);
- DAG = make_unique<SelectionDAG>(*TM, CodeGenOpt::None);
+ DAG = std::make_unique<SelectionDAG>(*TM, CodeGenOpt::None);
if (!DAG)
report_fatal_error("DAG?");
OptimizationRemarkEmitter ORE(F);
auto MIBInput1 = B.buildInstr(TargetOpcode::G_TRUNC, {s16}, {Copies[1]});
auto MIBAdd = B.buildInstr(TargetOpcode::G_ADD, {s16}, {MIBInput, MIBInput});
GISelCSEInfo CSEInfo;
- CSEInfo.setCSEConfig(make_unique<CSEConfigFull>());
+ CSEInfo.setCSEConfig(std::make_unique<CSEConfigFull>());
CSEInfo.analyze(*MF);
B.setCSEInfo(&CSEInfo);
CSEMIRBuilder CSEB(B.getState());
auto MIBAdd = B.buildInstr(TargetOpcode::G_ADD, {s16}, {MIBInput, MIBInput});
auto MIBZero = B.buildConstant(s16, 0);
GISelCSEInfo CSEInfo;
- CSEInfo.setCSEConfig(make_unique<CSEConfigConstantOnly>());
+ CSEInfo.setCSEConfig(std::make_unique<CSEConfigConstantOnly>());
CSEInfo.analyze(*MF);
B.setCSEInfo(&CSEInfo);
CSEMIRBuilder CSEB(B.getState());
)MIR") + Twine(MIRFunc) + Twine("...\n"))
.toNullTerminatedStringRef(S);
std::unique_ptr<MIRParser> MIR;
- auto MMI = make_unique<MachineModuleInfo>(&TM);
+ auto MMI = std::make_unique<MachineModuleInfo>(&TM);
std::unique_ptr<Module> M =
parseMIR(Context, MIR, TM, MIRString, "func", *MMI);
return make_pair(std::move(M), std::move(MMI));
)MIR") + Twine(MIRFunc) + Twine("...\n"))
.toNullTerminatedStringRef(S);
std::unique_ptr<MIRParser> MIR;
- auto MMI = make_unique<MachineModuleInfo>(&TM);
+ auto MMI = std::make_unique<MachineModuleInfo>(&TM);
std::unique_ptr<Module> M =
parseMIR(Context, MIR, TM, MIRString, "func", *MMI);
return make_pair(std::move(M), std::move(MMI));
};
std::unique_ptr<BogusTargetMachine> createTargetMachine() {
- return llvm::make_unique<BogusTargetMachine>();
+ return std::make_unique<BogusTargetMachine>();
}
std::unique_ptr<MachineFunction> createMachineFunction() {
MachineModuleInfo MMI(TM.get());
const TargetSubtargetInfo &STI = *TM->getSubtargetImpl(*F);
- return llvm::make_unique<MachineFunction>(*F, *TM, STI, FunctionNum, MMI);
+ return std::make_unique<MachineFunction>(*F, *TM, STI, FunctionNum, MMI);
}
// This test makes sure that MachineInstr::isIdenticalTo handles Defs correctly
RandomAccessVisitorTest() {}
static void SetUpTestCase() {
- GlobalState = llvm::make_unique<GlobalTestState>();
+ GlobalState = std::make_unique<GlobalTestState>();
AppendingTypeTableBuilder Builder(GlobalState->Allocator);
static void TearDownTestCase() { GlobalState.reset(); }
void SetUp() override {
- TestState = llvm::make_unique<PerTestState>();
+ TestState = std::make_unique<PerTestState>();
}
void TearDown() override { TestState.reset(); }
void SetUp() override {
Refs.clear();
- TTB = make_unique<AppendingTypeTableBuilder>(Storage);
- CRB = make_unique<ContinuationRecordBuilder>();
+ TTB = std::make_unique<AppendingTypeTableBuilder>(Storage);
+ CRB = std::make_unique<ContinuationRecordBuilder>();
Symbols.clear();
}
return make_error<StringError>("no code emitter for target " + TripleName,
inconvertibleErrorCode());
- Stream = make_unique<raw_svector_ostream>(FileBytes);
+ Stream = std::make_unique<raw_svector_ostream>(FileBytes);
MS = TheTarget->createMCObjectStreamer(
TheTriple, *MC, std::unique_ptr<MCAsmBackend>(MAB),
MC->setDwarfVersion(Version);
Asm->setDwarfVersion(Version);
- StringPool = llvm::make_unique<DwarfStringPool>(Allocator, *Asm, StringRef());
+ StringPool = std::make_unique<DwarfStringPool>(Allocator, *Asm, StringRef());
StringOffsetsStartSym = Asm->createTempSymbol("str_offsets_base");
return Error::success();
dwarfgen::CompileUnit &dwarfgen::Generator::addCompileUnit() {
CompileUnits.push_back(
- make_unique<CompileUnit>(*this, Version, Asm->getPointerSize()));
+ std::make_unique<CompileUnit>(*this, Version, Asm->getPointerSize()));
return *CompileUnits.back();
}
dwarfgen::LineTable &dwarfgen::Generator::addLineTable(DwarfFormat Format) {
LineTables.push_back(
- make_unique<LineTable>(Version, Format, Asm->getPointerSize()));
+ std::make_unique<LineTable>(Version, Format, Asm->getPointerSize()));
return *LineTables.back();
}
std::unique_ptr<IPDBSession> Session;
void InsertItemWithTag(PDB_SymType Tag) {
- auto RawSymbol = llvm::make_unique<MockRawSymbol>(Tag);
+ auto RawSymbol = std::make_unique<MockRawSymbol>(Tag);
auto Symbol = PDBSymbol::create(*Session, std::move(RawSymbol));
SymbolMap.insert(std::make_pair(Tag, std::move(Symbol)));
}
protected:
ExecutionEngineTest() {
- auto Owner = make_unique<Module>("<main>", Context);
+ auto Owner = std::make_unique<Module>("<main>", Context);
M = Owner.get();
Engine.reset(EngineBuilder(std::move(Owner)).setErrorStr(&Error).create());
}
if (!STI)
report_fatal_error("Could not build MCSubtargetInfo for triple");
- DisCtx = llvm::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr);
+ DisCtx = std::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr);
Dis.reset(TheTarget->createMCDisassembler(*STI, *DisCtx));
if (!Dis)
void JITLinkTestCommon::TestResources::initializeTestSpecifics(
StringRef AsmSrc, const Triple &TT, bool PIC, bool LargeCodeModel) {
SrcMgr.AddNewSourceBuffer(MemoryBuffer::getMemBuffer(AsmSrc), SMLoc());
- AsCtx = llvm::make_unique<MCContext>(MAI.get(), MRI.get(), &MOFI, &SrcMgr);
+ AsCtx = std::make_unique<MCContext>(MAI.get(), MRI.get(), &MOFI, &SrcMgr);
MOFI.InitMCObjectFileInfo(TT, PIC, *AsCtx, LargeCodeModel);
std::unique_ptr<MCCodeEmitter> CE(
JITLinkMemoryManager &
JITLinkTestCommon::TestJITLinkContext::getMemoryManager() {
if (!MemMgr)
- MemMgr = llvm::make_unique<InProcessMemoryManager>();
+ MemMgr = std::make_unique<InProcessMemoryManager>();
return *MemMgr;
}
return;
}
- auto JTCtx = llvm::make_unique<TestJITLinkContext>(
+ auto JTCtx = std::make_unique<TestJITLinkContext>(
**TR, [&](AtomGraph &G) { RunGraphTest(G, (*TR)->getDisassembler()); });
JTCtx->externals() = std::move(Externals);
std::shared_ptr<MaterializationResponsibility> FooMR;
- cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>(
+ cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}}),
[&](MaterializationResponsibility R) {
FooMR = std::make_shared<MaterializationResponsibility>(std::move(R));
// Bar will be unmaterialized.
bool BarDiscarded = false;
bool BarMaterializerDestructed = false;
- cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>(
+ cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[this](MaterializationResponsibility R) {
ADD_FAILURE() << "Unexpected materialization of \"Bar\"";
// Baz will be in the materializing state initially, then
// materialized for the final removal attempt.
Optional<MaterializationResponsibility> BazR;
- cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>(
+ cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Baz, BazSym.getFlags()}}),
[&](MaterializationResponsibility R) { BazR.emplace(std::move(R)); },
[](const JITDylib &JD, const SymbolStringPtr &Name) {
BarSym.setFlags(static_cast<JITSymbolFlags::FlagNames>(
JITSymbolFlags::Exported | JITSymbolFlags::Weak));
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[](MaterializationResponsibility R) {
llvm_unreachable("Symbol materialized on flags lookup");
}
};
- JD.addGenerator(llvm::make_unique<BadGenerator>());
+ JD.addGenerator(std::make_unique<BadGenerator>());
EXPECT_THAT_ERROR(JD.lookupFlags({Foo}).takeError(), Failed<StringError>())
<< "Generator failure did not propagate through lookupFlags";
cantFail(JD.define(absoluteSymbols({{Foo, FooSym}})));
bool BarMaterialized = false;
- auto BarMU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto BarMU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
BarMaterialized = true;
auto Filter = [this](SymbolStringPtr Name) { return Name != Bar; };
- JD.addGenerator(llvm::make_unique<ReexportsGenerator>(JD2, false, Filter));
+ JD.addGenerator(std::make_unique<ReexportsGenerator>(JD2, false, Filter));
auto Flags = cantFail(JD.lookupFlags({Foo, Bar, Baz}));
EXPECT_EQ(Flags.size(), 1U) << "Unexpected number of results";
TEST_F(CoreAPIsStandardTest, TestTrivialCircularDependency) {
Optional<MaterializationResponsibility> FooR;
- auto FooMU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto FooMU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}}),
[&](MaterializationResponsibility R) { FooR.emplace(std::move(R)); });
// Create a MaterializationUnit for each symbol that moves the
// MaterializationResponsibility into one of the locals above.
- auto FooMU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto FooMU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}}),
[&](MaterializationResponsibility R) { FooR.emplace(std::move(R)); });
- auto BarMU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto BarMU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) { BarR.emplace(std::move(R)); });
- auto BazMU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto BazMU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Baz, BazSym.getFlags()}}),
[&](MaterializationResponsibility R) { BazR.emplace(std::move(R)); });
JITSymbolFlags WeakExported(JITSymbolFlags::Exported);
WeakExported |= JITSymbolFlags::Weak;
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, WeakExported}, {Bar, WeakExported}}),
[](MaterializationResponsibility R) {
llvm_unreachable("Unexpected call to materialize");
JITSymbolFlags WeakExported(JITSymbolFlags::Exported);
WeakExported |= JITSymbolFlags::Weak;
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}, {Bar, WeakExported}}),
[&](MaterializationResponsibility R) {
assert(BarDiscarded && "Bar should have been discarded by this point");
BarSym.setFlags(BarSym.getFlags() | JITSymbolFlags::Weak);
bool BarMaterialized = false;
- auto MU1 = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU1 = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}})), R.notifyEmitted();
});
bool DuplicateBarDiscarded = false;
- auto MU2 = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU2 = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
ADD_FAILURE() << "Attempt to materialize Bar from the wrong unit";
MU->doMaterialize(JD);
});
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}}),
[&](MaterializationResponsibility R) {
cantFail(
SymbolMap Symbols;
};
- JD.addGenerator(llvm::make_unique<TestGenerator>(SymbolMap({{Bar, BarSym}})));
+ JD.addGenerator(std::make_unique<TestGenerator>(SymbolMap({{Bar, BarSym}})));
auto Result =
cantFail(ES.lookup(JITDylibSearchList({{&JD, false}}), {Foo, Bar}));
}
TEST_F(CoreAPIsStandardTest, FailResolution) {
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, JITSymbolFlags::Exported | JITSymbolFlags::Weak},
{Bar, JITSymbolFlags::Exported | JITSymbolFlags::Weak}}),
[&](MaterializationResponsibility R) {
cantFail(JD.define(absoluteSymbols({{Baz, BazSym}})));
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}}));
}
TEST_F(CoreAPIsStandardTest, TestLookupWithUnthreadedMaterialization) {
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}}),
[&](MaterializationResponsibility R) {
R.notifyResolved({{Foo, FooSym}});
bool FooMaterialized = false;
bool BarMaterialized = false;
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
auto Requested = R.getRequestedSymbols();
EXPECT_EQ(Requested.size(), 1U) << "Expected one symbol requested";
EXPECT_EQ(*Requested.begin(), Foo) << "Expected \"Foo\" requested";
- auto NewMU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto NewMU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R2) {
R2.notifyResolved(SymbolMap({{Bar, BarSym}}));
}
TEST_F(CoreAPIsStandardTest, TestMaterializationResponsibilityDelegation) {
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}),
[&](MaterializationResponsibility R) {
auto R2 = R.delegate({Bar});
WeakExported &= JITSymbolFlags::Weak;
std::unique_ptr<MaterializationResponsibility> FooResponsibility;
- auto MU = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, FooSym.getFlags()}}),
[&](MaterializationResponsibility R) {
FooResponsibility =
- llvm::make_unique<MaterializationResponsibility>(std::move(R));
+ std::make_unique<MaterializationResponsibility>(std::move(R));
});
cantFail(JD.define(MU));
ES.lookup(JITDylibSearchList({{&JD, false}}), {Foo}, SymbolState::Ready,
std::move(OnCompletion), NoDependenciesToRegister);
- auto MU2 = llvm::make_unique<SimpleMaterializationUnit>(
+ auto MU2 = std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}}),
[](MaterializationResponsibility R) {
llvm_unreachable("This unit should never be materialized");
bool DummyTargetMaterialized = false;
- cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>(
+ cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>(
SymbolFlagsMap({{DummyTarget, JITSymbolFlags::Exported}}),
[&](MaterializationResponsibility R) {
DummyTargetMaterialized = true;
class DummyCallbackManager : public JITCompileCallbackManager {
public:
DummyCallbackManager(ExecutionSession &ES)
- : JITCompileCallbackManager(llvm::make_unique<DummyTrampolinePool>(), ES,
+ : JITCompileCallbackManager(std::make_unique<DummyTrampolinePool>(), ES,
0) {}
};
llvm::orc::LegacyCompileOnDemandLayer<decltype(TestBaseLayer)> COD(
AcknowledgeORCv1Deprecation, ES, TestBaseLayer, GetResolver, SetResolver,
[](Function &F) { return std::set<Function *>{&F}; }, CallbackMgr,
- [] { return llvm::make_unique<DummyStubsManager>(); }, true);
+ [] { return std::make_unique<DummyStubsManager>(); }, true);
auto Sym = COD.findSymbol("foo", true);
});
LLVMContext Context;
- auto M = llvm::make_unique<Module>("", Context);
+ auto M = std::make_unique<Module>("", Context);
M->setTargetTriple("x86_64-unknown-linux-gnu");
Type *Int32Ty = IntegerType::get(Context, 32);
GlobalVariable *GV =
createPairedQueueChannels() {
auto Q1 = std::make_shared<Queue>();
auto Q2 = std::make_shared<Queue>();
- auto C1 = llvm::make_unique<QueueChannel>(Q1, Q2);
- auto C2 = llvm::make_unique<QueueChannel>(Q2, Q1);
+ auto C1 = std::make_unique<QueueChannel>(Q1, Q2);
+ auto C2 = std::make_unique<QueueChannel>(Q2, Q1);
return std::make_pair(std::move(C1), std::move(C2));
}
auto Foo = ES.intern("foo");
RTDyldObjectLinkingLayer ObjLayer(ES, [&DebugSectionSeen]() {
- return llvm::make_unique<MemoryManagerWrapper>(DebugSectionSeen);
+ return std::make_unique<MemoryManagerWrapper>(DebugSectionSeen);
});
auto OnResolveDoNothing = [](Expected<SymbolMap> R) {
TEST(RTDyldObjectLinkingLayerTest, TestSetProcessAllSections) {
LLVMContext Context;
- auto M = llvm::make_unique<Module>("", Context);
+ auto M = std::make_unique<Module>("", Context);
M->setTargetTriple("x86_64-unknown-linux-gnu");
Type *Int32Ty = IntegerType::get(Context, 32);
GlobalVariable *GV =
};
// Create a module with two void() functions: foo and bar.
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
ThreadSafeModule M;
{
ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy");
auto &JD = ES.createJITDylib("main");
auto Foo = ES.intern("foo");
RTDyldObjectLinkingLayer ObjLayer(
- ES, []() { return llvm::make_unique<SectionMemoryManager>(); });
+ ES, []() { return std::make_unique<SectionMemoryManager>(); });
IRCompileLayer CompileLayer(ES, ObjLayer, FunkySimpleCompiler(*TM));
ObjLayer.setOverrideObjectFlagsWithResponsibilityFlags(true);
};
// Create a module with two void() functions: foo and bar.
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
ThreadSafeModule M;
{
ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy");
auto &JD = ES.createJITDylib("main");
auto Foo = ES.intern("foo");
RTDyldObjectLinkingLayer ObjLayer(
- ES, []() { return llvm::make_unique<SectionMemoryManager>(); });
+ ES, []() { return std::make_unique<SectionMemoryManager>(); });
IRCompileLayer CompileLayer(ES, ObjLayer, FunkySimpleCompiler(*TM));
ObjLayer.setAutoClaimResponsibilityForObjectSymbols(true);
TEST(ThreadSafeModuleTest, ContextWhollyOwnedByOneModule) {
// Test that ownership of a context can be transferred to a single
// ThreadSafeModule.
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
- auto M = llvm::make_unique<Module>("M", *TSCtx.getContext());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
+ auto M = std::make_unique<Module>("M", *TSCtx.getContext());
ThreadSafeModule TSM(std::move(M), std::move(TSCtx));
}
TEST(ThreadSafeModuleTest, ContextOwnershipSharedByTwoModules) {
// Test that ownership of a context can be shared between more than one
// ThreadSafeModule.
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
- auto M1 = llvm::make_unique<Module>("M1", *TSCtx.getContext());
+ auto M1 = std::make_unique<Module>("M1", *TSCtx.getContext());
ThreadSafeModule TSM1(std::move(M1), TSCtx);
- auto M2 = llvm::make_unique<Module>("M2", *TSCtx.getContext());
+ auto M2 = std::make_unique<Module>("M2", *TSCtx.getContext());
ThreadSafeModule TSM2(std::move(M2), std::move(TSCtx));
}
TEST(ThreadSafeModuleTest, ContextOwnershipSharedWithClient) {
// Test that ownership of a context can be shared with a client-held
// ThreadSafeContext so that it can be re-used for new modules.
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
{
// Create and destroy a module.
- auto M1 = llvm::make_unique<Module>("M1", *TSCtx.getContext());
+ auto M1 = std::make_unique<Module>("M1", *TSCtx.getContext());
ThreadSafeModule TSM1(std::move(M1), TSCtx);
}
// Verify that the context is still available for re-use.
- auto M2 = llvm::make_unique<Module>("M2", *TSCtx.getContext());
+ auto M2 = std::make_unique<Module>("M2", *TSCtx.getContext());
ThreadSafeModule TSM2(std::move(M2), std::move(TSCtx));
}
// Move assignment needs to move the module before the context (opposite
// to the field order) to ensure that overwriting with an empty
// ThreadSafeModule does not destroy the context early.
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
- auto M = llvm::make_unique<Module>("M", *TSCtx.getContext());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
+ auto M = std::make_unique<Module>("M", *TSCtx.getContext());
ThreadSafeModule TSM(std::move(M), std::move(TSCtx));
TSM = ThreadSafeModule();
}
TEST(ThreadSafeModuleTest, BasicContextLockAPI) {
// Test that basic lock API calls work.
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
- auto M = llvm::make_unique<Module>("M", *TSCtx.getContext());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
+ auto M = std::make_unique<Module>("M", *TSCtx.getContext());
ThreadSafeModule TSM(std::move(M), TSCtx);
{ auto L = TSCtx.getLock(); }
// has been destroyed) even though all references to the context have
// been thrown away (apart from the lock).
- ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>());
+ ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
auto L = TSCtx.getLock();
auto &Ctx = *TSCtx.getContext();
- auto M = llvm::make_unique<Module>("M", Ctx);
+ auto M = std::make_unique<Module>("M", Ctx);
TSCtx = ThreadSafeContext();
}
std::vector<std::unique_ptr<IRMutationStrategy>> Strategies;
Strategies.push_back(
- llvm::make_unique<InjectorIRStrategy>(
+ std::make_unique<InjectorIRStrategy>(
InjectorIRStrategy::getDefaultOps()));
- return llvm::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
+ return std::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
}
std::unique_ptr<IRMutator> createDeleterMutator() {
Type::getInt64Ty, Type::getFloatTy, Type::getDoubleTy};
std::vector<std::unique_ptr<IRMutationStrategy>> Strategies;
- Strategies.push_back(llvm::make_unique<InstDeleterIRStrategy>());
+ Strategies.push_back(std::make_unique<InstDeleterIRStrategy>());
- return llvm::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
+ return std::make_unique<IRMutator>(std::move(Types), std::move(Strategies));
}
std::unique_ptr<Module> parseAssembly(
// Test that we can inject into empty module
LLVMContext Ctx;
- auto M = llvm::make_unique<Module>("M", Ctx);
+ auto M = std::make_unique<Module>("M", Ctx);
ASSERT_TRUE(M && !verifyModule(*M, &errs()));
auto Mutator = createInjectorMutator();
using namespace llvm;
CFGHolder::CFGHolder(StringRef ModuleName, StringRef FunctionName)
- : Context(llvm::make_unique<LLVMContext>()),
- M(llvm::make_unique<Module>(ModuleName, *Context)) {
+ : Context(std::make_unique<LLVMContext>()),
+ M(std::make_unique<Module>(ModuleName, *Context)) {
FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Context), {}, false);
F = Function::Create(FTy, Function::ExternalLinkage, FunctionName, M.get());
}
TEST(ContextAndReplaceableUsesTest, FromReplaceableUses) {
LLVMContext Context;
- ContextAndReplaceableUses CRU(make_unique<ReplaceableMetadataImpl>(Context));
+ ContextAndReplaceableUses CRU(std::make_unique<ReplaceableMetadataImpl>(Context));
EXPECT_EQ(&Context, &CRU.getContext());
EXPECT_TRUE(CRU.hasReplaceableUses());
EXPECT_TRUE(CRU.getReplaceableUses());
TEST(ContextAndReplaceableUsesTest, makeReplaceable) {
LLVMContext Context;
ContextAndReplaceableUses CRU(Context);
- CRU.makeReplaceable(make_unique<ReplaceableMetadataImpl>(Context));
+ CRU.makeReplaceable(std::make_unique<ReplaceableMetadataImpl>(Context));
EXPECT_EQ(&Context, &CRU.getContext());
EXPECT_TRUE(CRU.hasReplaceableUses());
EXPECT_TRUE(CRU.getReplaceableUses());
TEST(ContextAndReplaceableUsesTest, takeReplaceableUses) {
LLVMContext Context;
- auto ReplaceableUses = make_unique<ReplaceableMetadataImpl>(Context);
+ auto ReplaceableUses = std::make_unique<ReplaceableMetadataImpl>(Context);
auto *Ptr = ReplaceableUses.get();
ContextAndReplaceableUses CRU(std::move(ReplaceableUses));
ReplaceableUses = CRU.takeReplaceableUses();
// Setup time-passes handler and redirect output to the stream.
std::unique_ptr<TimePassesHandler> TimePasses =
- llvm::make_unique<TimePassesHandler>(true);
+ std::make_unique<TimePassesHandler>(true);
TimePasses->setOutStream(ReportStream);
TimePasses->registerCallbacks(PIC);
EXPECT_EQ(M3, M4->getOperand(0));
// Link into destination module.
- auto Dst = llvm::make_unique<Module>("Linked", C);
+ auto Dst = std::make_unique<Module>("Linked", C);
ASSERT_TRUE(Dst.get());
Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
Linker::linkModules(*Dst, std::move(Src));
ASSERT_TRUE(Bar->getFunction("llvm.memset.p0s_struct.rtx_def.0s.i32"));
// Link two modules together.
- auto Dst = llvm::make_unique<Module>("Linked", C);
+ auto Dst = std::make_unique<Module>("Linked", C);
ASSERT_TRUE(Dst.get());
Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
bool Failed = Linker::linkModules(*Foo, std::move(Bar));
MRI.reset(TheTarget->createMCRegInfo(Triple));
MAI.reset(TheTarget->createMCAsmInfo(*MRI, Triple));
- Ctx = llvm::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr);
+ Ctx = std::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr);
}
operator bool() { return Ctx.get(); }
for (const auto &OF : OutputFunctions) {
ArrayRef<OutputFunctionCoverageData> Funcs(OF);
CoverageReaders.push_back(
- make_unique<CoverageMappingReaderMock>(Funcs));
+ std::make_unique<CoverageMappingReaderMock>(Funcs));
}
} else {
ArrayRef<OutputFunctionCoverageData> Funcs(OutputFunctions);
CoverageReaders.push_back(
- make_unique<CoverageMappingReaderMock>(Funcs));
+ std::make_unique<CoverageMappingReaderMock>(Funcs));
}
return CoverageMapping::load(CoverageReaders, *ProfileReader);
}
// Testing symtab creator interface used by value profile transformer.
TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_module_test) {
LLVMContext Ctx;
- std::unique_ptr<Module> M = llvm::make_unique<Module>("MyModule.cpp", Ctx);
+ std::unique_ptr<Module> M = std::make_unique<Module>("MyModule.cpp", Ctx);
FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx),
/*isVarArg=*/false);
Function::Create(FTy, Function::ExternalLinkage, "Gfoo", M.get());
for (uint32_t I = 0; I < NumEndians; ++I) {
auto InByteStream =
- llvm::make_unique<BinaryByteStream>(InputData, Endians[I]);
- auto InBrokenStream = llvm::make_unique<BrokenStream>(
+ std::make_unique<BinaryByteStream>(InputData, Endians[I]);
+ auto InBrokenStream = std::make_unique<BrokenStream>(
BrokenInputData, Endians[I], Align);
Streams[I * 2].Input = std::move(InByteStream);
for (uint32_t I = 0; I < NumEndians; ++I) {
Streams[I * 2].Output =
- llvm::make_unique<MutableBinaryByteStream>(OutputData, Endians[I]);
- Streams[I * 2 + 1].Output = llvm::make_unique<BrokenStream>(
+ std::make_unique<MutableBinaryByteStream>(OutputData, Endians[I]);
+ Streams[I * 2 + 1].Output = std::make_unique<BrokenStream>(
BrokenOutputData, Endians[I], Align);
}
}
void initializeOutputFromInput(uint32_t Align) {
for (uint32_t I = 0; I < NumEndians; ++I) {
Streams[I * 2].Output =
- llvm::make_unique<MutableBinaryByteStream>(InputData, Endians[I]);
- Streams[I * 2 + 1].Output = llvm::make_unique<BrokenStream>(
+ std::make_unique<MutableBinaryByteStream>(InputData, Endians[I]);
+ Streams[I * 2 + 1].Output = std::make_unique<BrokenStream>(
BrokenInputData, Endians[I], Align);
}
}
void initializeInputFromOutput(uint32_t Align) {
for (uint32_t I = 0; I < NumEndians; ++I) {
Streams[I * 2].Input =
- llvm::make_unique<BinaryByteStream>(OutputData, Endians[I]);
- Streams[I * 2 + 1].Input = llvm::make_unique<BrokenStream>(
+ std::make_unique<BinaryByteStream>(OutputData, Endians[I]);
+ Streams[I * 2 + 1].Input = std::make_unique<BrokenStream>(
BrokenOutputData, Endians[I], Align);
}
}
EXPECT_NE(F5, null_foo);
}
-std::unique_ptr<derived> newd() { return llvm::make_unique<derived>(); }
-std::unique_ptr<base> newb() { return llvm::make_unique<derived>(); }
+std::unique_ptr<derived> newd() { return std::make_unique<derived>(); }
+std::unique_ptr<base> newb() { return std::make_unique<derived>(); }
TEST(CastingTest, unique_dyn_cast) {
derived *OrigD = nullptr;
- auto D = llvm::make_unique<derived>();
+ auto D = std::make_unique<derived>();
OrigD = D.get();
// Converting from D to itself is valid, it should return a new unique_ptr
// returns true, getValue and eval return value of expression, setValue
// clears expression.
std::unique_ptr<FileCheckNumericVariableUse> FooVarUsePtr =
- llvm::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar);
+ std::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar);
std::unique_ptr<FileCheckExpressionLiteral> One =
- llvm::make_unique<FileCheckExpressionLiteral>(1);
+ std::make_unique<FileCheckExpressionLiteral>(1);
FileCheckASTBinop Binop =
FileCheckASTBinop(doAdd, std::move(FooVarUsePtr), std::move(One));
FileCheckNumericVariable FoobarExprVar =
FileCheckNumericVariable FooVar = FileCheckNumericVariable("FOO", 1);
FooVar.setValue(42);
std::unique_ptr<FileCheckNumericVariableUse> FooVarUse =
- llvm::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar);
+ std::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar);
FileCheckNumericVariable BarVar = FileCheckNumericVariable("BAR", 2);
BarVar.setValue(18);
std::unique_ptr<FileCheckNumericVariableUse> BarVarUse =
- llvm::make_unique<FileCheckNumericVariableUse>("BAR", &BarVar);
+ std::make_unique<FileCheckNumericVariableUse>("BAR", &BarVar);
FileCheckASTBinop Binop =
FileCheckASTBinop(doAdd, std::move(FooVarUse), std::move(BarVarUse));
LineVar.setValue(42);
NVar.setValue(10);
auto LineVarUse =
- llvm::make_unique<FileCheckNumericVariableUse>("@LINE", &LineVar);
- auto NVarUse = llvm::make_unique<FileCheckNumericVariableUse>("N", &NVar);
+ std::make_unique<FileCheckNumericVariableUse>("@LINE", &LineVar);
+ auto NVarUse = std::make_unique<FileCheckNumericVariableUse>("N", &NVar);
FileCheckNumericSubstitution SubstitutionLine = FileCheckNumericSubstitution(
&Context, "@LINE", std::move(LineVarUse), 12);
FileCheckNumericSubstitution SubstitutionN =
Size = ::lseek(FD, 0, SEEK_END);
ASSERT_NE(-1, Size);
::lseek(FD, 0, SEEK_SET);
- Buffer = llvm::make_unique<char[]>(Size);
+ Buffer = std::make_unique<char[]>(Size);
ASSERT_EQ(::read(FD, Buffer.get(), Size), Size);
::close(FD);
std::unique_ptr<TrigramIndex> makeTrigramIndex(
std::vector<std::string> Rules) {
std::unique_ptr<TrigramIndex> TI =
- make_unique<TrigramIndex>();
+ std::make_unique<TrigramIndex>();
for (auto &Rule : Rules)
TI->insert(Rule);
return TI;
static Scalar &getAsScalar(std::unique_ptr<Poly> &N) {
if (!N || !isa<Scalar>(*N))
- N = llvm::make_unique<Scalar>();
+ N = std::make_unique<Scalar>();
return *cast<Scalar>(N.get());
}
static Seq &getAsSequence(std::unique_ptr<Poly> &N) {
if (!N || !isa<Seq>(*N))
- N = llvm::make_unique<Seq>();
+ N = std::make_unique<Seq>();
return *cast<Seq>(N.get());
}
static Map &getAsMap(std::unique_ptr<Poly> &N) {
if (!N || !isa<Map>(*N))
- N = llvm::make_unique<Map>();
+ N = std::make_unique<Map>();
return *cast<Map>(N.get());
}
};
TEST(YAMLIO, TestReadWritePolymorphicScalar) {
std::string intermediate;
- std::unique_ptr<Poly> node = llvm::make_unique<Scalar>(true);
+ std::unique_ptr<Poly> node = std::make_unique<Scalar>(true);
llvm::raw_string_ostream ostr(intermediate);
Output yout(ostr);
TEST(YAMLIO, TestReadWritePolymorphicSeq) {
std::string intermediate;
{
- auto seq = llvm::make_unique<Seq>();
- seq->push_back(llvm::make_unique<Scalar>(true));
- seq->push_back(llvm::make_unique<Scalar>(1.0));
+ auto seq = std::make_unique<Seq>();
+ seq->push_back(std::make_unique<Scalar>(true));
+ seq->push_back(std::make_unique<Scalar>(1.0));
auto node = llvm::unique_dyn_cast<Poly>(seq);
llvm::raw_string_ostream ostr(intermediate);
TEST(YAMLIO, TestReadWritePolymorphicMap) {
std::string intermediate;
{
- auto map = llvm::make_unique<Map>();
- (*map)["foo"] = llvm::make_unique<Scalar>(false);
- (*map)["bar"] = llvm::make_unique<Scalar>(2.0);
+ auto map = std::make_unique<Map>();
+ (*map)["foo"] = std::make_unique<Scalar>(false);
+ (*map)["bar"] = std::make_unique<Scalar>(2.0);
std::unique_ptr<Poly> node = llvm::unique_dyn_cast<Poly>(map);
llvm::raw_string_ostream ostr(intermediate);
std::unique_ptr<AArch64InstrInfo> createInstrInfo(TargetMachine *TM) {
AArch64Subtarget ST(TM->getTargetTriple(), TM->getTargetCPU(),
TM->getTargetFeatureString(), *TM, /* isLittle */ false);
- return llvm::make_unique<AArch64InstrInfo>(ST);
+ return std::make_unique<AArch64InstrInfo>(ST);
}
/// The \p InputIRSnippet is only needed for things that can't be expressed in
TEST(ValueMapperTest, mapMDNodeDuplicatedCycle) {
LLVMContext Context;
auto *PtrTy = Type::getInt8Ty(Context)->getPointerTo();
- std::unique_ptr<GlobalVariable> G0 = llvm::make_unique<GlobalVariable>(
+ std::unique_ptr<GlobalVariable> G0 = std::make_unique<GlobalVariable>(
PtrTy, false, GlobalValue::ExternalLinkage, nullptr, "G0");
- std::unique_ptr<GlobalVariable> G1 = llvm::make_unique<GlobalVariable>(
+ std::unique_ptr<GlobalVariable> G1 = std::make_unique<GlobalVariable>(
PtrTy, false, GlobalValue::ExternalLinkage, nullptr, "G1");
// Create a cycle that references G0.
VPlanPtr buildHCFG(BasicBlock *LoopHeader) {
doAnalysis(*LoopHeader->getParent());
- auto Plan = llvm::make_unique<VPlan>();
+ auto Plan = std::make_unique<VPlan>();
VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan);
HCFGBuilder.buildHierarchicalCFG();
return Plan;
VPlanPtr buildPlainCFG(BasicBlock *LoopHeader) {
doAnalysis(*LoopHeader->getParent());
- auto Plan = llvm::make_unique<VPlan>();
+ auto Plan = std::make_unique<VPlan>();
VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan);
VPRegionBlock *TopRegion = HCFGBuilder.buildPlainCFG();
Plan->setEntry(TopRegion);
template <class RecordType> std::unique_ptr<Record> MakeRecord();
template <> std::unique_ptr<Record> MakeRecord<NewBufferRecord>() {
- return make_unique<NewBufferRecord>(1);
+ return std::make_unique<NewBufferRecord>(1);
}
template <> std::unique_ptr<Record> MakeRecord<NewCPUIDRecord>() {
- return make_unique<NewCPUIDRecord>(1, 2);
+ return std::make_unique<NewCPUIDRecord>(1, 2);
}
template <> std::unique_ptr<Record> MakeRecord<TSCWrapRecord>() {
- return make_unique<TSCWrapRecord>(1);
+ return std::make_unique<TSCWrapRecord>(1);
}
template <> std::unique_ptr<Record> MakeRecord<WallclockRecord>() {
- return make_unique<WallclockRecord>(1, 2);
+ return std::make_unique<WallclockRecord>(1, 2);
}
template <> std::unique_ptr<Record> MakeRecord<CustomEventRecord>() {
- return make_unique<CustomEventRecord>(4, 1, 2, "data");
+ return std::make_unique<CustomEventRecord>(4, 1, 2, "data");
}
template <> std::unique_ptr<Record> MakeRecord<CallArgRecord>() {
- return make_unique<CallArgRecord>(1);
+ return std::make_unique<CallArgRecord>(1);
}
template <> std::unique_ptr<Record> MakeRecord<PIDRecord>() {
- return make_unique<PIDRecord>(1);
+ return std::make_unique<PIDRecord>(1);
}
template <> std::unique_ptr<Record> MakeRecord<FunctionRecord>() {
- return make_unique<FunctionRecord>(RecordTypes::ENTER, 1, 2);
+ return std::make_unique<FunctionRecord>(RecordTypes::ENTER, 1, 2);
}
template <> std::unique_ptr<Record> MakeRecord<CustomEventRecordV5>() {
- return make_unique<CustomEventRecordV5>(4, 1, "data");
+ return std::make_unique<CustomEventRecordV5>(4, 1, "data");
}
template <> std::unique_ptr<Record> MakeRecord<TypedEventRecord>() {
- return make_unique<TypedEventRecord>(4, 1, 2, "data");
+ return std::make_unique<TypedEventRecord>(4, 1, 2, "data");
}
template <class T> class RoundTripTest : public ::testing::Test {
H.NonstopTSC = true;
H.CycleFrequency = 3e9;
- Writer = make_unique<FDRTraceWriter>(OS, H);
+ Writer = std::make_unique<FDRTraceWriter>(OS, H);
Rec = MakeRecord<T>();
}
H.NonstopTSC = true;
H.CycleFrequency = 3e9;
- Writer = make_unique<FDRTraceWriter>(OS, H);
+ Writer = std::make_unique<FDRTraceWriter>(OS, H);
Rec = MakeRecord<T>();
}
template <> struct Helper<BufferExtents> {
static std::unique_ptr<Record> construct() {
- return make_unique<BufferExtents>(1);
+ return std::make_unique<BufferExtents>(1);
}
static const char *expected() { return "<Buffer: size = 1 bytes>"; }
template <> struct Helper<WallclockRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<WallclockRecord>(1, 2);
+ return std::make_unique<WallclockRecord>(1, 2);
}
static const char *expected() { return "<Wall Time: seconds = 1.000002>"; }
template <> struct Helper<NewCPUIDRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<NewCPUIDRecord>(1, 2);
+ return std::make_unique<NewCPUIDRecord>(1, 2);
}
static const char *expected() { return "<CPU: id = 1, tsc = 2>"; }
template <> struct Helper<TSCWrapRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<TSCWrapRecord>(1);
+ return std::make_unique<TSCWrapRecord>(1);
}
static const char *expected() { return "<TSC Wrap: base = 1>"; }
template <> struct Helper<CustomEventRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<CustomEventRecord>(4, 1, 2, "data");
+ return std::make_unique<CustomEventRecord>(4, 1, 2, "data");
}
static const char *expected() {
template <> struct Helper<CallArgRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<CallArgRecord>(1);
+ return std::make_unique<CallArgRecord>(1);
}
static const char *expected() {
template <> struct Helper<PIDRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<PIDRecord>(1);
+ return std::make_unique<PIDRecord>(1);
}
static const char *expected() { return "<PID: 1>"; }
template <> struct Helper<NewBufferRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<NewBufferRecord>(1);
+ return std::make_unique<NewBufferRecord>(1);
}
static const char *expected() { return "<Thread ID: 1>"; }
template <> struct Helper<EndBufferRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<EndBufferRecord>();
+ return std::make_unique<EndBufferRecord>();
}
static const char *expected() { return "<End of Buffer>"; }
if (!V.empty() && V != Variant.Name)
continue;
- auto II = llvm::make_unique<MatchableInfo>(*CGI);
+ auto II = std::make_unique<MatchableInfo>(*CGI);
II->initialize(*this, SingletonRegisters, Variant, HasMnemonicFirst);
std::vector<Record*> AllInstAliases =
Records.getAllDerivedDefinitions("InstAlias");
for (unsigned i = 0, e = AllInstAliases.size(); i != e; ++i) {
- auto Alias = llvm::make_unique<CodeGenInstAlias>(AllInstAliases[i],
+ auto Alias = std::make_unique<CodeGenInstAlias>(AllInstAliases[i],
Target);
// If the tblgen -match-prefix option is specified (for tblgen hackers),
if (!V.empty() && V != Variant.Name)
continue;
- auto II = llvm::make_unique<MatchableInfo>(std::move(Alias));
+ auto II = std::make_unique<MatchableInfo>(std::move(Alias));
II->initialize(*this, SingletonRegisters, Variant, HasMnemonicFirst);
II->TheDef->getValueAsString("TwoOperandAliasConstraint");
if (Constraint != "") {
// Start by making a copy of the original matchable.
- auto AliasII = llvm::make_unique<MatchableInfo>(*II);
+ auto AliasII = std::make_unique<MatchableInfo>(*II);
// Adjust it to be a two-operand alias.
AliasII->formTwoOperandAlias(Constraint);
ListInit *LI = Frag->getValueAsListInit("Fragments");
TreePattern *P =
- (PatternFragments[Frag] = llvm::make_unique<TreePattern>(
+ (PatternFragments[Frag] = std::make_unique<TreePattern>(
Frag, LI, !Frag->isSubClassOf("OutPatFrag"),
*this)).get();
// is only for consumption by CodeGenRegister, it is not added to the
// RecordKeeper.
SynthDefs.emplace_back(
- llvm::make_unique<Record>(Name, Def->getLoc(), Def->getRecords()));
+ std::make_unique<Record>(Name, Def->getLoc(), Def->getRecords()));
Record *NewReg = SynthDefs.back().get();
Elts.insert(NewReg);
Sets.addFieldExpander("RegisterClass", "MemberList");
Sets.addFieldExpander("CalleeSavedRegs", "SaveList");
Sets.addExpander("RegisterTuples",
- llvm::make_unique<TupleExpander>(SynthDefs));
+ std::make_unique<TupleExpander>(SynthDefs));
// Read in the user-defined (named) sub-register indices.
// More indices will be synthesized later.
// Allow Set evaluation to recognize the dags used in InstRW records:
// (instrs Op1, Op1...)
- Sets.addOperator("instrs", llvm::make_unique<InstrsOp>());
- Sets.addOperator("instregex", llvm::make_unique<InstRegexOp>(Target));
+ Sets.addOperator("instrs", std::make_unique<InstrsOp>());
+ Sets.addOperator("instregex", std::make_unique<InstRegexOp>(Target));
// Instantiate a CodeGenProcModel for each SchedMachineModel with the values
// that are explicitly referenced in tablegen records. Resources associated
CodeGenRegBank &CodeGenTarget::getRegBank() const {
if (!RegBank)
- RegBank = llvm::make_unique<CodeGenRegBank>(Records, getHwModes());
+ RegBank = std::make_unique<CodeGenRegBank>(Records, getHwModes());
return *RegBank;
}
CodeGenSchedModels &CodeGenTarget::getSchedModels() const {
if (!SchedModels)
- SchedModels = llvm::make_unique<CodeGenSchedModels>(Records, *this);
+ SchedModels = std::make_unique<CodeGenSchedModels>(Records, *this);
return *SchedModels;
}
// Parse the instructions defined in the .td file.
for (unsigned i = 0, e = Insts.size(); i != e; ++i)
- Instructions[Insts[i]] = llvm::make_unique<CodeGenInstruction>(Insts[i]);
+ Instructions[Insts[i]] = std::make_unique<CodeGenInstruction>(Insts[i]);
}
static const CodeGenInstruction *
}
std::unique_ptr<Matcher> TheMatcher =
- llvm::make_unique<ScopeMatcher>(PatternMatchers);
+ std::make_unique<ScopeMatcher>(PatternMatchers);
OptimizeMatcher(TheMatcher, CGP);
//Matcher->dump();
// Delegates to an inferior filter chooser for further processing on this
// group of instructions whose segment values are variable.
FilterChooserMap.insert(
- std::make_pair(-1U, llvm::make_unique<FilterChooser>(
+ std::make_pair(-1U, std::make_unique<FilterChooser>(
Owner->AllInstructions, VariableInstructions,
Owner->Operands, BitValueArray, *Owner)));
}
// Delegates to an inferior filter chooser for further processing on this
// category of instructions.
FilterChooserMap.insert(std::make_pair(
- Inst.first, llvm::make_unique<FilterChooser>(
+ Inst.first, std::make_unique<FilterChooser>(
Owner->AllInstructions, Inst.second,
Owner->Operands, BitValueArray, *Owner)));
}
Optional<Kind *> addPredicate(Args &&... args) {
if (isSameAsAnotherOperand())
return None;
- Predicates.emplace_back(llvm::make_unique<Kind>(
+ Predicates.emplace_back(std::make_unique<Kind>(
getInsnVarID(), getOpIdx(), std::forward<Args>(args)...));
return static_cast<Kind *>(Predicates.back().get());
}
template <class Kind, class... Args>
Optional<Kind *> addPredicate(Args &&... args) {
Predicates.emplace_back(
- llvm::make_unique<Kind>(getInsnVarID(), std::forward<Args>(args)...));
+ std::make_unique<Kind>(getInsnVarID(), std::forward<Args>(args)...));
return static_cast<Kind *>(Predicates.back().get());
}
template <class Kind, class... Args>
Kind &addRenderer(Args&&... args) {
OperandRenderers.emplace_back(
- llvm::make_unique<Kind>(InsnID, std::forward<Args>(args)...));
+ std::make_unique<Kind>(InsnID, std::forward<Args>(args)...));
return *static_cast<Kind *>(OperandRenderers.back().get());
}
// iterator.
template <class Kind, class... Args>
Kind &RuleMatcher::addAction(Args &&... args) {
- Actions.emplace_back(llvm::make_unique<Kind>(std::forward<Args>(args)...));
+ Actions.emplace_back(std::make_unique<Kind>(std::forward<Args>(args)...));
return *static_cast<Kind *>(Actions.back().get());
}
action_iterator RuleMatcher::insertAction(action_iterator InsertPt,
Args &&... args) {
return Actions.emplace(InsertPt,
- llvm::make_unique<Kind>(std::forward<Args>(args)...));
+ std::make_unique<Kind>(std::forward<Args>(args)...));
}
unsigned RuleMatcher::implicitlyDefineInsnVar(InstructionMatcher &Matcher) {
std::vector<std::unique_ptr<Matcher>> &MatcherStorage) {
std::vector<Matcher *> OptRules;
- std::unique_ptr<GroupT> CurrentGroup = make_unique<GroupT>();
+ std::unique_ptr<GroupT> CurrentGroup = std::make_unique<GroupT>();
assert(CurrentGroup->empty() && "Newly created group isn't empty!");
unsigned NumGroups = 0;
MatcherStorage.emplace_back(std::move(CurrentGroup));
++NumGroups;
}
- CurrentGroup = make_unique<GroupT>();
+ CurrentGroup = std::make_unique<GroupT>();
};
for (Matcher *Rule : Rules) {
// Greedily add as many matchers as possible to the current group:
CodeGenIntrinsic &getIntrinsic(Init *I) {
std::unique_ptr<CodeGenIntrinsic> &Intr = Intrinsics[I];
if (!Intr)
- Intr = make_unique<CodeGenIntrinsic>(cast<DefInit>(I)->getDef());
+ Intr = std::make_unique<CodeGenIntrinsic>(cast<DefInit>(I)->getDef());
return *Intr;
}
SearchableTableEmitter::parseSearchIndex(GenericTable &Table, StringRef Name,
const std::vector<StringRef> &Key,
bool EarlyOut) {
- auto Index = llvm::make_unique<SearchIndex>();
+ auto Index = std::make_unique<SearchIndex>();
Index->Name = Name;
Index->EarlyOut = EarlyOut;
if (!ValueField.empty())
Value = getInt(EntryRec, ValueField);
- Enum.Entries.push_back(llvm::make_unique<GenericEnum::Entry>(Name, Value));
+ Enum.Entries.push_back(std::make_unique<GenericEnum::Entry>(Name, Value));
Enum.EntryMap.insert(std::make_pair(EntryRec, Enum.Entries.back().get()));
}
if (!EnumRec->isValueUnset("ValueField"))
ValueField = EnumRec->getValueAsString("ValueField");
- auto Enum = llvm::make_unique<GenericEnum>();
+ auto Enum = std::make_unique<GenericEnum>();
Enum->Name = EnumRec->getName();
Enum->PreprocessorGuard = EnumRec->getName();
}
for (auto TableRec : Records.getAllDerivedDefinitions("GenericTable")) {
- auto Table = llvm::make_unique<GenericTable>();
+ auto Table = std::make_unique<GenericTable>();
Table->Name = TableRec->getName();
Table->PreprocessorGuard = TableRec->getName();
Table->CppTypeName = TableRec->getValueAsString("CppTypeName");
if (!Class->isValueUnset("EnumValueField"))
ValueField = Class->getValueAsString("EnumValueField");
- auto Enum = llvm::make_unique<GenericEnum>();
+ auto Enum = std::make_unique<GenericEnum>();
Enum->Name = (Twine(Class->getName()) + "Values").str();
Enum->PreprocessorGuard = Class->getName().upper();
Enum->Class = Class;
Enums.emplace_back(std::move(Enum));
}
- auto Table = llvm::make_unique<GenericTable>();
+ auto Table = std::make_unique<GenericTable>();
Table->Name = (Twine(Class->getName()) + "sList").str();
Table->PreprocessorGuard = Class->getName().upper();
Table->CppTypeName = Class->getName();
DisassemblerTables::DisassemblerTables() {
for (unsigned i = 0; i < array_lengthof(Tables); i++)
- Tables[i] = llvm::make_unique<ContextDecision>();
+ Tables[i] = std::make_unique<ContextDecision>();
HasConflicts = false;
}
case X86Local::RawFrmImm8:
case X86Local::RawFrmImm16:
case X86Local::AddCCFrm:
- filter = llvm::make_unique<DumbFilter>();
+ filter = std::make_unique<DumbFilter>();
break;
case X86Local::MRMDestReg:
case X86Local::MRMSrcReg:
case X86Local::MRMSrcRegCC:
case X86Local::MRMXrCC:
case X86Local::MRMXr:
- filter = llvm::make_unique<ModFilter>(true);
+ filter = std::make_unique<ModFilter>(true);
break;
case X86Local::MRMDestMem:
case X86Local::MRMSrcMem:
case X86Local::MRMSrcMemCC:
case X86Local::MRMXmCC:
case X86Local::MRMXm:
- filter = llvm::make_unique<ModFilter>(false);
+ filter = std::make_unique<ModFilter>(false);
break;
case X86Local::MRM0r: case X86Local::MRM1r:
case X86Local::MRM2r: case X86Local::MRM3r:
case X86Local::MRM4r: case X86Local::MRM5r:
case X86Local::MRM6r: case X86Local::MRM7r:
- filter = llvm::make_unique<ExtendedFilter>(true, Form - X86Local::MRM0r);
+ filter = std::make_unique<ExtendedFilter>(true, Form - X86Local::MRM0r);
break;
case X86Local::MRM0m: case X86Local::MRM1m:
case X86Local::MRM2m: case X86Local::MRM3m:
case X86Local::MRM4m: case X86Local::MRM5m:
case X86Local::MRM6m: case X86Local::MRM7m:
- filter = llvm::make_unique<ExtendedFilter>(false, Form - X86Local::MRM0m);
+ filter = std::make_unique<ExtendedFilter>(false, Form - X86Local::MRM0m);
break;
X86_INSTR_MRM_MAPPING
- filter = llvm::make_unique<ExactFilter>(0xC0 + Form - X86Local::MRM_C0);
+ filter = std::make_unique<ExactFilter>(0xC0 + Form - X86Local::MRM_C0);
break;
} // switch (Form)