LLVM 19.0.0git
Static Public Member Functions | List of all members
llvm::AnalysisInfoMixin< DerivedT > Struct Template Reference

A CRTP mix-in that provides informational APIs needed for analysis passes. More...

#include "llvm/IR/PassManager.h"

Inherits llvm::PassInfoMixin< DerivedT >.

Static Public Member Functions

static AnalysisKeyID ()
 Returns an opaque, unique ID for this analysis type.
 
- Static Public Member Functions inherited from llvm::PassInfoMixin< DerivedT >
static StringRef name ()
 Gets the name of the pass we are mixed into.
 

Additional Inherited Members

- Public Member Functions inherited from llvm::PassInfoMixin< DerivedT >
void printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
 

Detailed Description

template<typename DerivedT>
struct llvm::AnalysisInfoMixin< DerivedT >

A CRTP mix-in that provides informational APIs needed for analysis passes.

This provides some boilerplate for types that are analysis passes. It automatically mixes in PassInfoMixin.

Definition at line 97 of file PassManager.h.

Member Function Documentation

◆ ID()

template<typename DerivedT >
static AnalysisKey * llvm::AnalysisInfoMixin< DerivedT >::ID ( )
inlinestatic

Returns an opaque, unique ID for this analysis type.

This ID is a pointer type that is guaranteed to be 8-byte aligned and thus suitable for use in sets, maps, and other data structures that use the low bits of pointers.

Note that this requires the derived type provide a static AnalysisKey member called Key.

FIXME: The only reason the mixin type itself can't declare the Key value is that some compilers cannot correctly unique a templated static variable so it has the same addresses in each instantiation. The only currently known platform with this limitation is Windows DLL builds, specifically building each part of LLVM as a DLL. If we ever remove that build configuration, this mixin can provide the static key as well.

Definition at line 113 of file PassManager.h.


The documentation for this struct was generated from the following file: