[llvm] df9af1f - Remove redundant `get()` call and use auto on LHS of make_unique

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 15:13:01 PDT 2023


Author: David Blaikie
Date: 2023-04-07T22:12:52Z
New Revision: df9af1fe7c9ce7ce6bc3e55c504d25c59ad83a87

URL: https://github.com/llvm/llvm-project/commit/df9af1fe7c9ce7ce6bc3e55c504d25c59ad83a87
DIFF: https://github.com/llvm/llvm-project/commit/df9af1fe7c9ce7ce6bc3e55c504d25c59ad83a87.diff

LOG: Remove redundant `get()` call and use auto on LHS of make_unique

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/Assembler.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/Assembler.cpp b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
index ca882cf35acf5..1888585e2f0ac 100644
--- a/llvm/tools/llvm-exegesis/lib/Assembler.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
@@ -164,10 +164,9 @@ BitVector getFunctionReservedRegs(const TargetMachine &TM) {
   std::unique_ptr<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<MachineModuleInfoWrapperPass> MMIWP =
-      std::make_unique<MachineModuleInfoWrapperPass>(&LLVMTM);
+  auto MMIWP = std::make_unique<MachineModuleInfoWrapperPass>(&LLVMTM);
   MachineFunction &MF = createVoidVoidPtrMachineFunction(
-      FunctionID, Module.get(), &MMIWP.get()->getMMI());
+      FunctionID, Module.get(), &MMIWP->getMMI());
   // Saving reserved registers for client.
   return MF.getSubtarget().getRegisterInfo()->getReservedRegs(MF);
 }


        


More information about the llvm-commits mailing list