For PR387:\

Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18589 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2004-12-07 04:03:45 +00:00
parent ead87b6712
commit ce9653ce44
25 changed files with 35 additions and 36 deletions

View File

@@ -114,7 +114,7 @@ public:
/// print - Convert to human readable form /// print - Convert to human readable form
/// ///
virtual void print(std::ostream &OS) const; virtual void print(std::ostream &OS, const Module* = 0) const;
}; };
//===------------------------------------- //===-------------------------------------
@@ -218,7 +218,7 @@ public:
/// print - Convert to human readable form /// print - Convert to human readable form
/// ///
virtual void print(std::ostream &OS) const; virtual void print(std::ostream &OS, const Module* = 0) const;
/// dominates - Return true if A dominates B. This performs the special /// dominates - Return true if A dominates B. This performs the special
/// checks necessary if A and B are in the same basic block. /// checks necessary if A and B are in the same basic block.
@@ -375,7 +375,7 @@ public:
/// print - Convert to human readable form /// print - Convert to human readable form
/// ///
virtual void print(std::ostream &OS) const; virtual void print(std::ostream &OS, const Module* = 0) const;
}; };
@@ -475,7 +475,7 @@ public:
/// print - Convert to human readable form /// print - Convert to human readable form
/// ///
virtual void print(std::ostream &OS) const; virtual void print(std::ostream &OS, const Module* = 0) const;
}; };

View File

@@ -60,7 +60,7 @@ public:
~IntervalPartition() { destroy(); } ~IntervalPartition() { destroy(); }
// print - Show contents in human readable format... // print - Show contents in human readable format...
virtual void print(std::ostream &O) const; virtual void print(std::ostream &O, const Module* = 0) const;
// getRootInterval() - Return the root interval that contains the starting // getRootInterval() - Return the root interval that contains the starting
// block of the function. // block of the function.

View File

@@ -241,7 +241,7 @@ public:
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
virtual void releaseMemory(); virtual void releaseMemory();
void print(std::ostream &O) const; void print(std::ostream &O, const Module* = 0) const;
/// getAnalysisUsage - Requires dominator sets /// getAnalysisUsage - Requires dominator sets
/// ///

View File

@@ -202,7 +202,7 @@ namespace llvm {
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
virtual void releaseMemory(); virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const; virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual void print(std::ostream &OS) const; virtual void print(std::ostream &OS, const Module* = 0) const;
}; };
} }

View File

@@ -128,7 +128,7 @@ namespace llvm {
virtual bool runOnMachineFunction(MachineFunction&); virtual bool runOnMachineFunction(MachineFunction&);
/// print - Implement the dump method. /// print - Implement the dump method.
virtual void print(std::ostream &O) const; virtual void print(std::ostream &O, const Module* = 0) const;
private: private:
/// computeIntervals - compute live intervals /// computeIntervals - compute live intervals

View File

@@ -96,8 +96,7 @@ public:
/// provide the Module* in case the analysis doesn't need it it can just be /// provide the Module* in case the analysis doesn't need it it can just be
/// ignored. /// ignored.
/// ///
virtual void print(std::ostream &O, const Module *M) const { print(O); } virtual void print(std::ostream &O, const Module *M) const;
virtual void print(std::ostream &O) const;
void dump() const; // dump - call print(std::cerr, 0); void dump() const; // dump - call print(std::cerr, 0);

View File

@@ -539,7 +539,7 @@ namespace {
} }
/// print - Convert to human readable form /// print - Convert to human readable form
virtual void print(std::ostream &OS) const { virtual void print(std::ostream &OS, const Module* = 0) const {
Tracker->print(OS); Tracker->print(OS);
} }

View File

@@ -101,7 +101,7 @@ namespace {
return false; return false;
} }
void print(std::ostream &OS) const {} void print(std::ostream &OS, const Module* = 0) const {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
@@ -119,7 +119,7 @@ namespace {
CFGOnly = OldCFGOnly; CFGOnly = OldCFGOnly;
return false; return false;
} }
void print(std::ostream &OS) const {} void print(std::ostream &OS, const Module* = 0) const {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();

View File

@@ -57,7 +57,7 @@ namespace {
void visitStore(StoreInst &SI); void visitStore(StoreInst &SI);
/// Debugging support methods /// Debugging support methods
void print(std::ostream &O) const { } void print(std::ostream &O, const Module* = 0) const { }
}; };
static RegisterAnalysis<DSGraphStats> Z("dsstats", "DS Graph Statistics"); static RegisterAnalysis<DSGraphStats> Z("dsstats", "DS Graph Statistics");

View File

