[C++11] Add 'override' keyword to virtual methods that override their base class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202945 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2014-03-05 07:30:04 +00:00
parent a6ace00520
commit c37e6c0734
45 changed files with 252 additions and 254 deletions

View File

@ -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);

View File

@ -37,10 +37,10 @@ public:
~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;

View File

@ -45,9 +45,9 @@ public:
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.
///

View File

@ -381,11 +381,11 @@ public:
// 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;
};

View File

@ -37,7 +37,8 @@ public:
/// 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;
@ -65,18 +66,17 @@ public:
}
/// 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.

View File

@ -35,7 +35,7 @@ public:
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";
@ -45,7 +45,7 @@ public:
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
@ -62,7 +62,7 @@ public:
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;
@ -82,7 +82,7 @@ public:
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
@ -99,7 +99,7 @@ public:
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);
@ -108,7 +108,7 @@ public:
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
@ -125,7 +125,7 @@ public:
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;
@ -144,7 +144,7 @@ public:
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}

View File

@ -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;
@ -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

View File

@ -51,7 +51,7 @@ public:
///
bool isPostDominator() const { return IsPostDominators; }
virtual void releaseMemory() { Frontiers.clear(); }
void releaseMemory() override { Frontiers.clear(); }
// Accessor interface:
typedef DomSetMapType::iterator iterator;
@ -142,7 +142,7 @@ public:
/// 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;
@ -167,7 +167,7 @@ public:
return Roots[0];
}
virtual bool runOnFunction(Function &) {
bool runOnFunction(Function &) override {
Frontiers.clear();
DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
Roots = DT.getRoots();
@ -176,7 +176,7 @@ public:
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<DominatorTreeWrapperPass>();
}

View File

@ -39,7 +39,7 @@ public:
/// 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
@ -53,10 +53,10 @@ private:
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();
}
};

View File

@ -86,7 +86,7 @@ private:
/// 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>
@ -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
@ -169,7 +169,7 @@ public:
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;

View File

@ -108,8 +108,8 @@ public:
~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.

View File

@ -53,7 +53,7 @@ public:
}
// 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
@ -62,7 +62,7 @@ public:
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.
@ -81,7 +81,7 @@ public:
}
// getAnalysisUsage - Implement the Pass API
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
@ -89,7 +89,7 @@ public:
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,

View File

@ -69,10 +69,10 @@ public:
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

View File

