mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-14 15:16:07 +03:00
Remove legacy llvm::make_unique
This commit is contained in:
parent
8e1fc9575d
commit
f6702cfbf5
5 changed files with 8 additions and 19 deletions
|
@ -831,10 +831,10 @@ int linkObjToBinaryGcc(llvm::StringRef outputPath,
|
|||
std::unique_ptr<ArgsBuilder> argsBuilder;
|
||||
if (global.params.targetTriple->isOSBinFormatWasm()) {
|
||||
tool = getProgram("wasm-ld", &opts::linker);
|
||||
argsBuilder = llvm::make_unique<LdArgsBuilder>();
|
||||
argsBuilder = std::make_unique<LdArgsBuilder>();
|
||||
} else {
|
||||
tool = getGcc();
|
||||
argsBuilder = llvm::make_unique<ArgsBuilder>();
|
||||
argsBuilder = std::make_unique<ArgsBuilder>();
|
||||
}
|
||||
|
||||
// build arguments
|
||||
|
|
|
@ -48,14 +48,14 @@ llvm::Function *IRState::topfunc() { return func()->getLLVMFunc(); }
|
|||
llvm::Instruction *IRState::topallocapoint() { return funcGen().allocapoint; }
|
||||
|
||||
std::unique_ptr<IRBuilderScope> IRState::setInsertPoint(llvm::BasicBlock *bb) {
|
||||
auto savedScope = llvm::make_unique<IRBuilderScope>(builder);
|
||||
auto savedScope = std::make_unique<IRBuilderScope>(builder);
|
||||
builder.SetInsertPoint(bb);
|
||||
return savedScope;
|
||||
}
|
||||
|
||||
std::unique_ptr<llvm::IRBuilderBase::InsertPointGuard>
|
||||
IRState::saveInsertPoint() {
|
||||
return llvm::make_unique<llvm::IRBuilderBase::InsertPointGuard>(builder);
|
||||
return std::make_unique<llvm::IRBuilderBase::InsertPointGuard>(builder);
|
||||
}
|
||||
|
||||
bool IRState::scopereturned() {
|
||||
|
|
|
@ -31,13 +31,6 @@
|
|||
#include "llvm/IR/IRBuilder.h"
|
||||
#include "llvm/IR/DebugInfo.h"
|
||||
|
||||
// LLVM >= 10 requires C++14 and no longer has llvm::make_unique. Add it back
|
||||
// and point to std::make_unique.
|
||||
#include <memory>
|
||||
namespace llvm {
|
||||
using std::make_unique;
|
||||
}
|
||||
|
||||
using llvm::APFloat;
|
||||
using llvm::APInt;
|
||||
using llvm::IRBuilder;
|
||||
|
|
|
@ -955,7 +955,7 @@ void CodeGenPGO::loadRegionCounts(llvm::IndexedInstrProfReader *PGOReader,
|
|||
}
|
||||
|
||||
ProfRecord =
|
||||
llvm::make_unique<llvm::InstrProfRecord>(std::move(RecordExpected.get()));
|
||||
std::make_unique<llvm::InstrProfRecord>(std::move(RecordExpected.get()));
|
||||
RegionCounts = ProfRecord->Counts;
|
||||
|
||||
IF_LOG Logger::println("Loaded profile data for function: %s",
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
#endif
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
|
||||
namespace llvm {
|
||||
using std::make_unique;
|
||||
}
|
||||
|
||||
namespace {
|
||||
template <typename T> std::unique_ptr<T> unique(T *ptr) {
|
||||
return std::unique_ptr<T>(ptr);
|
||||
|
@ -263,8 +259,8 @@ void disassemble(const llvm::TargetMachine &tm,
|
|||
}
|
||||
|
||||
SymTable symTable(ctx);
|
||||
disasm->setSymbolizer(llvm::make_unique<Symbolizer>(
|
||||
ctx, llvm::make_unique<llvm::MCRelocationInfo>(ctx), symTable));
|
||||
disasm->setSymbolizer(std::make_unique<Symbolizer>(
|
||||
ctx, std::make_unique<llvm::MCRelocationInfo>(ctx), symTable));
|
||||
|
||||
auto mcia = unique(target.createMCInstrAnalysis(mii));
|
||||
if (nullptr == mcia) {
|
||||
|
@ -285,7 +281,7 @@ void disassemble(const llvm::TargetMachine &tm,
|
|||
|
||||
// Streamer takes ownership of mip mab
|
||||
auto asmStreamer = unique(target.createAsmStreamer(
|
||||
ctx, llvm::make_unique<llvm::formatted_raw_ostream>(os), true, true,
|
||||
ctx, std::make_unique<llvm::formatted_raw_ostream>(os), true, true,
|
||||
mip.release(), nullptr, std::move(mab), false));
|
||||
if (nullptr == asmStreamer) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue