[llvm] 3d0b5f0 - [AA] Remove unused template argument from AAResultBase (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 6 01:21:28 PDT 2022
Author: Nikita Popov
Date: 2022-10-06T10:21:17+02:00
New Revision: 3d0b5f019e85eab5e7153516d3f6e9e4f2b9135b
URL: https://github.com/llvm/llvm-project/commit/3d0b5f019e85eab5e7153516d3f6e9e4f2b9135b
DIFF: https://github.com/llvm/llvm-project/commit/3d0b5f019e85eab5e7153516d3f6e9e4f2b9135b.diff
LOG: [AA] Remove unused template argument from AAResultBase (NFC)
After D94363, there is no more need to use CRTP here.
Added:
Modified:
llvm/include/llvm/Analysis/AliasAnalysis.h
llvm/include/llvm/Analysis/BasicAliasAnalysis.h
llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h
llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h
llvm/include/llvm/Analysis/GlobalsModRef.h
llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
llvm/include/llvm/Analysis/ScopedNoAliasAA.h
llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 30db2d81682e..d3b2f1f8b514 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -897,7 +897,7 @@ class AAResults {
template <typename T> class Model;
- template <typename T> friend class AAResultBase;
+ friend class AAResultBase;
const TargetLibraryInfo &TLI;
@@ -1078,8 +1078,7 @@ template <typename AAResultT> class AAResults::Model final : public Concept {
}
};
-/// A CRTP-driven "mixin" base class to help implement the function alias
-/// analysis results concept.
+/// A base class to help implement the function alias analysis results concept.
///
/// Because of the nature of many alias analysis implementations, they often
/// only implement a subset of the interface. This base class will attempt to
@@ -1087,11 +1086,10 @@ template <typename AAResultT> class AAResults::Model final : public Concept {
/// of the interface where possible, and otherwise provide conservatively
/// correct fallback implementations.
///
-/// Implementors of an alias analysis should derive from this CRTP, and then
+/// Implementors of an alias analysis should derive from this class, and then
/// override specific methods that they wish to customize. There is no need to
-/// use virtual anywhere, the CRTP base class does static dispatch to the
-/// derived type passed into it.
-template <typename DerivedT> class AAResultBase {
+/// use virtual anywhere.
+class AAResultBase {
protected:
explicit AAResultBase() = default;
diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
index f58db1902407..0dddddf81764 100644
--- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
@@ -41,9 +41,7 @@ class Value;
/// While it does retain some storage, that is used as an optimization and not
/// to preserve information from query to query. However it does retain handles
/// to various other analyses and must be recomputed when those analyses are.
-class BasicAAResult : public AAResultBase<BasicAAResult> {
- friend AAResultBase<BasicAAResult>;
-
+class BasicAAResult : public AAResultBase {
const DataLayout &DL;
const Function &F;
const TargetLibraryInfo &TLI;
diff --git a/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h b/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h
index dfb363173187..2ad69946905a 100644
--- a/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h
@@ -35,9 +35,7 @@ struct AliasSummary;
} // end namespace cflaa
-class CFLAndersAAResult : public AAResultBase<CFLAndersAAResult> {
- friend AAResultBase<CFLAndersAAResult>;
-
+class CFLAndersAAResult : public AAResultBase {
class FunctionInfo;
public:
diff --git a/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h b/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h
index 865f4a54c094..95f702652fc5 100644
--- a/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h
@@ -34,9 +34,7 @@ struct AliasSummary;
} // end namespace cflaa
-class CFLSteensAAResult : public AAResultBase<CFLSteensAAResult> {
- friend AAResultBase<CFLSteensAAResult>;
-
+class CFLSteensAAResult : public AAResultBase {
class FunctionInfo;
public:
diff --git a/llvm/include/llvm/Analysis/GlobalsModRef.h b/llvm/include/llvm/Analysis/GlobalsModRef.h
index 62095a1d6ad2..4747fb49d343 100644
--- a/llvm/include/llvm/Analysis/GlobalsModRef.h
+++ b/llvm/include/llvm/Analysis/GlobalsModRef.h
@@ -27,9 +27,7 @@ class Function;
///
/// This focuses on handling aliasing properties of globals and interprocedural
/// function call mod/ref information.
-class GlobalsAAResult : public AAResultBase<GlobalsAAResult> {
- friend AAResultBase<GlobalsAAResult>;
-
+class GlobalsAAResult : public AAResultBase {
class FunctionInfo;
const DataLayout &DL;
diff --git a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
index d19a6394bd48..7b81e910546d 100644
--- a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
@@ -34,9 +34,7 @@ namespace objcarc {
/// TODO: This class could be generalized to know about other ObjC-specific
/// tricks. Such as knowing that ivars in the non-fragile ABI are non-aliasing
/// even though their offsets are dynamic.
-class ObjCARCAAResult : public AAResultBase<ObjCARCAAResult> {
- friend AAResultBase<ObjCARCAAResult>;
-
+class ObjCARCAAResult : public AAResultBase {
const DataLayout &DL;
public:
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
index 15e27283021c..7ba62c87505f 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
@@ -24,7 +24,7 @@ class SCEV;
/// A simple alias analysis implementation that uses ScalarEvolution to answer
/// queries.
-class SCEVAAResult : public AAResultBase<SCEVAAResult> {
+class SCEVAAResult : public AAResultBase {
ScalarEvolution &SE;
public:
diff --git a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
index c55228eace4b..e318aa064427 100644
--- a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
+++ b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
@@ -26,9 +26,7 @@ class MDNode;
class MemoryLocation;
/// A simple AA result which uses scoped-noalias metadata to answer queries.
-class ScopedNoAliasAAResult : public AAResultBase<ScopedNoAliasAAResult> {
- friend AAResultBase<ScopedNoAliasAAResult>;
-
+class ScopedNoAliasAAResult : public AAResultBase {
public:
/// Handle invalidation events from the new pass manager.
///
diff --git a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
index dffdc18d9085..e631f1587507 100644
--- a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
@@ -28,9 +28,7 @@ class MDNode;
class MemoryLocation;
/// A simple AA result that uses TBAA metadata to answer queries.
-class TypeBasedAAResult : public AAResultBase<TypeBasedAAResult> {
- friend AAResultBase<TypeBasedAAResult>;
-
+class TypeBasedAAResult : public AAResultBase {
public:
/// Handle invalidation events from the new pass manager.
///
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
index 5ba9b2cd187e..db2372d911b1 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
@@ -20,9 +20,7 @@ class DataLayout;
class MemoryLocation;
/// A simple AA result that uses TBAA metadata to answer queries.
-class AMDGPUAAResult : public AAResultBase<AMDGPUAAResult> {
- friend AAResultBase<AMDGPUAAResult>;
-
+class AMDGPUAAResult : public AAResultBase {
const DataLayout &DL;
public:
More information about the llvm-commits
mailing list