<div dir="ltr">This seems unfortunate and not consistent with LLVM or general C++ style - if these types are only in the .cpp file they really should be in anonymous namespaces. ( <a href="https://llvm.org/docs/CodingStandards.html#anonymous-namespaces">https://llvm.org/docs/CodingStandards.html#anonymous-namespaces</a> ) - could you describe in more detail what motivated this change?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 31, 2022 at 11:11 PM Johannes Doerfert via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Johannes Doerfert<br>
Date: 2022-02-01T01:07:50-06:00<br>
New Revision: a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/a5b6aef24e7a3f2a74cc4e716314d3f8d424d1c1.diff</a><br>
<br>
LOG: [Attributor][NFCI] Remove anonymous namespaces<br>
<br>
The namespaces made it more complicate to implement static helpers,<br>
among other things. We should not need them at all.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp<br>
index 76420783b2d1..ea3f449b649a 100644<br>
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp<br>
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp<br>
@@ -1026,7 +1026,6 @@ struct AA::PointerInfo::State : public AbstractState {<br>
   BooleanState BS;<br>
 };<br>
<br>
-namespace {<br>
 struct AAPointerInfoImpl<br>
     : public StateWrapper<AA::PointerInfo::State, AAPointerInfo> {<br>
   using BaseTy = StateWrapper<AA::PointerInfo::State, AAPointerInfo>;<br>
@@ -5085,7 +5084,6 @@ struct AANoCaptureCallSiteReturned final : AANoCaptureImpl {<br>
     STATS_DECLTRACK_CSRET_ATTR(nocapture)<br>
   }<br>
 };<br>
-} // namespace<br>
<br>
 /// ------------------ Value Simplify Attribute ----------------------------<br>
<br>
@@ -5106,7 +5104,6 @@ bool ValueSimplifyStateType::unionAssumed(Optional<Value *> Other) {<br>
   return true;<br>
 }<br>
<br>
-namespace {<br>
 struct AAValueSimplifyImpl : AAValueSimplify {<br>
   AAValueSimplifyImpl(const IRPosition &IRP, Attributor &A)<br>
       : AAValueSimplify(IRP, A) {}<br>
@@ -7378,7 +7375,6 @@ void AAMemoryBehaviorFloating::analyzeUseIn(Attributor &A, const Use &U,<br>
   if (UserI->mayWriteToMemory())<br>
     removeAssumedBits(NO_WRITES);<br>
 }<br>
-} // namespace<br>
<br>
 /// -------------------- Memory Locations Attributes ---------------------------<br>
 /// Includes read-none, argmemonly, inaccessiblememonly,<br>
@@ -7412,7 +7408,6 @@ std::string AAMemoryLocation::getMemoryLocationsAsStr(<br>
   return S;<br>
 }<br>
<br>
-namespace {<br>
 struct AAMemoryLocationImpl : public AAMemoryLocation {<br>
<br>
   AAMemoryLocationImpl(const IRPosition &IRP, Attributor &A)<br>
@@ -9790,8 +9785,6 @@ struct AAAssumptionInfoCallSite final : AAAssumptionInfoImpl {<br>
   }<br>
 };<br>
<br>
-} // namespace<br>
-<br>
 AACallGraphNode *AACallEdgeIterator::operator*() const {<br>
   return static_cast<AACallGraphNode *>(const_cast<AACallEdges *>(<br>
       &A.getOrCreateAAFor<AACallEdges>(IRPosition::function(**I))));<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>