[PATCH] D21004: [LegacyPM] Namespace some classes; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 5 14:53:55 PDT 2016
sanjoy created this revision.
sanjoy added reviewers: davide, bogner, mehdi_amini, chandlerc.
sanjoy added a subscriber: llvm-commits.
Herald added subscribers: mcrosier, mehdi_amini.
In a later commit I will include a header that exposes the new
PassManager in LegacyPassManager.cpp, and pushing existing uses of
`legacy::FunctionPassManager` and `legacy::PassManager` to be explicitly
under the `legacy::` namespace will avoid a name collision.
http://reviews.llvm.org/D21004
Files:
lib/IR/LegacyPassManager.cpp
Index: lib/IR/LegacyPassManager.cpp
===================================================================
--- lib/IR/LegacyPassManager.cpp
+++ lib/IR/LegacyPassManager.cpp
@@ -1372,48 +1372,48 @@
// FunctionPassManager implementation
/// Create new Function pass manager
-FunctionPassManager::FunctionPassManager(Module *m) : M(m) {
+legacy::FunctionPassManager::FunctionPassManager(Module *m) : M(m) {
FPM = new FunctionPassManagerImpl();
// FPM is the top level manager.
FPM->setTopLevelManager(FPM);
AnalysisResolver *AR = new AnalysisResolver(*FPM);
FPM->setResolver(AR);
}
-FunctionPassManager::~FunctionPassManager() {
+legacy::FunctionPassManager::~FunctionPassManager() {
delete FPM;
}
-void FunctionPassManager::add(Pass *P) {
+void legacy::FunctionPassManager::add(Pass *P) {
FPM->add(P);
}
/// run - Execute all of the passes scheduled for execution. Keep
/// track of whether any of the passes modifies the function, and if
/// so, return true.
///
-bool FunctionPassManager::run(Function &F) {
+bool legacy::FunctionPassManager::run(Function &F) {
if (std::error_code EC = F.materialize())
report_fatal_error("Error reading bitcode file: " + EC.message());
return FPM->run(F);
}
/// doInitialization - Run all of the initializers for the function passes.
///
-bool FunctionPassManager::doInitialization() {
+bool legacy::FunctionPassManager::doInitialization() {
return FPM->doInitialization(*M);
}
/// doFinalization - Run all of the finalizers for the function passes.
///
-bool FunctionPassManager::doFinalization() {
+bool legacy::FunctionPassManager::doFinalization() {
return FPM->doFinalization(*M);
}
//===----------------------------------------------------------------------===//
-// FunctionPassManagerImpl implementation
+// legacy::FunctionPassManagerImpl implementation
//
bool FunctionPassManagerImpl::doInitialization(Module &M) {
bool Changed = false;
@@ -1717,23 +1717,23 @@
// PassManager implementation
/// Create new pass manager
-PassManager::PassManager() {
+legacy::PassManager::PassManager() {
PM = new PassManagerImpl();
// PM is the top level manager
PM->setTopLevelManager(PM);
}
-PassManager::~PassManager() {
+legacy::PassManager::~PassManager() {
delete PM;
}
-void PassManager::add(Pass *P) {
+void legacy::PassManager::add(Pass *P) {
PM->add(P);
}
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true.
-bool PassManager::run(Module &M) {
+bool legacy::PassManager::run(Module &M) {
return PM->run(M);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21004.59675.patch
Type: text/x-patch
Size: 2659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160605/62fbc040/attachment.bin>
More information about the llvm-commits
mailing list