[llvm] 0e9d37f - [llvm] Qualify auto in range-based for loops (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 28 23:29:22 PDT 2022


Author: Kazu Hirata
Date: 2022-08-28T23:29:00-07:00
New Revision: 0e9d37ff95b5c574a8fde65bb176691e1a17d70d

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

LOG: [llvm] Qualify auto in range-based for loops (NFC)

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
    llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
    llvm/lib/IR/Constants.cpp
    llvm/lib/IR/DebugInfo.cpp
    llvm/lib/IR/Function.cpp
    llvm/lib/IR/Metadata.cpp
    llvm/lib/MC/MCWin64EH.cpp
    llvm/lib/Option/ArgList.cpp
    llvm/lib/ProfileData/SampleProfReader.cpp
    llvm/lib/TableGen/JSONBackend.cpp
    llvm/lib/TableGen/TGParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index e75c4eba52962..869b383dd064f 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -261,10 +261,10 @@ void MCJIT::finalizeObject() {
   // Generate code for module is going to move objects out of the 'added' list,
   // so we need to copy that out before using it:
   SmallVector<Module*, 16> ModsToAdd;
-  for (auto M : OwnedModules.added())
+  for (auto *M : OwnedModules.added())
     ModsToAdd.push_back(M);
 
-  for (auto M : ModsToAdd)
+  for (auto *M : ModsToAdd)
     generateCodeForModule(M);
 
   finalizeLoadedModules();

diff  --git a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
index d3ebc72030d30..d702fefe2de4a 100644
--- a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
@@ -439,7 +439,7 @@ void COFFPlatform::pushInitializersLoop(PushInitializersSendResultFn SendResult,
         RegisteredInitSymbols.erase(RISItr);
       }
 
-      for (auto DepJD : JDDepMap[CurJD])
+      for (auto *DepJD : JDDepMap[CurJD])
         if (!Visited.count(DepJD)) {
           Worklist.push_back(DepJD);
           Visited.insert(DepJD);

diff  --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index f9800cc0c07c1..b4a47db12a065 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2480,7 +2480,7 @@ Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C,
   if (VectorType *VecTy = dyn_cast<VectorType>(C->getType()))
     EltCount = VecTy->getElementCount();
   else
-    for (auto Idx : Idxs)
+    for (auto *Idx : Idxs)
       if (VectorType *VecTy = dyn_cast<VectorType>(Idx->getType()))
         EltCount = VecTy->getElementCount();
 

diff  --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 344d3007e85d0..e833c01f6502f 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -161,7 +161,7 @@ void DebugInfoFinder::processModule(const Module &M) {
 void DebugInfoFinder::processCompileUnit(DICompileUnit *CU) {
   if (!addCompileUnit(CU))
     return;
-  for (auto DIG : CU->getGlobalVariables()) {
+  for (auto *DIG : CU->getGlobalVariables()) {
     if (!addGlobalVariable(DIG))
       continue;
     auto *GV = DIG->getVariable();

diff  --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index cbf8ecd5b5984..66f7f84b2267c 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -833,7 +833,7 @@ static std::string getMangledTypeStr(Type *Ty, bool &HasUnnamedType) {
         HasUnnamedType = true;
     } else {
       Result += "sl_";
-      for (auto Elem : STyp->elements())
+      for (auto *Elem : STyp->elements())
         Result += getMangledTypeStr(Elem, HasUnnamedType);
     }
     // Ensure nested structs are distinguishable.
@@ -1727,7 +1727,7 @@ Intrinsic::matchIntrinsicSignature(FunctionType *FTy,
 
   unsigned NumDeferredReturnChecks = DeferredChecks.size();
 
-  for (auto Ty : FTy->params())
+  for (auto *Ty : FTy->params())
     if (matchIntrinsicType(Ty, Infos, ArgTys, DeferredChecks, false))
       return MatchIntrinsicTypes_NoMatchArg;
 

diff  --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index a2027439240fe..fe7d9c1b20328 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -206,7 +206,7 @@ SmallVector<Metadata *> ReplaceableMetadataImpl::getAllArgListUsers() {
     return UserA->second < UserB->second;
   });
   SmallVector<Metadata *> MDUsers;
-  for (auto UserWithID : MDUsersWithID)
+  for (auto *UserWithID : MDUsersWithID)
     MDUsers.push_back(UserWithID->first.get<Metadata *>());
   return MDUsers;
 }

diff  --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp
index ff1c1ad94e50f..29a9adb482fcc 100644
--- a/llvm/lib/MC/MCWin64EH.cpp
+++ b/llvm/lib/MC/MCWin64EH.cpp
@@ -948,7 +948,7 @@ static void ARM64ProcessEpilogs(WinEH::FrameInfo *info,
 
   // Epilogs processed so far.
   std::vector<MCSymbol *> AddedEpilogs;
-  for (auto S : EpilogStarts) {
+  for (auto *S : EpilogStarts) {
     MCSymbol *EpilogStart = S;
     auto &EpilogInstrs = info->EpilogMap[S].Instructions;
     uint32_t CodeBytes = ARM64CountOfUnwindCodes(EpilogInstrs);

diff  --git a/llvm/lib/Option/ArgList.cpp b/llvm/lib/Option/ArgList.cpp
index fab0fb07cbc83..558a8df6d5506 100644
--- a/llvm/lib/Option/ArgList.cpp
+++ b/llvm/lib/Option/ArgList.cpp
@@ -136,7 +136,7 @@ void ArgList::AddAllArgs(ArgStringList &Output,
 /// that accepts a single specifier, given the above which accepts any number.
 void ArgList::AddAllArgs(ArgStringList &Output, OptSpecifier Id0,
                          OptSpecifier Id1, OptSpecifier Id2) const {
-  for (auto Arg: filtered(Id0, Id1, Id2)) {
+  for (auto *Arg : filtered(Id0, Id1, Id2)) {
     Arg->claim();
     Arg->render(*this, Output);
   }
@@ -144,7 +144,7 @@ void ArgList::AddAllArgs(ArgStringList &Output, OptSpecifier Id0,
 
 void ArgList::AddAllArgValues(ArgStringList &Output, OptSpecifier Id0,
                               OptSpecifier Id1, OptSpecifier Id2) const {
-  for (auto Arg : filtered(Id0, Id1, Id2)) {
+  for (auto *Arg : filtered(Id0, Id1, Id2)) {
     Arg->claim();
     const auto &Values = Arg->getValues();
     Output.append(Values.begin(), Values.end());
@@ -154,7 +154,7 @@ void ArgList::AddAllArgValues(ArgStringList &Output, OptSpecifier Id0,
 void ArgList::AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0,
                                    const char *Translation,
                                    bool Joined) const {
-  for (auto Arg: filtered(Id0)) {
+  for (auto *Arg : filtered(Id0)) {
     Arg->claim();
 
     if (Joined) {

diff  --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index 84b150d2f47f3..6d1fad4ef1459 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -1720,7 +1720,7 @@ std::error_code SampleProfileReaderGCC::readOneFunctionProfile(
     if (Update) {
       // Walk up the inline stack, adding the samples on this line to
       // the total sample count of the callers in the chain.
-      for (auto CallerProfile : NewStack)
+      for (auto *CallerProfile : NewStack)
         CallerProfile->addTotalSamples(Count);
 
       // Update the body samples for the current profile.

diff  --git a/llvm/lib/TableGen/JSONBackend.cpp b/llvm/lib/TableGen/JSONBackend.cpp
index 6dc466e29df3e..a9dc30d7f59b6 100644
--- a/llvm/lib/TableGen/JSONBackend.cpp
+++ b/llvm/lib/TableGen/JSONBackend.cpp
@@ -60,7 +60,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
     return Str->getValue();
   } else if (auto *List = dyn_cast<ListInit>(&I)) {
     json::Array array;
-    for (auto val : *List)
+    for (auto *val : *List)
       array.push_back(translateInit(*val));
     return std::move(array);
   }

diff  --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index aab1802c53480..325d43760aa01 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -404,7 +404,7 @@ bool TGParser::resolve(const ForeachLoop &Loop, SubstStack &Substs,
   }
 
   bool Error = false;
-  for (auto Elt : *LI) {
+  for (auto *Elt : *LI) {
     if (Loop.IterVar)
       Substs.emplace_back(Loop.IterVar->getNameInit(), Elt);
     Error = resolve(Loop.Entries, Substs, Final, Dest);


        


More information about the llvm-commits mailing list