mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-25 18:55:48 +00:00
[CodeGen] Apply clang-tidy fixes for readability-redundant-smartptr-get (NFC)
This commit is contained in:
parent
4b28980772
commit
1eada2adda
@ -116,7 +116,7 @@ void AsmPrinter::emitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
|
||||
report_fatal_error("Inline asm not supported by this streamer because"
|
||||
" we don't have an asm parser for this target\n");
|
||||
Parser->setAssemblerDialect(Dialect);
|
||||
Parser->setTargetParser(*TAP.get());
|
||||
Parser->setTargetParser(*TAP);
|
||||
// Enable lexing Masm binary and hex integer literals in intel inline
|
||||
// assembly.
|
||||
if (Dialect == InlineAsm::AD_Intel)
|
||||
|
@ -509,7 +509,7 @@ void CodeViewDebug::maybeRecordLocation(const DebugLoc &DL,
|
||||
if (!DL || DL == PrevInstLoc)
|
||||
return;
|
||||
|
||||
const DIScope *Scope = DL.get()->getScope();
|
||||
const DIScope *Scope = DL->getScope();
|
||||
if (!Scope)
|
||||
return;
|
||||
|
||||
|
@ -113,7 +113,7 @@ bool Combiner::combineMachineInstrs(MachineFunction &MF,
|
||||
|
||||
bool MFChanged = false;
|
||||
bool Changed;
|
||||
MachineIRBuilder &B = *Builder.get();
|
||||
MachineIRBuilder &B = *Builder;
|
||||
|
||||
do {
|
||||
// Collect all instructions. Do a post order traversal for basic blocks and
|
||||
|
@ -3000,7 +3000,7 @@ bool IRTranslator::translate(const Constant &C, Register Reg) {
|
||||
// Return the scalar if it is a <1 x Ty> vector.
|
||||
unsigned NumElts = CAZ->getElementCount().getFixedValue();
|
||||
if (NumElts == 1)
|
||||
return translateCopy(C, *CAZ->getElementValue(0u), *EntryBuilder.get());
|
||||
return translateCopy(C, *CAZ->getElementValue(0u), *EntryBuilder);
|
||||
SmallVector<Register, 4> Ops;
|
||||
for (unsigned I = 0; I < NumElts; ++I) {
|
||||
Constant &Elt = *CAZ->getElementValue(I);
|
||||
@ -3010,8 +3010,7 @@ bool IRTranslator::translate(const Constant &C, Register Reg) {
|
||||
} else if (auto CV = dyn_cast<ConstantDataVector>(&C)) {
|
||||
// Return the scalar if it is a <1 x Ty> vector.
|
||||
if (CV->getNumElements() == 1)
|
||||
return translateCopy(C, *CV->getElementAsConstant(0),
|
||||
*EntryBuilder.get());
|
||||
return translateCopy(C, *CV->getElementAsConstant(0), *EntryBuilder);
|
||||
SmallVector<Register, 4> Ops;
|
||||
for (unsigned i = 0; i < CV->getNumElements(); ++i) {
|
||||
Constant &Elt = *CV->getElementAsConstant(i);
|
||||
@ -3029,7 +3028,7 @@ bool IRTranslator::translate(const Constant &C, Register Reg) {
|
||||
}
|
||||
} else if (auto CV = dyn_cast<ConstantVector>(&C)) {
|
||||
if (CV->getNumOperands() == 1)
|
||||
return translateCopy(C, *CV->getOperand(0), *EntryBuilder.get());
|
||||
return translateCopy(C, *CV->getOperand(0), *EntryBuilder);
|
||||
SmallVector<Register, 4> Ops;
|
||||
for (unsigned i = 0; i < CV->getNumOperands(); ++i) {
|
||||
Ops.push_back(getOrCreateVReg(*CV->getOperand(i)));
|
||||
@ -3429,7 +3428,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!CLI->lowerFormalArguments(*EntryBuilder.get(), F, VRegArgs, FuncInfo)) {
|
||||
if (!CLI->lowerFormalArguments(*EntryBuilder, F, VRegArgs, FuncInfo)) {
|
||||
OptimizationRemarkMissed R("gisel-irtranslator", "GISelFailure",
|
||||
F.getSubprogram(), &F.getEntryBlock());
|
||||
R << "unable to lower arguments: " << ore::NV("Prototype", F.getType());
|
||||
|
@ -88,7 +88,7 @@ LazyMachineBlockFrequencyInfoPass::calculateIfNotAvailable() const {
|
||||
|
||||
OwnedMBFI = std::make_unique<MachineBlockFrequencyInfo>();
|
||||
OwnedMBFI->calculate(*MF, MBPI, *MLI);
|
||||
return *OwnedMBFI.get();
|
||||
return *OwnedMBFI;
|
||||
}
|
||||
|
||||
bool LazyMachineBlockFrequencyInfoPass::runOnMachineFunction(
|
||||
|
@ -914,14 +914,14 @@ private:
|
||||
std::unique_ptr<VarLocSet> &VLS = Locs[MBB];
|
||||
if (!VLS)
|
||||
VLS = std::make_unique<VarLocSet>(Alloc);
|
||||
return *VLS.get();
|
||||
return *VLS;
|
||||
}
|
||||
|
||||
const VarLocSet &getVarLocsInMBB(const MachineBasicBlock *MBB,
|
||||
const VarLocInMBB &Locs) const {
|
||||
auto It = Locs.find(MBB);
|
||||
assert(It != Locs.end() && "MBB not in map");
|
||||
return *It->second.get();
|
||||
return *It->second;
|
||||
}
|
||||
|
||||
/// Tests whether this instruction is a spill to a stack location.
|
||||
@ -1940,7 +1940,7 @@ bool VarLocBasedLDV::join(
|
||||
|
||||
// Just copy over the Out locs to incoming locs for the first visited
|
||||
// predecessor, and for all other predecessors join the Out locs.
|
||||
VarLocSet &OutLocVLS = *OL->second.get();
|
||||
VarLocSet &OutLocVLS = *OL->second;
|
||||
if (!NumVisited)
|
||||
InLocsT = OutLocVLS;
|
||||
else
|
||||
@ -1999,7 +1999,7 @@ void VarLocBasedLDV::flushPendingLocs(VarLocInMBB &PendingInLocs,
|
||||
for (auto &Iter : PendingInLocs) {
|
||||
// Map is keyed on a constant pointer, unwrap it so we can insert insts.
|
||||
auto &MBB = const_cast<MachineBasicBlock &>(*Iter.first);
|
||||
VarLocSet &Pending = *Iter.second.get();
|
||||
VarLocSet &Pending = *Iter.second;
|
||||
|
||||
SmallVector<VarLoc, 32> VarLocs;
|
||||
collectAllVarLocs(VarLocs, Pending, VarLocIDs);
|
||||
|
@ -110,7 +110,7 @@ bool FinalizeMachineBundles::runOnMachineFunction(MachineFunction &MF) {
|
||||
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI,
|
||||
MachineBasicBlock::instr_iterator LastMI) {
|
||||
for (auto MII = FirstMI; MII != LastMI; ++MII)
|
||||
if (MII->getDebugLoc().get())
|
||||
if (MII->getDebugLoc())
|
||||
return MII->getDebugLoc();
|
||||
return DebugLoc();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ bool PostRAHazardRecognizer::runOnMachineFunction(MachineFunction &Fn) {
|
||||
TII->CreateTargetPostRAHazardRecognizer(Fn));
|
||||
|
||||
// Return if the target has not implemented a hazard recognizer.
|
||||
if (!HazardRec.get())
|
||||
if (!HazardRec)
|
||||
return false;
|
||||
|
||||
// Loop over all of the basic blocks
|
||||
|
Loading…
x
Reference in New Issue
Block a user