Skip to content

Commit 75bc20f

Browse files
[llvm] Remove redundant calls to std::unique_ptr<T>::get (NFC) (#97914)
1 parent f767295 commit 75bc20f

File tree

27 files changed

+43
-45
lines changed

27 files changed

+43
-45
lines changed

llvm/include/llvm/Analysis/BranchProbabilityInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class BranchProbabilityInfo {
345345

346346
/// Helper to construct LoopBlock for \p BB.
347347
LoopBlock getLoopBlock(const BasicBlock *BB) const {
348-
return LoopBlock(BB, *LI, *SccI.get());
348+
return LoopBlock(BB, *LI, *SccI);
349349
}
350350

351351
/// Returns true if destination block belongs to some loop and source block is

llvm/include/llvm/Analysis/MLInlineAdvisor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MLInlineAdvisor : public InlineAdvisor {
4545

4646
bool isForcedToStop() const { return ForceStop; }
4747
int64_t getLocalCalls(Function &F);
48-
const MLModelRunner &getModelRunner() const { return *ModelRunner.get(); }
48+
const MLModelRunner &getModelRunner() const { return *ModelRunner; }
4949
FunctionPropertiesInfo &getCachedFPI(Function &) const;
5050

5151
protected:

llvm/include/llvm/Analysis/MemorySSA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ class MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {
937937
struct Result {
938938
Result(std::unique_ptr<MemorySSA> &&MSSA) : MSSA(std::move(MSSA)) {}
939939

940-
MemorySSA &getMSSA() { return *MSSA.get(); }
940+
MemorySSA &getMSSA() { return *MSSA; }
941941

942942
std::unique_ptr<MemorySSA> MSSA;
943943

llvm/include/llvm/ProfileData/SampleProfReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ class SampleProfileReader {
449449
StringRef RemapFilename = "");
450450

451451
/// Return the profile summary.
452-
ProfileSummary &getSummary() const { return *(Summary.get()); }
452+
ProfileSummary &getSummary() const { return *Summary; }
453453

454454
MemoryBuffer *getBuffer() const { return Buffer.get(); }
455455

llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,5 +859,5 @@ GISelKnownBits &GISelKnownBitsAnalysis::get(MachineFunction &MF) {
859859
MF.getTarget().getOptLevel() == CodeGenOptLevel::None ? 2 : 6;
860860
Info = std::make_unique<GISelKnownBits>(MF, MaxDepth);
861861
}
862-
return *Info.get();
862+
return *Info;
863863
}

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3968,7 +3968,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
39683968
#endif // ifndef NDEBUG
39693969

39703970
// Translate any debug-info attached to the instruction.
3971-
translateDbgInfo(Inst, *CurBuilder.get());
3971+
translateDbgInfo(Inst, *CurBuilder);
39723972

39733973
if (translate(Inst))
39743974
continue;

llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,13 +1843,13 @@ bool CompileUnit::resolveDependenciesAndMarkLiveness(
18431843
bool CompileUnit::updateDependenciesCompleteness() {
18441844
assert(Dependencies.get());
18451845

1846-
return Dependencies.get()->updateDependenciesCompleteness();
1846+
return Dependencies->updateDependenciesCompleteness();
18471847
}
18481848

18491849
void CompileUnit::verifyDependencies() {
18501850
assert(Dependencies.get());
18511851

1852-
Dependencies.get()->verifyKeepChain();
1852+
Dependencies->verifyKeepChain();
18531853
}
18541854

18551855
ArrayRef<dwarf::Attribute> dwarf_linker::parallel::getODRAttributes() {

llvm/lib/DWARFLinker/Parallel/DWARFLinkerImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Error DWARFLinkerImpl::link() {
142142
// twice. And then following handling might be removed.
143143
for (const std::unique_ptr<DWARFUnit> &OrigCU :
144144
Context->InputDWARFFile.Dwarf->compile_units()) {
145-
DWARFDie UnitDie = OrigCU.get()->getUnitDIE();
145+
DWARFDie UnitDie = OrigCU->getUnitDIE();
146146

147147
if (!Language) {
148148
if (std::optional<DWARFFormValue> Val =

llvm/lib/IR/DebugProgramInstruction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ DbgVariableIntrinsic *
399399
DbgVariableRecord::createDebugIntrinsic(Module *M,
400400
Instruction *InsertBefore) const {
401401
[[maybe_unused]] DICompileUnit *Unit =
402-
getDebugLoc().get()->getScope()->getSubprogram()->getUnit();
402+
getDebugLoc()->getScope()->getSubprogram()->getUnit();
403403
assert(M && Unit &&
404404
"Cannot clone from BasicBlock that is not part of a Module or "
405405
"DICompileUnit!");

llvm/lib/ObjectYAML/XCOFFYAML.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ void MappingTraits<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>>::mapping(
327327

328328
XCOFFYAML::AuxSymbolType AuxType;
329329
if (IO.outputting())
330-
AuxType = AuxSym.get()->Type;
330+
AuxType = AuxSym->Type;
331331
IO.mapRequired("Type", AuxType);
332332
switch (AuxType) {
333333
case XCOFFYAML::AUX_EXCEPT:

0 commit comments

Comments
 (0)