[llvm] 7b57a1b - [llvm] format and terminate namespaces with closing comment (#94917)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 13:20:56 PDT 2024


Author: Mohammed Keyvanzadeh
Date: 2024-06-21T23:50:53+03:30
New Revision: 7b57a1b4018db0c987fb5a67effbef4d7559c4f1

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

LOG: [llvm] format and terminate namespaces with closing comment (#94917)

Namespaces are terminated with a closing comment in the majority of the
codebase so do the same here for consistency. Also format code within
some namespaces to make clang-format happy.

Added: 
    

Modified: 
    llvm/lib/Analysis/CallGraphSCCPass.cpp
    llvm/lib/Analysis/CallPrinter.cpp
    llvm/lib/Analysis/CaptureTracking.cpp
    llvm/lib/Analysis/CycleAnalysis.cpp
    llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
    llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp
    llvm/lib/Analysis/InlineAdvisor.cpp
    llvm/lib/Analysis/LazyValueInfo.cpp
    llvm/lib/Analysis/LoopAnalysisManager.cpp
    llvm/lib/Analysis/LoopPass.cpp
    llvm/lib/Analysis/ScalarEvolution.cpp
    llvm/lib/Analysis/ScalarEvolutionDivision.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp
index 307dddd51ece0..ccba8b3831c8f 100644
--- a/llvm/lib/Analysis/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp
@@ -46,7 +46,7 @@ using namespace llvm;
 namespace llvm {
 cl::opt<unsigned> MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden,
                                       cl::init(4));
-}
+} // namespace llvm
 
 STATISTIC(MaxSCCIterations, "Maximum CGSCCPassMgr iterations on one SCC");
 

diff  --git a/llvm/lib/Analysis/CallPrinter.cpp b/llvm/lib/Analysis/CallPrinter.cpp
index 65e3184fad91a..effa25f276dd2 100644
--- a/llvm/lib/Analysis/CallPrinter.cpp
+++ b/llvm/lib/Analysis/CallPrinter.cpp
@@ -29,7 +29,7 @@ using namespace llvm;
 
 namespace llvm {
 template <class GraphType> struct GraphTraits;
-}
+} // namespace llvm
 
 // This option shows static (relative) call counts.
 // FIXME:
@@ -215,7 +215,7 @@ struct DOTGraphTraits<CallGraphDOTInfo *> : public DefaultDOTGraphTraits {
   }
 };
 
-} // end llvm namespace
+} // namespace llvm
 
 namespace {
 void doCallGraphDOTPrinting(

diff  --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp
index 7f8f7b26f8fe5..d8ca4a60cfbd4 100644
--- a/llvm/lib/Analysis/CaptureTracking.cpp
+++ b/llvm/lib/Analysis/CaptureTracking.cpp
@@ -72,127 +72,127 @@ bool CaptureTracker::isDereferenceableOrNull(Value *O, const DataLayout &DL) {
 }
 
 namespace {
-  struct SimpleCaptureTracker : public CaptureTracker {
-    explicit SimpleCaptureTracker(bool ReturnCaptures)
-        : ReturnCaptures(ReturnCaptures) {}
+struct SimpleCaptureTracker : public CaptureTracker {
+  explicit SimpleCaptureTracker(bool ReturnCaptures)
+      : ReturnCaptures(ReturnCaptures) {}
 
-    void tooManyUses() override {
-      LLVM_DEBUG(dbgs() << "Captured due to too many uses\n");
-      Captured = true;
-    }
+  void tooManyUses() override {
+    LLVM_DEBUG(dbgs() << "Captured due to too many uses\n");
+    Captured = true;
+  }
 
-    bool captured(const Use *U) override {
-      if (isa<ReturnInst>(U->getUser()) && !ReturnCaptures)
-        return false;
+  bool captured(const Use *U) override {
+    if (isa<ReturnInst>(U->getUser()) && !ReturnCaptures)
+      return false;
 
-      LLVM_DEBUG(dbgs() << "Captured by: " << *U->getUser() << "\n");
+    LLVM_DEBUG(dbgs() << "Captured by: " << *U->getUser() << "\n");
 
-      Captured = true;
-      return true;
-    }
+    Captured = true;
+    return true;
+  }
 
-    bool ReturnCaptures;
+  bool ReturnCaptures;
 
-    bool Captured = false;
-  };
+  bool Captured = false;
+};
 
-  /// Only find pointer captures which happen before the given instruction. Uses
-  /// the dominator tree to determine whether one instruction is before another.
-  /// Only support the case where the Value is defined in the same basic block
-  /// as the given instruction and the use.
-  struct CapturesBefore : public CaptureTracker {
+/// Only find pointer captures which happen before the given instruction. Uses
+/// the dominator tree to determine whether one instruction is before another.
+/// Only support the case where the Value is defined in the same basic block
+/// as the given instruction and the use.
+struct CapturesBefore : public CaptureTracker {
 
-    CapturesBefore(bool ReturnCaptures, const Instruction *I,
-                   const DominatorTree *DT, bool IncludeI, const LoopInfo *LI)
-        : BeforeHere(I), DT(DT), ReturnCaptures(ReturnCaptures),
-          IncludeI(IncludeI), LI(LI) {}
+  CapturesBefore(bool ReturnCaptures, const Instruction *I,
+                 const DominatorTree *DT, bool IncludeI, const LoopInfo *LI)
+      : BeforeHere(I), DT(DT), ReturnCaptures(ReturnCaptures),
+        IncludeI(IncludeI), LI(LI) {}
 
-    void tooManyUses() override { Captured = true; }
+  void tooManyUses() override { Captured = true; }
 
-    bool isSafeToPrune(Instruction *I) {
-      if (BeforeHere == I)
-        return !IncludeI;
+  bool isSafeToPrune(Instruction *I) {
+    if (BeforeHere == I)
+      return !IncludeI;
 
-      // We explore this usage only if the usage can reach "BeforeHere".
-      // If use is not reachable from entry, there is no need to explore.
-      if (!DT->isReachableFromEntry(I->getParent()))
-        return true;
+    // We explore this usage only if the usage can reach "BeforeHere".
+    // If use is not reachable from entry, there is no need to explore.
+    if (!DT->isReachableFromEntry(I->getParent()))
+      return true;
 
-      // Check whether there is a path from I to BeforeHere.
-      return !isPotentiallyReachable(I, BeforeHere, nullptr, DT, LI);
-    }
+    // Check whether there is a path from I to BeforeHere.
+    return !isPotentiallyReachable(I, BeforeHere, nullptr, DT, LI);
+  }
 
-    bool captured(const Use *U) override {
-      Instruction *I = cast<Instruction>(U->getUser());
-      if (isa<ReturnInst>(I) && !ReturnCaptures)
-        return false;
+  bool captured(const Use *U) override {
+    Instruction *I = cast<Instruction>(U->getUser());
+    if (isa<ReturnInst>(I) && !ReturnCaptures)
+      return false;
 
-      // Check isSafeToPrune() here rather than in shouldExplore() to avoid
-      // an expensive reachability query for every instruction we look at.
-      // Instead we only do one for actual capturing candidates.
-      if (isSafeToPrune(I))
-        return false;
+    // Check isSafeToPrune() here rather than in shouldExplore() to avoid
+    // an expensive reachability query for every instruction we look at.
+    // Instead we only do one for actual capturing candidates.
+    if (isSafeToPrune(I))
+      return false;
 
-      Captured = true;
-      return true;
-    }
+    Captured = true;
+    return true;
+  }
 
-    const Instruction *BeforeHere;
-    const DominatorTree *DT;
+  const Instruction *BeforeHere;
+  const DominatorTree *DT;
 
-    bool ReturnCaptures;
-    bool IncludeI;
+  bool ReturnCaptures;
+  bool IncludeI;
 
-    bool Captured = false;
+  bool Captured = false;
 
-    const LoopInfo *LI;
-  };
+  const LoopInfo *LI;
+};
 
-  /// Find the 'earliest' instruction before which the pointer is known not to
-  /// be captured. Here an instruction A is considered earlier than instruction
-  /// B, if A dominates B. If 2 escapes do not dominate each other, the
-  /// terminator of the common dominator is chosen. If not all uses cannot be
-  /// analyzed, the earliest escape is set to the first instruction in the
-  /// function entry block.
-  // NOTE: Users have to make sure instructions compared against the earliest
-  // escape are not in a cycle.
-  struct EarliestCaptures : public CaptureTracker {
-
-    EarliestCaptures(bool ReturnCaptures, Function &F, const DominatorTree &DT)
-        : DT(DT), ReturnCaptures(ReturnCaptures), F(F) {}
-
-    void tooManyUses() override {
-      Captured = true;
-      EarliestCapture = &*F.getEntryBlock().begin();
-    }
+/// Find the 'earliest' instruction before which the pointer is known not to
+/// be captured. Here an instruction A is considered earlier than instruction
+/// B, if A dominates B. If 2 escapes do not dominate each other, the
+/// terminator of the common dominator is chosen. If not all uses cannot be
+/// analyzed, the earliest escape is set to the first instruction in the
+/// function entry block.
+// NOTE: Users have to make sure instructions compared against the earliest
+// escape are not in a cycle.
+struct EarliestCaptures : public CaptureTracker {
 
-    bool captured(const Use *U) override {
-      Instruction *I = cast<Instruction>(U->getUser());
-      if (isa<ReturnInst>(I) && !ReturnCaptures)
-        return false;
+  EarliestCaptures(bool ReturnCaptures, Function &F, const DominatorTree &DT)
+      : DT(DT), ReturnCaptures(ReturnCaptures), F(F) {}
 
-      if (!EarliestCapture)
-        EarliestCapture = I;
-      else
-        EarliestCapture = DT.findNearestCommonDominator(EarliestCapture, I);
-      Captured = true;
+  void tooManyUses() override {
+    Captured = true;
+    EarliestCapture = &*F.getEntryBlock().begin();
+  }
 
-      // Return false to continue analysis; we need to see all potential
-      // captures.
+  bool captured(const Use *U) override {
+    Instruction *I = cast<Instruction>(U->getUser());
+    if (isa<ReturnInst>(I) && !ReturnCaptures)
       return false;
-    }
 
-    Instruction *EarliestCapture = nullptr;
+    if (!EarliestCapture)
+      EarliestCapture = I;
+    else
+      EarliestCapture = DT.findNearestCommonDominator(EarliestCapture, I);
+    Captured = true;
 
-    const DominatorTree &DT;
+    // Return false to continue analysis; we need to see all potential
+    // captures.
+    return false;
+  }
 
-    bool ReturnCaptures;
+  Instruction *EarliestCapture = nullptr;
 
-    bool Captured = false;
+  const DominatorTree &DT;
 
-    Function &F;
-  };
-}
+  bool ReturnCaptures;
+
+  bool Captured = false;
+
+  Function &F;
+};
+} // namespace
 
 /// PointerMayBeCaptured - Return true if this pointer value may be captured
 /// by the enclosing function (which is required to exist).  This routine can

diff  --git a/llvm/lib/Analysis/CycleAnalysis.cpp b/llvm/lib/Analysis/CycleAnalysis.cpp
index 41a95a4fa220c..4d7980af2beae 100644
--- a/llvm/lib/Analysis/CycleAnalysis.cpp
+++ b/llvm/lib/Analysis/CycleAnalysis.cpp
@@ -15,7 +15,7 @@ using namespace llvm;
 
 namespace llvm {
 class Module;
-}
+} // namespace llvm
 
 CycleInfo CycleAnalysis::run(Function &F, FunctionAnalysisManager &) {
   CycleInfo CI;

diff  --git a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
index e27db66710a1b..6d6ec6c7b1cc7 100644
--- a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
+++ b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
@@ -39,7 +39,7 @@ cl::opt<unsigned> MediumBasicBlockInstructionThreshold(
     "medium-basic-block-instruction-threshold", cl::Hidden, cl::init(15),
     cl::desc("The minimum number of instructions a basic block should contain "
              "before being considered medium-sized."));
-}
+} // namespace llvm
 
 static cl::opt<unsigned> CallWithManyArgumentsThreshold(
     "call-with-many-arguments-threshold", cl::Hidden, cl::init(4),

diff  --git a/llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp b/llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp
index 279f76da4d1d9..6667affbc0e33 100644
--- a/llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp
+++ b/llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp
@@ -32,7 +32,7 @@ cl::opt<InlinerFunctionImportStatsOpts> InlinerFunctionImportStats(
                clEnumValN(InlinerFunctionImportStatsOpts::Verbose, "verbose",
                           "printing of statistics for each inlined function")),
     cl::Hidden, cl::desc("Enable inliner stats for imported functions"));
