Skip to content

Commit

Permalink
[C++11] Add 'override' keyword to virtual methods that override their…
Browse files Browse the repository at this point in the history
… base class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202945 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Mar 5, 2014
1 parent a6ace00 commit c37e6c0
Show file tree
Hide file tree
Showing 45 changed files with 252 additions and 254 deletions.
4 changes: 2 additions & 2 deletions include/llvm/Analysis/AliasSetTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ class AliasSetTracker {
/// notified whenever a Value is deleted.
class ASTCallbackVH : public CallbackVH {
AliasSetTracker *AST;
virtual void deleted();
virtual void allUsesReplacedWith(Value *);
void deleted() override;
void allUsesReplacedWith(Value *) override;
public:
ASTCallbackVH(Value *V, AliasSetTracker *AST = 0);
ASTCallbackVH &operator=(Value *V);
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/Analysis/BlockFrequencyInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class BlockFrequencyInfo : public FunctionPass {

~BlockFrequencyInfo();

void getAnalysisUsage(AnalysisUsage &AU) const;
void getAnalysisUsage(AnalysisUsage &AU) const override;

bool runOnFunction(Function &F);
void print(raw_ostream &O, const Module *M) const;
bool runOnFunction(Function &F) override;
void print(raw_ostream &O, const Module *M) const override;
const Function *getFunction() const;
void view() const;

Expand Down
6 changes: 3 additions & 3 deletions include/llvm/Analysis/BranchProbabilityInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class BranchProbabilityInfo : public FunctionPass {
initializeBranchProbabilityInfoPass(*PassRegistry::getPassRegistry());
}

void getAnalysisUsage(AnalysisUsage &AU) const;
bool runOnFunction(Function &F);
void print(raw_ostream &OS, const Module *M = 0) const;
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnFunction(Function &F) override;
void print(raw_ostream &OS, const Module *M = 0) const override;

/// \brief Get an edge's probability, relative to other out-edges of the Src.
///
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/Analysis/CallGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@ class CallGraphWrapperPass : public ModulePass {
// Implementation of the ModulePass interface needed here.
//

virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual bool runOnModule(Module &M);
virtual void releaseMemory();
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnModule(Module &M) override;
void releaseMemory() override;

void print(raw_ostream &o, const Module *) const;
void print(raw_ostream &o, const Module *) const override;
void dump() const;
};

Expand Down
10 changes: 5 additions & 5 deletions include/llvm/Analysis/CallGraphSCCPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class CallGraphSCCPass : public Pass {

/// createPrinterPass - Get a pass that prints the Module
/// corresponding to a CallGraph.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
Pass *createPrinterPass(raw_ostream &O,
const std::string &Banner) const override;

using llvm::Pass::doInitialization;
using llvm::Pass::doFinalization;
Expand Down Expand Up @@ -65,18 +66,17 @@ class CallGraphSCCPass : public Pass {
}

/// Assign pass manager to manager this pass
virtual void assignPassManager(PMStack &PMS,
PassManagerType PMT);
void assignPassManager(PMStack &PMS, PassManagerType PMT) override;

/// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const {
PassManagerType getPotentialPassManagerType() const override {
return PMT_CallGraphPassManager;
}

/// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should
/// always explicitly call the implementation here.
virtual void getAnalysisUsage(AnalysisUsage &Info) const;
void getAnalysisUsage(AnalysisUsage &Info) const override;
};

/// CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
Expand Down
16 changes: 8 additions & 8 deletions include/llvm/Analysis/DOTGraphTraitsPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DOTGraphTraitsViewer : public FunctionPass {
DOTGraphTraitsViewer(StringRef GraphName, char &ID)
: FunctionPass(ID), Name(GraphName) {}

virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
GraphT Graph = AnalysisGraphTraitsT::getGraph(&getAnalysis<AnalysisT>());
std::string GraphName = DOTGraphTraits<GraphT>::getGraphName(Graph);
std::string Title = GraphName + " for '" + F.getName().str() + "' function";
Expand All @@ -45,7 +45,7 @@ class DOTGraphTraitsViewer : public FunctionPass {
return false;
}

virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
Expand All @@ -62,7 +62,7 @@ class DOTGraphTraitsPrinter : public FunctionPass {
DOTGraphTraitsPrinter(StringRef GraphName, char &ID)
: FunctionPass(ID), Name(GraphName) {}

virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
GraphT Graph = AnalysisGraphTraitsT::getGraph(&getAnalysis<AnalysisT>());
std::string Filename = Name + "." + F.getName().str() + ".dot";
std::string ErrorInfo;
Expand All @@ -82,7 +82,7 @@ class DOTGraphTraitsPrinter : public FunctionPass {
return false;
}

virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
Expand All @@ -99,7 +99,7 @@ class DOTGraphTraitsModuleViewer : public ModulePass {
DOTGraphTraitsModuleViewer(StringRef GraphName, char &ID)
: ModulePass(ID), Name(GraphName) {}

virtual bool runOnModule(Module &M) {
bool runOnModule(Module &M) override {
GraphT Graph = AnalysisGraphTraitsT::getGraph(&getAnalysis<AnalysisT>());
std::string Title = DOTGraphTraits<GraphT>::getGraphName(Graph);

Expand All @@ -108,7 +108,7 @@ class DOTGraphTraitsModuleViewer : public ModulePass {
return false;
}

virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
Expand All @@ -125,7 +125,7 @@ class DOTGraphTraitsModulePrinter : public ModulePass {
DOTGraphTraitsModulePrinter(StringRef GraphName, char &ID)
: ModulePass(ID), Name(GraphName) {}

virtual bool runOnModule(Module &M) {
bool runOnModule(Module &M) override {
GraphT Graph = AnalysisGraphTraitsT::getGraph(&getAnalysis<AnalysisT>());
std::string Filename = Name + ".dot";
std::string ErrorInfo;
Expand All @@ -144,7 +144,7 @@ class DOTGraphTraitsModulePrinter : public ModulePass {
return false;
}

virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
Expand Down
28 changes: 14 additions & 14 deletions include/llvm/Analysis/DependenceAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,45 +227,45 @@ namespace llvm {

/// isLoopIndependent - Returns true if this is a loop-independent
/// dependence.
bool isLoopIndependent() const { return LoopIndependent; }
bool isLoopIndependent() const override { return LoopIndependent; }

/// isConfused - Returns true if this dependence is confused
/// (the compiler understands nothing and makes worst-case
/// assumptions).
bool isConfused() const { return false; }
bool isConfused() const override { return false; }

/// isConsistent - Returns true if this dependence is consistent
/// (occurs every time the source and destination are executed).
bool isConsistent() const { return Consistent; }
bool isConsistent() const override { return Consistent; }

/// getLevels - Returns the number of common loops surrounding the
/// source and destination of the dependence.
unsigned getLevels() const { return Levels; }
unsigned getLevels() const override { return Levels; }

/// getDirection - Returns the direction associated with a particular
/// level.
unsigned getDirection(unsigned Level) const;
unsigned getDirection(unsigned Level) const override;

/// getDistance - Returns the distance (or NULL) associated with a
/// particular level.
const SCEV *getDistance(unsigned Level) const;
const SCEV *getDistance(unsigned Level) const override;

/// isPeelFirst - Returns true if peeling the first iteration from
/// this loop will break this dependence.
bool isPeelFirst(unsigned Level) const;
bool isPeelFirst(unsigned Level) const override;

/// isPeelLast - Returns true if peeling the last iteration from
/// this loop will break this dependence.
bool isPeelLast(unsigned Level) const;
bool isPeelLast(unsigned Level) const override;

/// isSplitable - Returns true if splitting the loop will break
/// the dependence.
bool isSplitable(unsigned Level) const;
bool isSplitable(unsigned Level) const override;

/// isScalar - Returns true if a particular level is scalar; that is,
/// if no subscript in the source or destination mention the induction
/// variable associated with the loop at this level.
bool isScalar(unsigned Level) const;
bool isScalar(unsigned Level) const override;
private:
unsigned short Levels;
bool LoopIndependent;
Expand Down Expand Up @@ -918,10 +918,10 @@ namespace llvm {
initializeDependenceAnalysisPass(*PassRegistry::getPassRegistry());
}

bool runOnFunction(Function &F);
void releaseMemory();
void getAnalysisUsage(AnalysisUsage &) const;
void print(raw_ostream &, const Module * = 0) const;
bool runOnFunction(Function &F) override;
void releaseMemory() override;
void getAnalysisUsage(AnalysisUsage &) const override;
void print(raw_ostream &, const Module * = 0) const override;
}; // class DependenceAnalysis

/// createDependenceAnalysisPass - This creates an instance of the
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/Analysis/DominanceFrontier.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DominanceFrontierBase : public FunctionPass {
///
bool isPostDominator() const { return IsPostDominators; }

virtual void releaseMemory() { Frontiers.clear(); }
void releaseMemory() override { Frontiers.clear(); }

// Accessor interface:
typedef DomSetMapType::iterator iterator;
Expand Down Expand Up @@ -142,7 +142,7 @@ class DominanceFrontierBase : public FunctionPass {

/// print - Convert to human readable form
///
virtual void print(raw_ostream &OS, const Module* = 0) const;
void print(raw_ostream &OS, const Module* = 0) const override;

/// dump - Dump the dominance frontier to dbgs().
void dump() const;
Expand All @@ -167,7 +167,7 @@ class DominanceFrontier : public DominanceFrontierBase {
return Roots[0];
}

virtual bool runOnFunction(Function &) {
bool runOnFunction(Function &) override {
Frontiers.clear();
DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
Roots = DT.getRoots();
Expand All @@ -176,7 +176,7 @@ class DominanceFrontier : public DominanceFrontierBase {
return false;
}

virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<DominatorTreeWrapperPass>();
}
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/Analysis/FindUsedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FindUsedTypes : public ModulePass {
/// passed in, then the types are printed symbolically if possible, using the
/// symbol table from the module.
///
void print(raw_ostream &o, const Module *M) const;
void print(raw_ostream &o, const Module *M) const override;

private:
/// IncorporateType - Incorporate one type and all of its subtypes into the
Expand All @@ -53,10 +53,10 @@ class FindUsedTypes : public ModulePass {

public:
/// run - This incorporates all types used by the specified module
bool runOnModule(Module &M);
bool runOnModule(Module &M) override;

/// getAnalysisUsage - We do not modify anything.
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};
Expand Down
10 changes: 5 additions & 5 deletions include/llvm/Analysis/IVUsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class IVStrideUse : public CallbackVH, public ilist_node<IVStrideUse> {

/// Deleted - Implementation of CallbackVH virtual function to
/// receive notification when the User is deleted.
virtual void deleted();
void deleted() override;
};

template<> struct ilist_traits<IVStrideUse>
Expand Down Expand Up @@ -129,11 +129,11 @@ class IVUsers : public LoopPass {
/// we are interested in.
ilist<IVStrideUse> IVUses;

virtual void getAnalysisUsage(AnalysisUsage &AU) const;
void getAnalysisUsage(AnalysisUsage &AU) const override;

virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
bool runOnLoop(Loop *L, LPPassManager &LPM) override;

virtual void releaseMemory();
void releaseMemory() override;

public:
static char ID; // Pass ID, replacement for typeid
Expand Down Expand Up @@ -169,7 +169,7 @@ class IVUsers : public LoopPass {
return Processed.count(Inst);
}

void print(raw_ostream &OS, const Module* = 0) const;
void print(raw_ostream &OS, const Module* = 0) const override;

/// dump - This method is used for debugging.
void dump() const;
Expand Down
4 changes: 2 additions & 2 deletions include/llvm/Analysis/InlineCost.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class InlineCostAnalysis : public CallGraphSCCPass {
~InlineCostAnalysis();

// Pass interface implementation.
void getAnalysisUsage(AnalysisUsage &AU) const;
bool runOnSCC(CallGraphSCC &SCC);
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnSCC(CallGraphSCC &SCC) override;

/// \brief Get an InlineCost object representing the cost of inlining this
/// callsite.
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/Analysis/IntervalPartition.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class IntervalPartition : public FunctionPass {
}

// run - Calculate the interval partition for this function
virtual bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;

// IntervalPartition ctor - Build a reduced interval partition from an
// existing interval graph. This takes an additional boolean parameter to
Expand All @@ -62,7 +62,7 @@ class IntervalPartition : public FunctionPass {
IntervalPartition(IntervalPartition &I, bool);

// print - Show contents in human readable format...
virtual void print(raw_ostream &O, const Module* = 0) const;
void print(raw_ostream &O, const Module* = 0) const override;

// getRootInterval() - Return the root interval that contains the starting
// block of the function.
Expand All @@ -81,15 +81,15 @@ class IntervalPartition : public FunctionPass {
}

// getAnalysisUsage - Implement the Pass API
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}

// Interface to Intervals vector...
const std::vector<Interval*> &getIntervals() const { return Intervals; }

// releaseMemory - Reset state back to before function was analyzed
void releaseMemory();
void releaseMemory() override;

private:
// addIntervalToPartition - Add an interval to the internal list of intervals,
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/Analysis/LazyValueInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class LazyValueInfo : public FunctionPass {
void eraseBlock(BasicBlock *BB);

// Implementation boilerplate.
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual void releaseMemory();
virtual bool runOnFunction(Function &F);

void getAnalysisUsage(AnalysisUsage &AU) const override;
void releaseMemory() override;
bool runOnFunction(Function &F) override;
};

} // end namespace llvm
Expand Down
Loading

0 comments on commit c37e6c0

Please sign in to comment.