1 //===- llvm/PassRegistry.h - Pass Information Registry ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines PassRegistry, a class that is used in the initialization
11 // and registration of passes. At application startup, passes are registered
12 // with the PassRegistry, which is later provided to the PassManager for
13 // dependency resolution and similar tasks.
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_PASSREGISTRY_H
18 #define LLVM_PASSREGISTRY_H
20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/System/DataTypes.h"
26 struct PassRegistrationListener;
28 /// PassRegistry - This class manages the registration and intitialization of
29 /// the pass subsystem as application startup, and assists the PassManager
30 /// in resolving pass dependencies.
31 /// NOTE: PassRegistry is NOT thread-safe. If you want to use LLVM on multiple
32 /// threads simultaneously, you will need to use a separate PassRegistry on
36 void *getImpl() const;
39 static PassRegistry *getPassRegistry();
41 const PassInfo *getPassInfo(const void *TI) const;
42 const PassInfo *getPassInfo(StringRef Arg) const;
44 void registerPass(const PassInfo &PI);
45 void unregisterPass(const PassInfo &PI);
47 /// Analysis Group Mechanisms.
48 void registerAnalysisGroup(const void *InterfaceID, const void *PassID,
49 PassInfo& Registeree, bool isDefault);
51 void enumerateWith(PassRegistrationListener *L);
52 void addRegistrationListener(PassRegistrationListener *L);
53 void removeRegistrationListener(PassRegistrationListener *L);