[llvm] a5b6aef - [Attributor][NFCI] Remove anonymous namespaces

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 23:11:41 PST 2022


Author: Johannes Doerfert
Date: 2022-02-01T01:07:50-06:00
New Revision: a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1

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

LOG: [Attributor][NFCI] Remove anonymous namespaces

The namespaces made it more complicate to implement static helpers,
among other things. We should not need them at all.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 76420783b2d1..ea3f449b649a 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -1026,7 +1026,6 @@ struct AA::PointerInfo::State : public AbstractState {
   BooleanState BS;
 };
 
-namespace {
 struct AAPointerInfoImpl
     : public StateWrapper<AA::PointerInfo::State, AAPointerInfo> {
   using BaseTy = StateWrapper<AA::PointerInfo::State, AAPointerInfo>;
@@ -5085,7 +5084,6 @@ struct AANoCaptureCallSiteReturned final : AANoCaptureImpl {
     STATS_DECLTRACK_CSRET_ATTR(nocapture)
   }
 };
-} // namespace
 
 /// ------------------ Value Simplify Attribute ----------------------------
 
@@ -5106,7 +5104,6 @@ bool ValueSimplifyStateType::unionAssumed(Optional<Value *> Other) {
   return true;
 }
 
-namespace {
 struct AAValueSimplifyImpl : AAValueSimplify {
   AAValueSimplifyImpl(const IRPosition &IRP, Attributor &A)
       : AAValueSimplify(IRP, A) {}
@@ -7378,7 +7375,6 @@ void AAMemoryBehaviorFloating::analyzeUseIn(Attributor &A, const Use &U,
   if (UserI->mayWriteToMemory())
     removeAssumedBits(NO_WRITES);
 }
-} // namespace
 
 /// -------------------- Memory Locations Attributes ---------------------------
 /// Includes read-none, argmemonly, inaccessiblememonly,
@@ -7412,7 +7408,6 @@ std::string AAMemoryLocation::getMemoryLocationsAsStr(
   return S;
 }
 
-namespace {
 struct AAMemoryLocationImpl : public AAMemoryLocation {
 
   AAMemoryLocationImpl(const IRPosition &IRP, Attributor &A)
@@ -9790,8 +9785,6 @@ struct AAAssumptionInfoCallSite final : AAAssumptionInfoImpl {
   }
 };
 
-} // namespace
-
 AACallGraphNode *AACallEdgeIterator::operator*() const {
   return static_cast<AACallGraphNode *>(const_cast<AACallEdges *>(
       &A.getOrCreateAAFor<AACallEdges>(IRPosition::function(**I))));


        


More information about the llvm-commits mailing list