1 //===- PassManager.cpp - Infrastructure for managing & running IR passes --===//
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 #include "llvm/ADT/STLExtras.h"
11 #include "llvm/IR/LLVMContext.h"
12 #include "llvm/IR/PassManager.h"
15 using llvm::detail::DebugPM;
17 cl::opt<bool> llvm::detail::DebugPM(
18 "debug-pass-manager", cl::Hidden,
19 cl::desc("Print pass management debugging information"));
21 char FunctionAnalysisManagerModuleProxy::PassID;
23 FunctionAnalysisManagerModuleProxy::Result
24 FunctionAnalysisManagerModuleProxy::run(Module &M) {
25 assert(FAM->empty() && "Function analyses ran prior to the module proxy!");
29 FunctionAnalysisManagerModuleProxy::Result::~Result() {
30 // Clear out the analysis manager if we're being destroyed -- it means we
31 // didn't even see an invalidate call when we got invalidated.
35 bool FunctionAnalysisManagerModuleProxy::Result::invalidate(
36 Module &M, const PreservedAnalyses &PA) {
37 // If this proxy isn't marked as preserved, then we can't even invalidate
38 // individual function analyses, there may be an invalid set of Function
39 // objects in the cache making it impossible to incrementally preserve them.
40 // Just clear the entire manager.
41 if (!PA.preserved(ID()))
44 // Return false to indicate that this result is still a valid proxy.
48 char ModuleAnalysisManagerFunctionProxy::PassID;