@@ -424,7 +424,7 @@ void IPModRef::getAnalysisUsage(AnalysisUsage &AU) const {
} }
void IPModRef::print(std::ostream &O) const void IPModRef::print(std::ostream &O, const Module*) const
{ {
O << "\nRESULTS OF INTERPROCEDURAL MOD/REF ANALYSIS:\n\n"; O << "\nRESULTS OF INTERPROCEDURAL MOD/REF ANALYSIS:\n\n";

View File

@@ -213,7 +213,7 @@ public:
// Debugging support methods // Debugging support methods
// //
void print(std::ostream &O) const; void print(std::ostream &O, const Module* = 0) const;
void dump() const; void dump() const;
/// releaseMemory - Release memory held by this pass when the pass pipeline is /// releaseMemory - Release memory held by this pass when the pass pipeline is

View File

@@ -405,7 +405,7 @@ void MemoryDepAnalysis::ProcessSCC(std::vector<BasicBlock*> &S,
/// Debugging support methods /// Debugging support methods
/// ///
void MemoryDepAnalysis::print(std::ostream &O) const void MemoryDepAnalysis::print(std::ostream &O, const Module*) const
{ {
// TEMPORARY LOOP // TEMPORARY LOOP
for (hash_map<Function*, DependenceGraph*>::const_iterator for (hash_map<Function*, DependenceGraph*>::const_iterator

View File

@@ -94,7 +94,7 @@ public:
/// Debugging support methods /// Debugging support methods
/// ///
void print(std::ostream &O) const; void print(std::ostream &O, const Module* = 0) const;
void dump() const; void dump() const;
}; };

View File

@@ -222,7 +222,7 @@ void PgmDependenceGraph::printOutgoingSSADeps(Instruction& I,
} }
void PgmDependenceGraph::print(std::ostream &O) const void PgmDependenceGraph::print(std::ostream &O, const Module*) const
{ {
MemoryDepAnalysis& graphSet = getAnalysis<MemoryDepAnalysis>(); MemoryDepAnalysis& graphSet = getAnalysis<MemoryDepAnalysis>();

View File

@@ -292,7 +292,7 @@ public:
/// Debugging support methods /// Debugging support methods
/// ///
void print(std::ostream &O) const; void print(std::ostream &O, const Module* = 0) const;
void dump() const; void dump() const;
}; };

View File

@@ -37,7 +37,7 @@ namespace {
struct CFGSCC : public FunctionPass { struct CFGSCC : public FunctionPass {
bool runOnFunction(Function& func); bool runOnFunction(Function& func);
void print(std::ostream &O) const { } void print(std::ostream &O, const Module* = 0) const { }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
@@ -48,7 +48,7 @@ namespace {
// run - Print out SCCs in the call graph for the specified module. // run - Print out SCCs in the call graph for the specified module.
bool runOnModule(Module &M); bool runOnModule(Module &M);
void print(std::ostream &O) const { } void print(std::ostream &O, const Module* = 0) const { }
// getAnalysisUsage - This pass requires the CallGraph. // getAnalysisUsage - This pass requires the CallGraph.
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {

View File

@@ -32,7 +32,7 @@ void IntervalPartition::destroy() {
RootInterval = 0; RootInterval = 0;
} }
void IntervalPartition::print(std::ostream &O) const { void IntervalPartition::print(std::ostream &O, const Module*) const {
std::copy(Intervals.begin(), Intervals.end(), std::copy(Intervals.begin(), Intervals.end(),
std::ostream_iterator<const Interval *>(O, "\n")); std::ostream_iterator<const Interval *>(O, "\n"));
} }

View File

@@ -119,7 +119,7 @@ void LoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<DominatorSet>(); AU.addRequired<DominatorSet>();
} }
void LoopInfo::print(std::ostream &OS) const { void LoopInfo::print(std::ostream &OS, const Module* ) const {
for (unsigned i = 0; i < TopLevelLoops.size(); ++i) for (unsigned i = 0; i < TopLevelLoops.size(); ++i)
TopLevelLoops[i]->print(OS); TopLevelLoops[i]->print(OS);
#if 0 #if 0

View File

@@ -2326,7 +2326,7 @@ static void PrintLoopInfo(std::ostream &OS, const ScalarEvolution *SE,
std::cerr << "\n"; std::cerr << "\n";
} }
void ScalarEvolution::print(std::ostream &OS) const { void ScalarEvolution::print(std::ostream &OS, const Module* ) const {
Function &F = ((ScalarEvolutionsImpl*)Impl)->F; Function &F = ((ScalarEvolutionsImpl*)Impl)->F;
LoopInfo &LI = ((ScalarEvolutionsImpl*)Impl)->LI; LoopInfo &LI = ((ScalarEvolutionsImpl*)Impl)->LI;

View File

@@ -169,7 +169,7 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
} }
/// print - Implement the dump method. /// print - Implement the dump method.
void LiveIntervals::print(std::ostream &O) const { void LiveIntervals::print(std::ostream &O, const Module* ) const {
O << "********** INTERVALS **********\n"; O << "********** INTERVALS **********\n";
for (const_iterator I = begin(), E = end(); I != E; ++I) for (const_iterator I = begin(), E = end(); I != E; ++I)
O << " " << I->second << "\n"; O << " " << I->second << "\n";

View File

@@ -128,7 +128,7 @@ namespace llvm {
virtual bool runOnMachineFunction(MachineFunction&); virtual bool runOnMachineFunction(MachineFunction&);
/// print - Implement the dump method. /// print - Implement the dump method.
virtual void print(std::ostream &O) const; virtual void print(std::ostream &O, const Module* = 0) const;
private: private:
/// computeIntervals - compute live intervals /// computeIntervals - compute live intervals

View File

@@ -210,7 +210,7 @@ bool ImmediateDominators::runOnFunction(Function &F) {
return false; return false;
} }
void ImmediateDominatorsBase::print(std::ostream &o) const { void ImmediateDominatorsBase::print(std::ostream &o, const Module* ) const {
Function *F = getRoots()[0]->getParent(); Function *F = getRoots()[0]->getParent();
for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) { for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) {
o << " Immediate Dominator For Basic Block:"; o << " Immediate Dominator For Basic Block:";
@@ -313,7 +313,7 @@ static std::ostream &operator<<(std::ostream &o,
} }
} }
void DominatorSetBase::print(std::ostream &o) const { void DominatorSetBase::print(std::ostream &o, const Module* ) const {
for (const_iterator I = begin(), E = end(); I != E; ++I) { for (const_iterator I = begin(), E = end(); I != E; ++I) {
o << " DomSet For BB: "; o << " DomSet For BB: ";
if (I->first) if (I->first)
@@ -408,7 +408,7 @@ static void PrintDomTree(const DominatorTreeBase::Node *N, std::ostream &o,
PrintDomTree(*I, o, Lev+1); PrintDomTree(*I, o, Lev+1);
} }
void DominatorTreeBase::print(std::ostream &o) const { void DominatorTreeBase::print(std::ostream &o, const Module* ) const {
o << "=============================--------------------------------\n" o << "=============================--------------------------------\n"
<< "Inorder Dominator Tree:\n"; << "Inorder Dominator Tree:\n";
PrintDomTree(getRootNode(), o, 1); PrintDomTree(getRootNode(), o, 1);
@@ -455,7 +455,7 @@ DominanceFrontier::calculate(const DominatorTree &DT,
return S; return S;
} }
void DominanceFrontierBase::print(std::ostream &o) const { void DominanceFrontierBase::print(std::ostream &o, const Module* ) const {
for (const_iterator I = begin(), E = end(); I != E; ++I) { for (const_iterator I = begin(), E = end(); I != E; ++I) {
o << " DomFrontier for BB"; o << " DomFrontier for BB";
if (I->first) if (I->first)

View File

@@ -217,7 +217,7 @@ const char *Pass::getPassName() const {
// to print out the contents of an analysis. Otherwise it is not necessary to // to print out the contents of an analysis. Otherwise it is not necessary to
// implement this method. // implement this method.
// //
void Pass::print(std::ostream &O) const { void Pass::print(std::ostream &O,const Module*) const {
O << "Pass::print not implemented for pass: '" << getPassName() << "'!\n"; O << "Pass::print not implemented for pass: '" << getPassName() << "'!\n";
} }

View File

@@ -37,7 +37,7 @@ namespace {
struct CFGSCC : public FunctionPass { struct CFGSCC : public FunctionPass {
bool runOnFunction(Function& func); bool runOnFunction(Function& func);
void print(std::ostream &O) const { } void print(std::ostream &O, const Module* = 0) const { }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
@@ -48,7 +48,7 @@ namespace {
// run - Print out SCCs in the call graph for the specified module. // run - Print out SCCs in the call graph for the specified module.
bool runOnModule(Module &M); bool runOnModule(Module &M);
void print(std::ostream &O) const { } void print(std::ostream &O, const Module* = 0) const { }
// getAnalysisUsage - This pass requires the CallGraph. // getAnalysisUsage - This pass requires the CallGraph.
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {

View File

@@ -37,7 +37,7 @@ namespace {
struct CFGSCC : public FunctionPass { struct CFGSCC : public FunctionPass {
bool runOnFunction(Function& func); bool runOnFunction(Function& func);
void print(std::ostream &O) const { } void print(std::ostream &O, const Module* = 0) const { }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
@@ -48,7 +48,7 @@ namespace {
// run - Print out SCCs in the call graph for the specified module. // run - Print out SCCs in the call graph for the specified module.
bool runOnModule(Module &M); bool runOnModule(Module &M);
void print(std::ostream &O) const { } void print(std::ostream &O, const Module* = 0) const { }
// getAnalysisUsage - This pass requires the CallGraph. // getAnalysisUsage - This pass requires the CallGraph.
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {