/// 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);
~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;
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.
///
// 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;
};
/// 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;
}
/// 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.
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";
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
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;
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
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);
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
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;
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<AnalysisT>();
}
/// 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;
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
///
bool isPostDominator() const { return IsPostDominators; }
- virtual void releaseMemory() { Frontiers.clear(); }
+ void releaseMemory() override { Frontiers.clear(); }
// Accessor interface:
typedef DomSetMapType::iterator iterator;
/// 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;
return Roots[0];
}
- virtual bool runOnFunction(Function &) {
+ bool runOnFunction(Function &) override {
Frontiers.clear();
DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
Roots = DT.getRoots();
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<DominatorTreeWrapperPass>();
}
/// 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
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();
}
};
/// 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>
/// 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
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;
~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.
}
// 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
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.
}
// getAnalysisUsage - Implement the Pass API
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll();
}
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,
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
~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;
}
/// 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;
/// 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
/// 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.
// 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;
}
/// 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!");
return LP;
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_LoopPassManager;
}
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
~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();
}
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();
// 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);
/// @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.
/// @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;
/// @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;
}
//@}
/// @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) {
return FP;
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_RegionPassManager;
}
};
/// 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);
};
/// 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
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
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);
}
// 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());
}
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".
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.
}
}
- 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();
/// 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);
}
};
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;
return false;
}
- bool runOnFunction(Function &F);
- bool doFinalization(Module &M);
+ bool runOnFunction(Function &F) override;
+ bool doFinalization(Module &M) override;
};
}
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(),
return false;
}
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
AliasAnalysis::getAnalysisUsage(AU);
AU.setPreservesAll(); // Does not transform code
}
/// 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;
//------------------------------------------------
// 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() &&
}
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);
}
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)
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.");
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;
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();
}
};
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();
}
};
initializeCFGPrinterPass(*PassRegistry::getPassRegistry());
}
- virtual bool runOnFunction(Function &F) {
+ bool runOnFunction(Function &F) override {
std::string Filename = "cfg." + F.getName().str() + ".dot";
errs() << "Writing '" << Filename << "'...";
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();
}
};
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 << "'...";
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();
}
};
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;
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;
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
/// 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;
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);
return static_cast<Pass *>(PassVector[N]);
}
- virtual PassManagerType getPassManagerType() const {
+ PassManagerType getPassManagerType() const override {
return PMT_CallGraphPassManager;
}
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);
initializeGlobalsModRefPass(*PassRegistry::getPassRegistry());
}
- bool runOnModule(Module &M) {
+ bool runOnModule(Module &M) override {
InitializeAliasAnalysis(this);
// Find non-addr taken globals.
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
//------------------------------------------------
// 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)) {
/// 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())
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;
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 {}
};
}
LVIValueHandle(Value *V, LazyValueInfoCache *P)
: CallbackVH(V), Parent(P) { }
-
- void deleted();
- void allUsesReplacedWith(Value *V) {
+
+ void deleted() override;
+ void allUsesReplacedWith(Value *V) override {
deleted();
}
};
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;
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;
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;
}
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;
};
}
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;
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);
/// 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);
};
initializeTypeBasedAliasAnalysisPass(*PassRegistry::getPassRegistry());
}
- virtual void initializePass() {
+ void initializePass() override {
InitializeAliasAnalysis(this);
}
/// 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;
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