Document that PassManager::add() may delete the pass right away.

Also remove redundant documentation:
- doxygen will copy documentation to overriden methods.
- Use \copydoc on PIMPL classes instead of replicating the text.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224089 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matthias Braun
2014-12-12 01:27:01 +00:00
parent c0100322c8
commit e821037df7
2 changed files with 4 additions and 27 deletions

View File

@ -37,9 +37,10 @@ class PassManagerBase {
public: public:
virtual ~PassManagerBase(); virtual ~PassManagerBase();
/// add - Add a pass to the queue of passes to run. This passes ownership of /// Add a pass to the queue of passes to run. This passes ownership of
/// the Pass to the PassManager. When the PassManager is destroyed, the pass /// the Pass to the PassManager. When the PassManager is destroyed, the pass
/// will be destroyed as well, so there is no need to delete the pass. This /// will be destroyed as well, so there is no need to delete the pass. This
/// may even destroy the pass right away if it is found to be redundant. This
/// implies that all passes MUST be allocated with 'new'. /// implies that all passes MUST be allocated with 'new'.
virtual void add(Pass *P) = 0; virtual void add(Pass *P) = 0;
}; };
@ -51,10 +52,6 @@ public:
PassManager(); PassManager();
~PassManager(); ~PassManager();
/// add - Add a pass to the queue of passes to run. This passes ownership of
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
/// will be destroyed as well, so there is no need to delete the pass. This
/// implies that all passes MUST be allocated with 'new'.
void add(Pass *P) override; void add(Pass *P) override;
/// run - Execute all of the passes scheduled for execution. Keep track of /// run - Execute all of the passes scheduled for execution. Keep track of
@ -75,11 +72,6 @@ public:
explicit FunctionPassManager(Module *M); explicit FunctionPassManager(Module *M);
~FunctionPassManager(); ~FunctionPassManager();
/// add - Add a pass to the queue of passes to run. This passes
/// ownership of the Pass to the PassManager. When the
/// PassManager_X is destroyed, the pass will be destroyed as well, so
/// there is no need to delete the pass.
/// This implies that all passes MUST be allocated with 'new'.
void add(Pass *P) override; void add(Pass *P) override;
/// run - Execute all of the passes scheduled for execution. Keep /// run - Execute all of the passes scheduled for execution. Keep

View File

@ -227,10 +227,7 @@ public:
Pass(PT_PassManager, ID), PMDataManager(), Pass(PT_PassManager, ID), PMDataManager(),
PMTopLevelManager(new FPPassManager()), wasRun(false) {} PMTopLevelManager(new FPPassManager()), wasRun(false) {}
/// add - Add a pass to the queue of passes to run. This passes ownership of /// \copydoc FunctionPassManager::add()
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
/// will be destroyed as well, so there is no need to delete the pass. This
/// implies that all passes MUST be allocated with 'new'.
void add(Pass *P) { void add(Pass *P) {
schedulePass(P); schedulePass(P);
} }
@ -398,10 +395,7 @@ public:
Pass(PT_PassManager, ID), PMDataManager(), Pass(PT_PassManager, ID), PMDataManager(),
PMTopLevelManager(new MPPassManager()) {} PMTopLevelManager(new MPPassManager()) {}
/// add - Add a pass to the queue of passes to run. This passes ownership of /// \copydoc PassManager::add()
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
/// will be destroyed as well, so there is no need to delete the pass. This
/// implies that all passes MUST be allocated with 'new'.
void add(Pass *P) { void add(Pass *P) {
schedulePass(P); schedulePass(P);
} }
@ -1389,11 +1383,6 @@ FunctionPassManager::~FunctionPassManager() {
delete FPM; delete FPM;
} }
/// add - Add a pass to the queue of passes to run. This passes
/// ownership of the Pass to the PassManager. When the
/// PassManager_X is destroyed, the pass will be destroyed as well, so
/// there is no need to delete the pass. (TODO delete passes.)
/// This implies that all passes MUST be allocated with 'new'.
void FunctionPassManager::add(Pass *P) { void FunctionPassManager::add(Pass *P) {
FPM->add(P); FPM->add(P);
} }
@ -1749,10 +1738,6 @@ PassManager::~PassManager() {
delete PM; delete PM;
} }
/// add - Add a pass to the queue of passes to run. This passes ownership of
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
/// will be destroyed as well, so there is no need to delete the pass. This
/// implies that all passes MUST be allocated with 'new'.
void PassManager::add(Pass *P) { void PassManager::add(Pass *P) {
PM->add(P); PM->add(P);
} }