[llvm] 14415a3 - Apply clang-tidy fixes for readability-redundant-smartptr-get in InstrProfReader.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 09:19:28 PDT 2022


Author: Kazu Hirata
Date: 2022-03-28T09:18:38-07:00
New Revision: 14415a3a5a58a122da29d3e33e9fa51a717c742c

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

LOG: Apply clang-tidy fixes for readability-redundant-smartptr-get in InstrProfReader.cpp (NFC)

Added: 
    

Modified: 
    llvm/lib/ProfileData/InstrProfReader.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index 51fe691c05937..d3043075cb138 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -448,7 +448,7 @@ Error RawInstrProfReader<IntPtrT>::readHeader(
     return error(instrprof_error::bad_header);
 
   std::unique_ptr<InstrProfSymtab> NewSymtab = std::make_unique<InstrProfSymtab>();
-  if (Error E = createSymtab(*NewSymtab.get()))
+  if (Error E = createSymtab(*NewSymtab))
     return E;
 
   Symtab = std::move(NewSymtab);
@@ -1002,16 +1002,16 @@ Error IndexedInstrProfReader::readHeader() {
 }
 
 InstrProfSymtab &IndexedInstrProfReader::getSymtab() {
-  if (Symtab.get())
-    return *Symtab.get();
+  if (Symtab)
+    return *Symtab;
 
   std::unique_ptr<InstrProfSymtab> NewSymtab = std::make_unique<InstrProfSymtab>();
-  if (Error E = Index->populateSymtab(*NewSymtab.get())) {
+  if (Error E = Index->populateSymtab(*NewSymtab)) {
     consumeError(error(InstrProfError::take(std::move(E))));
   }
 
   Symtab = std::move(NewSymtab);
-  return *Symtab.get();
+  return *Symtab;
 }
 
 Expected<InstrProfRecord>


        


More information about the llvm-commits mailing list