Skip to content

Commit

Permalink
[AA] Remove unused template argument from AAResultBase (NFC)
Browse files Browse the repository at this point in the history
After D94363, there is no more need to use CRTP here.
  • Loading branch information
nikic committed Oct 6, 2022
1 parent 86e23c4 commit 3d0b5f0
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 32 deletions.
12 changes: 5 additions & 7 deletions llvm/include/llvm/Analysis/AliasAnalysis.h
Expand Up @@ -897,7 +897,7 @@ class AAResults {

template <typename T> class Model;

template <typename T> friend class AAResultBase;
friend class AAResultBase;

const TargetLibraryInfo &TLI;

Expand Down Expand Up @@ -1078,20 +1078,18 @@ 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
/// implement the remaining portions of the interface in terms of simpler forms
/// 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;

Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/Analysis/BasicAliasAnalysis.h
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h
Expand Up @@ -35,9 +35,7 @@ struct AliasSummary;

} // end namespace cflaa

class CFLAndersAAResult : public AAResultBase<CFLAndersAAResult> {
friend AAResultBase<CFLAndersAAResult>;

class CFLAndersAAResult : public AAResultBase {
class FunctionInfo;

public:
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h
Expand Up @@ -34,9 +34,7 @@ struct AliasSummary;

} // end namespace cflaa

class CFLSteensAAResult : public AAResultBase<CFLSteensAAResult> {
friend AAResultBase<CFLSteensAAResult>;

class CFLSteensAAResult : public AAResultBase {
class FunctionInfo;

public:
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/Analysis/GlobalsModRef.h
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/Analysis/ScopedNoAliasAA.h
Expand Up @@ -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.
///
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
Expand Up @@ -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.
///
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
Expand Up @@ -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:
Expand Down

0 comments on commit 3d0b5f0

Please sign in to comment.