@ -38,17 +38,17 @@ namespace llvm {
~LibCallAliasAnalysis();
ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc);
const Location &Loc) override;
ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) {
ImmutableCallSite CS2) override {
// TODO: Could compare two direct calls against each other if we cared to.
return AliasAnalysis::getModRefInfo(CS1, CS2);
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual bool runOnFunction(Function &F) {
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnFunction(Function &F) override {
InitializeAliasAnalysis(this); // set up super class
return false;
}
@ -57,7 +57,7 @@ namespace llvm {
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(const void *PI) {
void *getAdjustedAnalysisPointer(const void *PI) override {
if (PI == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;

View File

@ -654,15 +654,15 @@ public:
/// runOnFunction - Calculate the natural loop information.
///
virtual bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
virtual void verifyAnalysis() const;
void verifyAnalysis() const override;
virtual void releaseMemory() { LI.releaseMemory(); }
void releaseMemory() override { LI.releaseMemory(); }
virtual void print(raw_ostream &O, const Module* M = 0) const;
void print(raw_ostream &O, const Module* M = 0) const override;
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
void getAnalysisUsage(AnalysisUsage &AU) const override;
/// removeLoop - This removes the specified top-level loop from this loop info
/// object. The loop is not deleted, as it will presumably be inserted into

View File

@ -32,7 +32,8 @@ public:
/// getPrinterPass - Get a pass to print the function corresponding
/// to a Loop.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
Pass *createPrinterPass(raw_ostream &O,
const std::string &Banner) const override;
// runOnLoop - This method should be implemented by the subclass to perform
// whatever action is necessary for the specified Loop.
@ -56,14 +57,13 @@ public:
// LPPassManager passes. In such case, pop LPPassManager from the
// stack. This will force assignPassManager() to create new
// LPPassManger as expected.
void preparePassManager(PMStack &PMS);
void preparePassManager(PMStack &PMS) override;
/// Assign pass manager to manage 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_LoopPassManager;
}
@ -95,21 +95,21 @@ public:
/// 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 runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
/// Pass Manager itself does not invalidate any analysis info.
// LPPassManager needs LoopInfo.
void getAnalysisUsage(AnalysisUsage &Info) const;
void getAnalysisUsage(AnalysisUsage &Info) const override;
virtual const char *getPassName() const {
const char *getPassName() const override {
return "Loop Pass Manager";
}
virtual PMDataManager *getAsPMDataManager() { return this; }
virtual Pass *getAsPass() { return this; }
PMDataManager *getAsPMDataManager() override { return this; }
Pass *getAsPass() override { return this; }
/// Print passes managed by this manager
void dumpPassStructure(unsigned Offset);
void dumpPassStructure(unsigned Offset) override;
LoopPass *getContainedPass(unsigned N) {
assert(N < PassVector.size() && "Pass number out of range!");
@ -117,7 +117,7 @@ public:
return LP;
}
virtual PassManagerType getPassManagerType() const {
PassManagerType getPassManagerType() const override {
return PMT_LoopPassManager;
}

View File

@ -332,15 +332,15 @@ namespace llvm {
static char ID;
/// Pass Implementation stuff. This doesn't do any analysis eagerly.
bool runOnFunction(Function &);
bool runOnFunction(Function &) override;
/// Clean up memory in between runs
void releaseMemory();
void releaseMemory() override;
/// getAnalysisUsage - Does not modify anything. It uses Value Numbering
/// and Alias Analysis.
///
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
void getAnalysisUsage(AnalysisUsage &AU) const override;
/// getDependency - Return the instruction on which a memory operation
/// depends. See the class comment for more details. It is illegal to call

View File

@ -32,9 +32,9 @@ struct PostDominatorTree : public FunctionPass {
~PostDominatorTree();
virtual bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
@ -85,11 +85,11 @@ struct PostDominatorTree : public FunctionPass {
DT->getDescendants(R, Result);
}
virtual void releaseMemory() {
void releaseMemory() override {
DT->releaseMemory();
}
virtual void print(raw_ostream &OS, const Module*) const;
void print(raw_ostream &OS, const Module*) const override;
};
FunctionPass* createPostDomTree();

View File

@ -648,7 +648,7 @@ class RegionInfo : public FunctionPass {
// Calculate - detecte all regions in function and build the region tree.
void Calculate(Function& F);
void releaseMemory();
void releaseMemory() override;
// updateStatistics - Update statistic about created regions.
void updateStatistics(Region *R);
@ -665,10 +665,10 @@ public:
/// @name FunctionPass interface
//@{
virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual void print(raw_ostream &OS, const Module *) const;
virtual void verifyAnalysis() const;
bool runOnFunction(Function &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
void print(raw_ostream &OS, const Module *) const override;
void verifyAnalysis() const override;
//@}
/// @brief Get the smallest region that contains a BasicBlock.

View File

@ -55,7 +55,8 @@ public:
/// @param Banner The banner to separate different printed passes.
///
/// @return The pass to print the LLVM IR in the region.
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;
@ -68,12 +69,12 @@ public:
/// @name PassManager API
///
//@{
void preparePassManager(PMStack &PMS);
void preparePassManager(PMStack &PMS) override;
virtual void assignPassManager(PMStack &PMS,
PassManagerType PMT = PMT_RegionPassManager);
void assignPassManager(PMStack &PMS,
PassManagerType PMT = PMT_RegionPassManager) override;
virtual PassManagerType getPotentialPassManagerType() const {
PassManagerType getPotentialPassManagerType() const override {
return PMT_RegionPassManager;
}
//@}
@ -94,21 +95,21 @@ public:
/// @brief Execute all of the passes scheduled for execution.
///
/// @return True if any of the passes modifies the function.
bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
/// Pass Manager itself does not invalidate any analysis info.
/// RGPassManager needs RegionInfo.
void getAnalysisUsage(AnalysisUsage &Info) const;
void getAnalysisUsage(AnalysisUsage &Info) const override;
virtual const char *getPassName() const {
const char *getPassName() const override {
return "Region Pass Manager";
}
virtual PMDataManager *getAsPMDataManager() { return this; }
virtual Pass *getAsPass() { return this; }
PMDataManager *getAsPMDataManager() override { return this; }
Pass *getAsPass() override { return this; }
/// @brief Print passes managed by this manager.
void dumpPassStructure(unsigned Offset);
void dumpPassStructure(unsigned Offset) override;
/// @brief Get passes contained by this manager.
Pass *getContainedPass(unsigned N) {
@ -117,7 +118,7 @@ public:
return FP;
}
virtual PassManagerType getPassManagerType() const {
PassManagerType getPassManagerType() const override {
return PMT_RegionPassManager;
}
};

View File

@ -207,8 +207,8 @@ namespace llvm {
/// notified whenever a Value is deleted.
class SCEVCallbackVH : public CallbackVH {
ScalarEvolution *SE;
virtual void deleted();
virtual void allUsesReplacedWith(Value *New);
void deleted() override;
void allUsesReplacedWith(Value *New) override;
public:
SCEVCallbackVH(Value *V, ScalarEvolution *SE = 0);
};
@ -894,11 +894,11 @@ namespace llvm {
/// indirect operand.
bool hasOperand(const SCEV *S, const SCEV *Op) const;
virtual bool runOnFunction(Function &F);
virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual void print(raw_ostream &OS, const Module* = 0) const;
virtual void verifyAnalysis() const;
bool runOnFunction(Function &F) override;
void releaseMemory() override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
void print(raw_ostream &OS, const Module* = 0) const override;
void verifyAnalysis() const override;
private:
/// Compute the backedge taken count knowing the interval difference, the

View File

@ -410,8 +410,8 @@ namespace llvm {
friend class ScalarEvolution;
// Implement CallbackVH.
virtual void deleted();
virtual void allUsesReplacedWith(Value *New);
void deleted() override;
void allUsesReplacedWith(Value *New) override;
/// SE - The parent ScalarEvolution value. This is used to update
/// the parent's maps when the value associated with a SCEVUnknown

View File

@ -281,7 +281,7 @@ template <typename IRUnitT, typename PassT, typename ResultT>
struct AnalysisResultModel<IRUnitT, PassT, ResultT,
false> : AnalysisResultConcept<IRUnitT> {
AnalysisResultModel(ResultT Result) : Result(std::move(Result)) {}
virtual AnalysisResultModel *clone() {
AnalysisResultModel *clone() override {
return new AnalysisResultModel(Result);
}
@ -290,7 +290,7 @@ struct AnalysisResultModel<IRUnitT, PassT, ResultT,
// FIXME: We should actually use two different concepts for analysis results
// rather than two different models, and avoid the indirect function call for
// ones that use the trivial behavior.
virtual bool invalidate(IRUnitT, const PreservedAnalyses &PA) {
bool invalidate(IRUnitT, const PreservedAnalyses &PA) override {
return !PA.preserved(PassT::ID());
}

View File

@ -370,9 +370,9 @@ namespace {
CapturesBefore(const Instruction *I, DominatorTree *DT)
: BeforeHere(I), DT(DT), Captured(false) {}
void tooManyUses() { Captured = true; }
void tooManyUses() override { Captured = true; }
bool shouldExplore(Use *U) {
bool shouldExplore(Use *U) override {
Instruction *I = cast<Instruction>(U->getUser());
BasicBlock *BB = I->getParent();
// We explore this usage only if the usage can reach "BeforeHere".
@ -388,7 +388,7 @@ namespace {
return true;
}
bool captured(Use *U) {
bool captured(Use *U) override {
Instruction *I = cast<Instruction>(U->getUser());
BasicBlock *BB = I->getParent();
// Same logic as in shouldExplore.

View File

@ -74,13 +74,13 @@ namespace {
}
}
bool runOnModule(Module &M) {
bool runOnModule(Module &M) override {
this->M = &M;
InitializeAliasAnalysis(this);
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AliasAnalysis::getAnalysisUsage(AU);
AU.addRequired<AliasAnalysis>();
AU.setPreservesAll();
@ -90,25 +90,25 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
void *getAdjustedAnalysisPointer(AnalysisID PI) override {
if (PI == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;
}
// FIXME: We could count these too...
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) {
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) override {
return getAnalysis<AliasAnalysis>().pointsToConstantMemory(Loc, OrLocal);
}
// Forwarding functions: just delegate to a real AA implementation, counting
// the number of responses...
AliasResult alias(const Location &LocA, const Location &LocB);
AliasResult alias(const Location &LocA, const Location &LocB) override;
ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc);
const Location &Loc) override;
ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) {
ImmutableCallSite CS2) override {
return AliasAnalysis::getModRefInfo(CS1,CS2);
}
};

View File

@ -56,12 +56,12 @@ namespace {
initializeAAEvalPass(*PassRegistry::getPassRegistry());
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<AliasAnalysis>();
AU.setPreservesAll();
}
bool doInitialization(Module &M) {
bool doInitialization(Module &M) override {
NoAlias = MayAlias = PartialAlias = MustAlias = 0;
NoModRef = Mod = Ref = ModRef = 0;
@ -73,8 +73,8 @@ namespace {
return false;
}
bool runOnFunction(Function &F);
bool doFinalization(Module &M);
bool runOnFunction(Function &F) override;
bool doFinalization(Module &M) override;
};
}

View File

@ -43,7 +43,7 @@ namespace {
initializeAliasDebuggerPass(*PassRegistry::getPassRegistry());
}
bool runOnModule(Module &M) {
bool runOnModule(Module &M) override {
InitializeAliasAnalysis(this); // set up super class
for(Module::global_iterator I = M.global_begin(),
@ -76,7 +76,7 @@ namespace {
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AliasAnalysis::getAnalysisUsage(AU);
AU.setPreservesAll(); // Does not transform code
}
@ -85,7 +85,7 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
void *getAdjustedAnalysisPointer(AnalysisID PI) override {
if (PI == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;
@ -94,7 +94,7 @@ namespace {
//------------------------------------------------
// Implement the AliasAnalysis API
//
AliasResult alias(const Location &LocA, const Location &LocB) {
AliasResult alias(const Location &LocA, const Location &LocB) override {
assert(Vals.find(LocA.Ptr) != Vals.end() &&
"Never seen value in AA before");
assert(Vals.find(LocB.Ptr) != Vals.end() &&
@ -103,26 +103,26 @@ namespace {
}
ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc) {
const Location &Loc) override {
assert(Vals.find(Loc.Ptr) != Vals.end() && "Never seen value in AA before");
return AliasAnalysis::getModRefInfo(CS, Loc);
}
ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) {
ImmutableCallSite CS2) override {
return AliasAnalysis::getModRefInfo(CS1,CS2);
}
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) {
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) override {
assert(Vals.find(Loc.Ptr) != Vals.end() && "Never seen value in AA before");
return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal);
}
virtual void deleteValue(Value *V) {
void deleteValue(Value *V) override {
assert(Vals.find(V) != Vals.end() && "Never seen value in AA before");
AliasAnalysis::deleteValue(V);
}
virtual void copyValue(Value *From, Value *To) {
void copyValue(Value *From, Value *To) override {
Vals.insert(To);
AliasAnalysis::copyValue(From, To);
}

View File

@ -627,12 +627,12 @@ namespace {
initializeAliasSetPrinterPass(*PassRegistry::getPassRegistry());
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AliasAnalysis>();
}
virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
Tracker = new AliasSetTracker(getAnalysis<AliasAnalysis>());
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)

View File

@ -444,17 +444,16 @@ namespace {
initializeBasicAliasAnalysisPass(*PassRegistry::getPassRegistry());
}
virtual void initializePass() {
void initializePass() override {
InitializeAliasAnalysis(this);
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<AliasAnalysis>();
AU.addRequired<TargetLibraryInfo>();
}
virtual AliasResult alias(const Location &LocA,
const Location &LocB) {
AliasResult alias(const Location &LocA, const Location &LocB) override {
assert(AliasCache.empty() && "AliasCache must be cleared after use!");
assert(notDifferentParent(LocA.Ptr, LocB.Ptr) &&
"BasicAliasAnalysis doesn't support interprocedural queries.");
@ -469,32 +468,32 @@ namespace {
return Alias;
}
virtual ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc);
ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc) override;
virtual ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) {
ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) override {
// The AliasAnalysis base class has some smarts, lets use them.
return AliasAnalysis::getModRefInfo(CS1, CS2);
}
/// pointsToConstantMemory - Chase pointers until we find a (constant
/// global) or not.
virtual bool pointsToConstantMemory(const Location &Loc, bool OrLocal);
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) override;
/// getModRefBehavior - Return the behavior when calling the given
/// call site.
virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS);
ModRefBehavior getModRefBehavior(ImmutableCallSite CS) override;
/// getModRefBehavior - Return the behavior when calling the given function.
/// For use when the call site is not known.
virtual ModRefBehavior getModRefBehavior(const Function *F);
ModRefBehavior getModRefBehavior(const Function *F) override;
/// getAdjustedAnalysisPointer - This method is used when a pass implements
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(const void *ID) {
void *getAdjustedAnalysisPointer(const void *ID) override {
if (ID == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;

View File

@ -28,14 +28,14 @@ namespace {
initializeCFGOnlyViewerPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
F.viewCFG();
return false;
}
void print(raw_ostream &OS, const Module* = 0) const {}
void print(raw_ostream &OS, const Module* = 0) const override {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};
@ -51,14 +51,14 @@ namespace {
initializeCFGOnlyViewerPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
F.viewCFGOnly();
return false;
}
void print(raw_ostream &OS, const Module* = 0) const {}
void print(raw_ostream &OS, const Module* = 0) const override {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};
@ -75,7 +75,7 @@ namespace {
initializeCFGPrinterPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
std::string Filename = "cfg." + F.getName().str() + ".dot";
errs() << "Writing '" << Filename << "'...";
@ -90,9 +90,9 @@ namespace {
return false;
}
void print(raw_ostream &OS, const Module* = 0) const {}
void print(raw_ostream &OS, const Module* = 0) const override {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};
@ -108,8 +108,8 @@ namespace {
CFGOnlyPrinter() : FunctionPass(ID) {
initializeCFGOnlyPrinterPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F) {
bool runOnFunction(Function &F) override {
std::string Filename = "cfg." + F.getName().str() + ".dot";
errs() << "Writing '" << Filename << "'...";
@ -123,9 +123,9 @@ namespace {
errs() << "\n";
return false;
}
void print(raw_ostream &OS, const Module* = 0) const {}
void print(raw_ostream &OS, const Module* = 0) const override {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
};

View File

@ -35,9 +35,9 @@ namespace {
explicit SimpleCaptureTracker(bool ReturnCaptures)
: ReturnCaptures(ReturnCaptures), Captured(false) {}
void tooManyUses() { Captured = true; }
void tooManyUses() override { Captured = true; }
bool captured(Use *U) {
bool captured(Use *U) override {
if (isa<ReturnInst>(U->getUser()) && !ReturnCaptures)
return false;

View File

@ -53,9 +53,9 @@ namespace {
unsigned getInstructionCost(const Instruction *I) const;
private:
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual bool runOnFunction(Function &F);
virtual void print(raw_ostream &OS, const Module*) const;
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnFunction(Function &F) override;
void print(raw_ostream &OS, const Module*) const override;
/// The function that we analyze.
Function *F;

View File

@ -49,9 +49,9 @@ public:
Delinearization() : FunctionPass(ID) {
initializeDelinearizationPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual void print(raw_ostream &O, const Module *M = 0) const;
bool runOnFunction(Function &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
void print(raw_ostream &O, const Module *M = 0) const override;
};
} // end anonymous namespace

View File

@ -49,7 +49,7 @@ public:
/// 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 runOnModule(Module &M);
bool runOnModule(Module &M) override;
using ModulePass::doInitialization;
using ModulePass::doFinalization;
@ -58,21 +58,21 @@ public:
bool doFinalization(CallGraph &CG);
/// Pass Manager itself does not invalidate any analysis info.
void getAnalysisUsage(AnalysisUsage &Info) const {
void getAnalysisUsage(AnalysisUsage &Info) const override {
// CGPassManager walks SCC and it needs CallGraph.
Info.addRequired<CallGraphWrapperPass>();
Info.setPreservesAll();
}
virtual const char *getPassName() const {
const char *getPassName() const override {
return "CallGraph Pass Manager";
}
virtual PMDataManager *getAsPMDataManager() { return this; }
virtual Pass *getAsPass() { return this; }
PMDataManager *getAsPMDataManager() override { return this; }
Pass *getAsPass() override { return this; }
// Print passes managed by this manager
void dumpPassStructure(unsigned Offset) {
void dumpPassStructure(unsigned Offset) override {
errs().indent(Offset*2) << "Call Graph SCC Pass Manager\n";
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
@ -86,7 +86,7 @@ public:
return static_cast<Pass *>(PassVector[N]);
}
virtual PassManagerType getPassManagerType() const {
PassManagerType getPassManagerType() const override {
return PMT_CallGraphPassManager;
}
@ -590,12 +590,12 @@ namespace {
static char ID;
PrintCallGraphPass(const std::string &B, raw_ostream &o)
: CallGraphSCCPass(ID), Banner(B), Out(o) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
bool runOnSCC(CallGraphSCC &SCC) {
bool runOnSCC(CallGraphSCC &SCC) override {
Out << Banner;
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I)
(*I)->getFunction()->print(Out);

View File

@ -94,7 +94,7 @@ namespace {
initializeGlobalsModRefPass(*PassRegistry::getPassRegistry());
}
bool runOnModule(Module &M) {
bool runOnModule(Module &M) override {
InitializeAliasAnalysis(this);
// Find non-addr taken globals.
@ -105,7 +105,7 @@ namespace {
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AliasAnalysis::getAnalysisUsage(AU);
AU.addRequired<CallGraphWrapperPass>();
AU.setPreservesAll(); // Does not transform code
@ -114,18 +114,18 @@ namespace {
//------------------------------------------------
// Implement the AliasAnalysis API
//
AliasResult alias(const Location &LocA, const Location &LocB);
AliasResult alias(const Location &LocA, const Location &LocB) override;
ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc);
const Location &Loc) override;
ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) {
ImmutableCallSite CS2) override {
return AliasAnalysis::getModRefInfo(CS1, CS2);
}
/// getModRefBehavior - Return the behavior of the specified function if
/// called from the specified call site. The call site may be null in which
/// case the most generic behavior of this function should be returned.
ModRefBehavior getModRefBehavior(const Function *F) {
ModRefBehavior getModRefBehavior(const Function *F) override {
ModRefBehavior Min = UnknownModRefBehavior;
if (FunctionRecord *FR = getFunctionInfo(F)) {
@ -141,7 +141,7 @@ namespace {
/// getModRefBehavior - Return the behavior of the specified function if
/// called from the specified call site. The call site may be null in which
/// case the most generic behavior of this function should be returned.
ModRefBehavior getModRefBehavior(ImmutableCallSite CS) {
ModRefBehavior getModRefBehavior(ImmutableCallSite CS) override {
ModRefBehavior Min = UnknownModRefBehavior;
if (const Function* F = CS.getCalledFunction())
@ -155,15 +155,15 @@ namespace {
return ModRefBehavior(AliasAnalysis::getModRefBehavior(CS) & Min);
}
virtual void deleteValue(Value *V);
virtual void copyValue(Value *From, Value *To);
virtual void addEscapingUse(Use &U);
void deleteValue(Value *V) override;
void copyValue(Value *From, Value *To) override;
void addEscapingUse(Use &U) override;
/// getAdjustedAnalysisPointer - This method is used when a pass implements
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
void *getAdjustedAnalysisPointer(AnalysisID PI) override {
if (PI == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;

View File

@ -55,12 +55,12 @@ namespace {
initializeInstCountPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
virtual void print(raw_ostream &O, const Module *M) const {}
void print(raw_ostream &O, const Module *M) const override {}
};
}

View File

@ -302,9 +302,9 @@ namespace {
LVIValueHandle(Value *V, LazyValueInfoCache *P)
: CallbackVH(V), Parent(P) { }
void deleted();
void allUsesReplacedWith(Value *V) {
void deleted() override;
void allUsesReplacedWith(Value *V) override {
deleted();
}
};

View File

@ -113,15 +113,15 @@ namespace {
initializeLintPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AliasAnalysis>();
AU.addRequired<TargetLibraryInfo>();
AU.addRequired<DominatorTreeWrapperPass>();
}
virtual void print(raw_ostream &O, const Module *M) const {}
void print(raw_ostream &O, const Module *M) const override {}
void WriteValue(const Value *V) {
if (!V) return;

View File

@ -33,11 +33,11 @@ public:
PrintLoopPass(const std::string &B, raw_ostream &o)
: LoopPass(ID), Banner(B), Out(o) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
bool runOnLoop(Loop *L, LPPassManager &) {
bool runOnLoop(Loop *L, LPPassManager &) override {
Out << Banner;
for (Loop::block_iterator b = L->block_begin(), be = L->block_end();
b != be;

View File

@ -44,17 +44,17 @@ namespace {
initializeMemDepPrinterPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
void print(raw_ostream &OS, const Module * = 0) const;
void print(raw_ostream &OS, const Module * = 0) const override;
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredTransitive<AliasAnalysis>();
AU.addRequiredTransitive<MemoryDependenceAnalysis>();
AU.setPreservesAll();
}
virtual void releaseMemory() {
void releaseMemory() override {
Deps.clear();
F = 0;
}

View File

@ -33,12 +33,12 @@ namespace {
initializeModuleDebugInfoPrinterPass(*PassRegistry::getPassRegistry());
}
virtual bool runOnModule(Module &M);
bool runOnModule(Module &M) override;
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
virtual void print(raw_ostream &O, const Module *M) const;
void print(raw_ostream &O, const Module *M) const override;
};
}

View File

@ -30,49 +30,47 @@ namespace {
initializeNoAAPass(*PassRegistry::getPassRegistry());
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
}
void getAnalysisUsage(AnalysisUsage &AU) const override {}
virtual void initializePass() {
void initializePass() override {
// Note: NoAA does not call InitializeAliasAnalysis because it's
// special and does not support chaining.
DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
DL = DLP ? &DLP->getDataLayout() : 0;
}
virtual AliasResult alias(const Location &LocA, const Location &LocB) {
AliasResult alias(const Location &LocA, const Location &LocB) override {
return MayAlias;
}
virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS) {
ModRefBehavior getModRefBehavior(ImmutableCallSite CS) override {
return UnknownModRefBehavior;
}
virtual ModRefBehavior getModRefBehavior(const Function *F) {
ModRefBehavior getModRefBehavior(const Function *F) override {
return UnknownModRefBehavior;
}
virtual bool pointsToConstantMemory(const Location &Loc,
bool OrLocal) {
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) override {
return false;
}
virtual ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc) {
ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc) override {
return ModRef;
}
virtual ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) {
ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) override {
return ModRef;
}
virtual void deleteValue(Value *V) {}
virtual void copyValue(Value *From, Value *To) {}
virtual void addEscapingUse(Use &U) {}
void deleteValue(Value *V) override {}
void copyValue(Value *From, Value *To) override {}
void addEscapingUse(Use &U) override {}
/// getAdjustedAnalysisPointer - This method is used when a pass implements
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(const void *ID) {
void *getAdjustedAnalysisPointer(const void *ID) override {
if (ID == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;

View File

@ -189,11 +189,11 @@ public:
PrintRegionPass(const std::string &B, raw_ostream &o)
: RegionPass(ID), Banner(B), Out(o) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
virtual bool runOnRegion(Region *R, RGPassManager &RGM) {
bool runOnRegion(Region *R, RGPassManager &RGM) override {
Out << Banner;
for (const auto &BB : R->blocks())
BB->print(Out);

View File

@ -43,16 +43,16 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
void *getAdjustedAnalysisPointer(AnalysisID PI) override {
if (PI == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;
}
private:
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual bool runOnFunction(Function &F);
virtual AliasResult alias(const Location &LocA, const Location &LocB);
void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnFunction(Function &F) override;
AliasResult alias(const Location &LocA, const Location &LocB) override;
Value *GetBaseValue(const SCEV *S);
};

View File

@ -281,7 +281,7 @@ namespace {
initializeTypeBasedAliasAnalysisPass(*PassRegistry::getPassRegistry());
}
virtual void initializePass() {
void initializePass() override {
InitializeAliasAnalysis(this);
}
@ -289,7 +289,7 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(const void *PI) {
void *getAdjustedAnalysisPointer(const void *PI) override {
if (PI == &AliasAnalysis::ID)
return (AliasAnalysis*)this;
return this;
@ -299,15 +299,15 @@ namespace {
bool PathAliases(const MDNode *A, const MDNode *B) const;
private:
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual AliasResult alias(const Location &LocA, const Location &LocB);
virtual bool pointsToConstantMemory(const Location &Loc, bool OrLocal);
virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS);
virtual ModRefBehavior getModRefBehavior(const Function *F);
virtual ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc);
virtual ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2);
void getAnalysisUsage(AnalysisUsage &AU) const override;
AliasResult alias(const Location &LocA, const Location &LocB) override;
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) override;
ModRefBehavior getModRefBehavior(ImmutableCallSite CS) override;
ModRefBehavior getModRefBehavior(const Function *F) override;
ModRefResult getModRefInfo(ImmutableCallSite CS,
const Location &Loc) override;
ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) override;
};
} // End of anonymous namespace