-}
+} // namespace llvm
 
 ImportedFunctionsInliningStatistics::InlineGraphNode &
 ImportedFunctionsInliningStatistics::createInlineGraphNode(const Function &F) {

diff  --git a/llvm/lib/Analysis/InlineAdvisor.cpp b/llvm/lib/Analysis/InlineAdvisor.cpp
index e2480d51d372b..71dfcbc9b7bb7 100644
--- a/llvm/lib/Analysis/InlineAdvisor.cpp
+++ b/llvm/lib/Analysis/InlineAdvisor.cpp
@@ -64,7 +64,7 @@ static cl::opt<bool>
 
 namespace llvm {
 extern cl::opt<InlinerFunctionImportStatsOpts> InlinerFunctionImportStats;
-}
+} // namespace llvm
 
 namespace {
 using namespace llvm::ore;

diff  --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index aaa7baa3b114a..f10b2bc06746a 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -60,8 +60,10 @@ INITIALIZE_PASS_END(LazyValueInfoWrapperPass, "lazy-value-info",
                 "Lazy Value Information Analysis", false, true)
 
 namespace llvm {
-  FunctionPass *createLazyValueInfoPass() { return new LazyValueInfoWrapperPass(); }
+FunctionPass *createLazyValueInfoPass() {
+  return new LazyValueInfoWrapperPass();
 }
+} // namespace llvm
 
 AnalysisKey LazyValueAnalysis::Key;
 
@@ -151,114 +153,113 @@ namespace {
 } // end anonymous namespace
 
 namespace {
-  using NonNullPointerSet = SmallDenseSet<AssertingVH<Value>, 2>;
-
-  /// This is the cache kept by LazyValueInfo which
-  /// maintains information about queries across the clients' queries.
-  class LazyValueInfoCache {
-    /// This is all of the cached information for one basic block. It contains
-    /// the per-value lattice elements, as well as a separate set for
-    /// overdefined values to reduce memory usage. Additionally pointers
-    /// dereferenced in the block are cached for nullability queries.
-    struct BlockCacheEntry {
-      SmallDenseMap<AssertingVH<Value>, ValueLatticeElement, 4> LatticeElements;
-      SmallDenseSet<AssertingVH<Value>, 4> OverDefined;
-      // std::nullopt indicates that the nonnull pointers for this basic block
-      // block have not been computed yet.
-      std::optional<NonNullPointerSet> NonNullPointers;
-    };
-
-    /// Cached information per basic block.
-    DenseMap<PoisoningVH<BasicBlock>, std::unique_ptr<BlockCacheEntry>>
-        BlockCache;
-    /// Set of value handles used to erase values from the cache on deletion.
-    DenseSet<LVIValueHandle, DenseMapInfo<Value *>> ValueHandles;
-
-    const BlockCacheEntry *getBlockEntry(BasicBlock *BB) const {
-      auto It = BlockCache.find_as(BB);
-      if (It == BlockCache.end())
-        return nullptr;
-      return It->second.get();
-    }
+using NonNullPointerSet = SmallDenseSet<AssertingVH<Value>, 2>;
+
+/// This is the cache kept by LazyValueInfo which
+/// maintains information about queries across the clients' queries.
+class LazyValueInfoCache {
+  /// This is all of the cached information for one basic block. It contains
+  /// the per-value lattice elements, as well as a separate set for
+  /// overdefined values to reduce memory usage. Additionally pointers
+  /// dereferenced in the block are cached for nullability queries.
+  struct BlockCacheEntry {
+    SmallDenseMap<AssertingVH<Value>, ValueLatticeElement, 4> LatticeElements;
+    SmallDenseSet<AssertingVH<Value>, 4> OverDefined;
+    // std::nullopt indicates that the nonnull pointers for this basic block
+    // block have not been computed yet.
+    std::optional<NonNullPointerSet> NonNullPointers;
+  };
 
-    BlockCacheEntry *getOrCreateBlockEntry(BasicBlock *BB) {
-      auto It = BlockCache.find_as(BB);
-      if (It == BlockCache.end())
-        It = BlockCache.insert({ BB, std::make_unique<BlockCacheEntry>() })
-                       .first;
+  /// Cached information per basic block.
+  DenseMap<PoisoningVH<BasicBlock>, std::unique_ptr<BlockCacheEntry>>
+      BlockCache;
+  /// Set of value handles used to erase values from the cache on deletion.
+  DenseSet<LVIValueHandle, DenseMapInfo<Value *>> ValueHandles;
+
+  const BlockCacheEntry *getBlockEntry(BasicBlock *BB) const {
+    auto It = BlockCache.find_as(BB);
+    if (It == BlockCache.end())
+      return nullptr;
+    return It->second.get();
+  }
 
-      return It->second.get();
-    }
+  BlockCacheEntry *getOrCreateBlockEntry(BasicBlock *BB) {
+    auto It = BlockCache.find_as(BB);
+    if (It == BlockCache.end())
+      It = BlockCache.insert({BB, std::make_unique<BlockCacheEntry>()}).first;
 
-    void addValueHandle(Value *Val) {
-      auto HandleIt = ValueHandles.find_as(Val);
-      if (HandleIt == ValueHandles.end())
-        ValueHandles.insert({ Val, this });
-    }
+    return It->second.get();
+  }
 
-  public:
-    void insertResult(Value *Val, BasicBlock *BB,
-                      const ValueLatticeElement &Result) {
-      BlockCacheEntry *Entry = getOrCreateBlockEntry(BB);
+  void addValueHandle(Value *Val) {
+    auto HandleIt = ValueHandles.find_as(Val);
+    if (HandleIt == ValueHandles.end())
+      ValueHandles.insert({Val, this});
+  }
 
-      // Insert over-defined values into their own cache to reduce memory
-      // overhead.
-      if (Result.isOverdefined())
-        Entry->OverDefined.insert(Val);
-      else
-        Entry->LatticeElements.insert({ Val, Result });
+public:
+  void insertResult(Value *Val, BasicBlock *BB,
+                    const ValueLatticeElement &Result) {
+    BlockCacheEntry *Entry = getOrCreateBlockEntry(BB);
+
+    // Insert over-defined values into their own cache to reduce memory
+    // overhead.
+    if (Result.isOverdefined())
+      Entry->OverDefined.insert(Val);
+    else
+      Entry->LatticeElements.insert({Val, Result});
+
+    addValueHandle(Val);
+  }
 
-      addValueHandle(Val);
-    }
+  std::optional<ValueLatticeElement> getCachedValueInfo(Value *V,
+                                                        BasicBlock *BB) const {
+    const BlockCacheEntry *Entry = getBlockEntry(BB);
+    if (!Entry)
+      return std::nullopt;
 
-    std::optional<ValueLatticeElement>
-    getCachedValueInfo(Value *V, BasicBlock *BB) const {
-      const BlockCacheEntry *Entry = getBlockEntry(BB);
-      if (!Entry)
-        return std::nullopt;
+    if (Entry->OverDefined.count(V))
+      return ValueLatticeElement::getOverdefined();
 
-      if (Entry->OverDefined.count(V))
-        return ValueLatticeElement::getOverdefined();
+    auto LatticeIt = Entry->LatticeElements.find_as(V);
+    if (LatticeIt == Entry->LatticeElements.end())
+      return std::nullopt;
 
-      auto LatticeIt = Entry->LatticeElements.find_as(V);
-      if (LatticeIt == Entry->LatticeElements.end())
-        return std::nullopt;
+    return LatticeIt->second;
+  }
 
-      return LatticeIt->second;
+  bool
+  isNonNullAtEndOfBlock(Value *V, BasicBlock *BB,
+                        function_ref<NonNullPointerSet(BasicBlock *)> InitFn) {
+    BlockCacheEntry *Entry = getOrCreateBlockEntry(BB);
+    if (!Entry->NonNullPointers) {
+      Entry->NonNullPointers = InitFn(BB);
+      for (Value *V : *Entry->NonNullPointers)
+        addValueHandle(V);
     }
 
-    bool isNonNullAtEndOfBlock(
-        Value *V, BasicBlock *BB,
-        function_ref<NonNullPointerSet(BasicBlock *)> InitFn) {
-      BlockCacheEntry *Entry = getOrCreateBlockEntry(BB);
-      if (!Entry->NonNullPointers) {
-        Entry->NonNullPointers = InitFn(BB);
-        for (Value *V : *Entry->NonNullPointers)
-          addValueHandle(V);
-      }
-
-      return Entry->NonNullPointers->count(V);
-    }
+    return Entry->NonNullPointers->count(V);
+  }
 
-    /// clear - Empty the cache.
-    void clear() {
-      BlockCache.clear();
-      ValueHandles.clear();
-    }
+  /// clear - Empty the cache.
+  void clear() {
+    BlockCache.clear();
+    ValueHandles.clear();
+  }
 
-    /// Inform the cache that a given value has been deleted.
-    void eraseValue(Value *V);
+  /// Inform the cache that a given value has been deleted.
+  void eraseValue(Value *V);
 
-    /// This is part of the update interface to inform the cache
-    /// that a block has been deleted.
-    void eraseBlock(BasicBlock *BB);
+  /// This is part of the update interface to inform the cache
+  /// that a block has been deleted.
+  void eraseBlock(BasicBlock *BB);
 
-    /// Updates the cache to remove any influence an overdefined value in
-    /// OldSucc might have (unless also overdefined in NewSucc).  This just
-    /// flushes elements from the cache and does not add any.
-    void threadEdgeImpl(BasicBlock *OldSucc,BasicBlock *NewSucc);
-  };
-}
+  /// Updates the cache to remove any influence an overdefined value in
+  /// OldSucc might have (unless also overdefined in NewSucc).  This just
+  /// flushes elements from the cache and does not add any.
+  void threadEdgeImpl(BasicBlock *OldSucc, BasicBlock *NewSucc);
+};
+} // namespace
 
 void LazyValueInfoCache::eraseValue(Value *V) {
   for (auto &Pair : BlockCache) {

diff  --git a/llvm/lib/Analysis/LoopAnalysisManager.cpp b/llvm/lib/Analysis/LoopAnalysisManager.cpp
index 74b1da86eb28d..74c318ee5b975 100644
--- a/llvm/lib/Analysis/LoopAnalysisManager.cpp
+++ b/llvm/lib/Analysis/LoopAnalysisManager.cpp
@@ -133,7 +133,7 @@ LoopAnalysisManagerFunctionProxy::run(Function &F,
                                       FunctionAnalysisManager &AM) {
   return Result(*InnerAM, AM.getResult<LoopAnalysis>(F));
 }
-}
+} // namespace llvm
 
 PreservedAnalyses llvm::getLoopPassPreservedAnalyses() {
   PreservedAnalyses PA;

diff  --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index 61d3a270d6538..2159c45a8e5c5 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/lib/Analysis/LoopPass.cpp
@@ -59,7 +59,7 @@ class PrintLoopPassWrapper : public LoopPass {
 };
 
 char PrintLoopPassWrapper::ID = 0;
-}
+} // namespace
 
 //===----------------------------------------------------------------------===//
 // LPPassManager

diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 2802de640cdac..b2cb672e305c3 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -13689,7 +13689,7 @@ raw_ostream &operator<<(raw_ostream &OS, ScalarEvolution::BlockDisposition BD) {
   }
   return OS;
 }
-}
+} // namespace llvm
 
 void ScalarEvolution::print(raw_ostream &OS) const {
   // ScalarEvolution's implementation of the print method is to print

diff  --git a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
index e1dd834cfb100..d03930d9e2d99 100644
--- a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
@@ -21,7 +21,7 @@
 
 namespace llvm {
 class Type;
-}
+} // namespace llvm
 
 using namespace llvm;
 


        


More information about the llvm-commits mailing list