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

llvm-svn: 203999
This commit is contained in:
Craig Topper 2014-03-15 04:29:04 +00:00
parent e3bfdc4e14
commit fb6b25b5e4
54 changed files with 551 additions and 557 deletions

View File

@ -35,14 +35,14 @@ protected:
/// otherwise it creates a fresh LLVM context and takes ownership.
CodeGenAction(unsigned _Act, llvm::LLVMContext *_VMContext = 0);
virtual bool hasIRSupport() const;
bool hasIRSupport() const override;
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile);
ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override;
virtual void ExecuteAction();
void ExecuteAction() override;
virtual void EndSourceFileAction();
void EndSourceFileAction() override;
public:
~CodeGenAction();

View File

@ -112,12 +112,12 @@ public:
/// returns true) indicates whether the diagnostics handled by this
/// DiagnosticConsumer should be included in the number of diagnostics
/// reported by DiagnosticsEngine.
virtual bool IncludeInDiagnosticCounts() const;
bool IncludeInDiagnosticCounts() const override;
/// HandleDiagnostic - Handle this diagnostic, reporting it to the user or
/// capturing it to a log as needed.
virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Info);
void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Info) override;
/// \brief Emit a diagnostic via the adapted diagnostic client.
void Diag(SourceLocation Loc, unsigned DiagID);

View File

@ -22,8 +22,8 @@ class FixItOptions;
class HTMLPrintAction : public ASTFrontendAction {
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile);
ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override;
};
class FixItAction : public ASTFrontendAction {
@ -31,15 +31,15 @@ protected:
std::unique_ptr<FixItRewriter> Rewriter;
std::unique_ptr<FixItOptions> FixItOpts;
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile);
ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override;
virtual bool BeginSourceFileAction(CompilerInstance &CI,
StringRef Filename);
bool BeginSourceFileAction(CompilerInstance &CI,
StringRef Filename) override;
virtual void EndSourceFileAction();
void EndSourceFileAction() override;
virtual bool hasASTFileSupport() const { return false; }
bool hasASTFileSupport() const override { return false; }
public:
FixItAction();
@ -54,28 +54,28 @@ public:
: WrapperFrontendAction(WrappedAction) {}
protected:
virtual bool BeginInvocation(CompilerInstance &CI);
bool BeginInvocation(CompilerInstance &CI) override;
};
class RewriteObjCAction : public ASTFrontendAction {
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile);
ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override;
};
class RewriteMacrosAction : public PreprocessorFrontendAction {
protected:
void ExecuteAction();
void ExecuteAction() override;
};
class RewriteTestAction : public PreprocessorFrontendAction {
protected:
void ExecuteAction();
void ExecuteAction() override;
};
class RewriteIncludesAction : public PreprocessorFrontendAction {
protected:
void ExecuteAction();
void ExecuteAction() override;
};
} // end namespace clang

View File

@ -512,9 +512,8 @@ public:
///
/// \return True if the report was valid and a path was generated,
/// false if the reports should be considered invalid.
virtual bool generatePathDiagnostic(PathDiagnostic &PD,
PathDiagnosticConsumer &PC,
ArrayRef<BugReport*> &bugReports);
bool generatePathDiagnostic(PathDiagnostic &PD, PathDiagnosticConsumer &PC,
ArrayRef<BugReport*> &bugReports) override;
/// classof - Used by isa<>, cast<>, and dyn_cast<>.
static bool classof(const BugReporter* R) {

View File

@ -89,7 +89,7 @@ public:
/// will have to provide your own implementation.)
template <class DERIVED>
class BugReporterVisitorImpl : public BugReporterVisitor {
virtual BugReporterVisitor *clone() const {
BugReporterVisitor *clone() const override {
return new DERIVED(*static_cast<const DERIVED *>(this));
}
};
@ -118,12 +118,12 @@ public:
Satisfied(false),
EnableNullFPSuppression(InEnableNullFPSuppression) {}
void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
BugReport &BR) override;
};
class TrackConstraintBRVisitor
@ -144,7 +144,7 @@ public:
IsZeroCheck(!Assumption && Constraint.getAs<Loc>()),
IsTrackingTurnedOn(false) {}
void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
/// Return the tag associated with this visitor. This tag will be used
/// to make all PathDiagnosticPieces created by this visitor.
@ -153,7 +153,7 @@ public:
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
BugReport &BR) override;
private:
/// Checks if the constraint is valid in the current state.
@ -166,8 +166,8 @@ private:
class NilReceiverBRVisitor
: public BugReporterVisitorImpl<NilReceiverBRVisitor> {
public:
void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override {
static int x = 0;
ID.AddPointer(&x);
}
@ -175,7 +175,7 @@ public:
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
BugReport &BR) override;
/// If the statement is a message send expression with nil receiver, returns
/// the receiver expression. Returns NULL otherwise.
@ -185,7 +185,7 @@ public:
/// Visitor that tries to report interesting diagnostics from conditions.
class ConditionBRVisitor : public BugReporterVisitorImpl<ConditionBRVisitor> {
public:
void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override{
static int x = 0;
ID.AddPointer(&x);
}
@ -193,11 +193,11 @@ public:
/// Return the tag associated with this visitor. This tag will be used
/// to make all PathDiagnosticPieces created by this visitor.
static const char *getTag();
virtual PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *Prev,
BugReporterContext &BRC,
BugReport &BR);
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *Prev,
BugReporterContext &BRC,
BugReport &BR) override;
PathDiagnosticPiece *VisitNodeImpl(const ExplodedNode *N,
const ExplodedNode *Prev,
@ -257,20 +257,20 @@ public:
return static_cast<void *>(&Tag);
}
void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override {
ID.AddPointer(getTag());
}
virtual PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *Prev,
BugReporterContext &BRC,
BugReport &BR) {
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *Prev,
BugReporterContext &BRC,
BugReport &BR) override {
return 0;
}
virtual PathDiagnosticPiece *getEndPath(BugReporterContext &BRC,
const ExplodedNode *N,
BugReport &BR);
PathDiagnosticPiece *getEndPath(BugReporterContext &BRC,
const ExplodedNode *N,
BugReport &BR) override;
};
/// \brief When a region containing undefined value or '0' value is passed
@ -287,7 +287,7 @@ class UndefOrNullArgVisitor
public:
UndefOrNullArgVisitor(const MemRegion *InR) : R(InR) {}
virtual void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override {
static int Tag = 0;
ID.AddPointer(&Tag);
ID.AddPointer(R);
@ -296,7 +296,7 @@ public:
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
BugReport &BR) override;
};
class SuppressInlineDefensiveChecksVisitor
@ -319,7 +319,7 @@ class SuppressInlineDefensiveChecksVisitor
public:
SuppressInlineDefensiveChecksVisitor(DefinedSVal Val, const ExplodedNode *N);
void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
/// Return the tag associated with this visitor. This tag will be used
/// to make all PathDiagnosticPieces created by this visitor.
@ -328,7 +328,7 @@ public:
PathDiagnosticPiece *VisitNode(const ExplodedNode *Succ,
const ExplodedNode *Pred,
BugReporterContext &BRC,
BugReport &BR);
BugReport &BR) override;
};
namespace bugreporter {

View File

@ -60,7 +60,7 @@ public:
class BuiltinBug : public BugType {
const std::string desc;
virtual void anchor();
void anchor() override;
public:
BuiltinBug(class CheckName check, const char *name, const char *description)
: BugType(check, name, categories::LogicError), desc(description) {}

View File

@ -440,10 +440,10 @@ public:
if (addPosRange && Pos.hasRange()) addRange(Pos.asRange());
}
PathDiagnosticLocation getLocation() const { return Pos; }
virtual void flattenLocations() { Pos.flatten(); }
PathDiagnosticLocation getLocation() const override { return Pos; }
void flattenLocations() override { Pos.flatten(); }
virtual void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
static bool classof(const PathDiagnosticPiece *P) {
return P->getKind() == Event || P->getKind() == Macro;
@ -479,7 +479,7 @@ public:
/// \brief Search the call expression for the symbol Sym and dispatch the
/// 'getMessageForX()' methods to construct a specific message.
virtual std::string getMessage(const ExplodedNode *N);
std::string getMessage(const ExplodedNode *N) override;
/// Produces the message of the following form:
/// 'Msg via Nth parameter'
@ -534,7 +534,7 @@ public:
return "";
}
virtual void dump() const;
void dump() const override;
static inline bool classof(const PathDiagnosticPiece *P) {
return P->getKind() == Event;
@ -580,7 +580,7 @@ public:
CallStackMessage = st;
}
virtual PathDiagnosticLocation getLocation() const {
PathDiagnosticLocation getLocation() const override {
return callEnter;
}
@ -589,7 +589,7 @@ public:
getCallEnterWithinCallerEvent() const;
IntrusiveRefCntPtr<PathDiagnosticEventPiece> getCallExitEvent() const;
virtual void flattenLocations() {
void flattenLocations() override {
callEnter.flatten();
callReturn.flatten();
for (PathPieces::iterator I = path.begin(),
@ -602,10 +602,10 @@ public:
static PathDiagnosticCallPiece *construct(PathPieces &pieces,
const Decl *caller);
virtual void dump() const;
virtual void Profile(llvm::FoldingSetNodeID &ID) const;
void dump() const override;
void Profile(llvm::FoldingSetNodeID &ID) const override;
static inline bool classof(const PathDiagnosticPiece *P) {
return P->getKind() == Call;
@ -652,7 +652,7 @@ public:
void push_back(const PathDiagnosticLocationPair &X) { LPairs.push_back(X); }
virtual PathDiagnosticLocation getLocation() const {
PathDiagnosticLocation getLocation() const override {
return getStartLocation();
}
@ -660,7 +660,7 @@ public:
iterator begin() { return LPairs.begin(); }
iterator end() { return LPairs.end(); }
virtual void flattenLocations() {
void flattenLocations() override {
for (iterator I=begin(), E=end(); I!=E; ++I) I->flatten();
}
@ -673,9 +673,9 @@ public:
return P->getKind() == ControlFlow;
}
virtual void dump() const;
void dump() const override;
virtual void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
};
class PathDiagnosticMacroPiece : public PathDiagnosticSpotPiece {
@ -689,7 +689,7 @@ public:
bool containsEvent() const;
virtual void flattenLocations() {
void flattenLocations() override {
PathDiagnosticSpotPiece::flattenLocations();
for (PathPieces::iterator I = subPieces.begin(),
E = subPieces.end(); I != E; ++I) (*I)->flattenLocations();
@ -699,9 +699,9 @@ public:
return P->getKind() == Macro;
}
virtual void dump() const;
void dump() const override;
virtual void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
};
/// PathDiagnostic - PathDiagnostic objects represent a single path-sensitive

View File

@ -457,7 +457,7 @@ class CheckerBase : public ProgramPointTag {
friend class ::clang::ento::CheckerManager;
public:
StringRef getTagDescription() const;
StringRef getTagDescription() const override;
CheckName getCheckName() const;
/// See CheckerManager::runCheckersForPrintState.

View File

@ -65,8 +65,8 @@ public:
StoreManagerCreator getStoreManagerCreator() {
return CreateStoreMgr;
}
AnalyzerOptions& getAnalyzerOptions() {
AnalyzerOptions& getAnalyzerOptions() override {
return options;
}
@ -76,15 +76,15 @@ public:
CheckerManager *getCheckerManager() const { return CheckerMgr; }
virtual ASTContext &getASTContext() {
ASTContext &getASTContext() override {
return Ctx;
}
virtual SourceManager &getSourceManager() {
SourceManager &getSourceManager() override {
return getASTContext().getSourceManager();
}
virtual DiagnosticsEngine &getDiagnostic() {
DiagnosticsEngine &getDiagnostic() override {
return Diags;
}
@ -92,7 +92,7 @@ public:
return LangOpts;
}
ArrayRef<PathDiagnosticConsumer*> getPathDiagnosticConsumers() {
ArrayRef<PathDiagnosticConsumer*> getPathDiagnosticConsumers() override {
return PathConsumers;
}

View File

@ -390,11 +390,11 @@ protected:
public:
// This function is overridden by subclasses, but they must return
// a FunctionDecl.
virtual const FunctionDecl *getDecl() const {
const FunctionDecl *getDecl() const override {
return cast<FunctionDecl>(CallEvent::getDecl());
}
virtual RuntimeDefinition getRuntimeDefinition() const {
RuntimeDefinition getRuntimeDefinition() const override {
const FunctionDecl *FD = getDecl();
// Note that the AnalysisDeclContext will have the FunctionDecl with
// the definition (if one exists).
@ -409,12 +409,12 @@ public:
return RuntimeDefinition();
}
virtual bool argumentsMayEscape() const;
bool argumentsMayEscape() const override;
virtual void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const;
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const override;
virtual ArrayRef<ParmVarDecl *> parameters() const;
ArrayRef<ParmVarDecl *> parameters() const override;
static bool classof(const CallEvent *CA) {
return CA->getKind() >= CE_BEG_FUNCTION_CALLS &&
@ -434,7 +434,7 @@ protected:
: AnyFunctionCall(CE, St, LCtx) {}
SimpleFunctionCall(const SimpleFunctionCall &Other)
: AnyFunctionCall(Other) {}
virtual void cloneTo(void *Dest) const {
void cloneTo(void *Dest) const override {
new (Dest) SimpleFunctionCall(*this);
}
@ -443,15 +443,15 @@ public:
return cast<CallExpr>(AnyFunctionCall::getOriginExpr());
}
virtual const FunctionDecl *getDecl() const;
const FunctionDecl *getDecl() const override;
virtual unsigned getNumArgs() const { return getOriginExpr()->getNumArgs(); }
unsigned getNumArgs() const override { return getOriginExpr()->getNumArgs(); }
virtual const Expr *getArgExpr(unsigned Index) const {
const Expr *getArgExpr(unsigned Index) const override {
return getOriginExpr()->getArg(Index);
}
virtual Kind getKind() const { return CE_Function; }
Kind getKind() const override { return CE_Function; }
static bool classof(const CallEvent *CA) {
return CA->getKind() == CE_Function;
@ -470,18 +470,18 @@ protected:
: CallEvent(CE, St, LCtx) {}
BlockCall(const BlockCall &Other) : CallEvent(Other) {}
virtual void cloneTo(void *Dest) const { new (Dest) BlockCall(*this); }
void cloneTo(void *Dest) const override { new (Dest) BlockCall(*this); }
virtual void getExtraInvalidatedValues(ValueList &Values) const;
void getExtraInvalidatedValues(ValueList &Values) const override;
public:
virtual const CallExpr *getOriginExpr() const {
return cast<CallExpr>(CallEvent::getOriginExpr());
}
virtual unsigned getNumArgs() const { return getOriginExpr()->getNumArgs(); }
unsigned getNumArgs() const override { return getOriginExpr()->getNumArgs(); }
virtual const Expr *getArgExpr(unsigned Index) const {
const Expr *getArgExpr(unsigned Index) const override {
return getOriginExpr()->getArg(Index);
}
@ -490,27 +490,27 @@ public:
/// This may be NULL if the block's origin is unknown.
const BlockDataRegion *getBlockRegion() const;
virtual const BlockDecl *getDecl() const {
const BlockDecl *getDecl() const override {
const BlockDataRegion *BR = getBlockRegion();
if (!BR)
return 0;
return BR->getDecl();
}
virtual RuntimeDefinition getRuntimeDefinition() const {
RuntimeDefinition getRuntimeDefinition() const override {
return RuntimeDefinition(getDecl());
}
virtual bool argumentsMayEscape() const {
bool argumentsMayEscape() const override {
return true;
}
virtual void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const;
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const override;
virtual ArrayRef<ParmVarDecl*> parameters() const;
ArrayRef<ParmVarDecl*> parameters() const override;
virtual Kind getKind() const { return CE_Block; }
Kind getKind() const override { return CE_Block; }
static bool classof(const CallEvent *CA) {
return CA->getKind() == CE_Block;
@ -521,7 +521,7 @@ public:
/// it is written.
class CXXInstanceCall : public AnyFunctionCall {
protected:
virtual void getExtraInvalidatedValues(ValueList &Values) const;
void getExtraInvalidatedValues(ValueList &Values) const override;
CXXInstanceCall(const CallExpr *CE, ProgramStateRef St,
const LocationContext *LCtx)
@ -540,12 +540,12 @@ public:
/// \brief Returns the value of the implicit 'this' object.
virtual SVal getCXXThisVal() const;
virtual const FunctionDecl *getDecl() const;
const FunctionDecl *getDecl() const override;
virtual RuntimeDefinition getRuntimeDefinition() const;
RuntimeDefinition getRuntimeDefinition() const override;
virtual void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const;
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const override;
static bool classof(const CallEvent *CA) {
return CA->getKind() >= CE_BEG_CXX_INSTANCE_CALLS &&
@ -565,28 +565,28 @@ protected:
: CXXInstanceCall(CE, St, LCtx) {}
CXXMemberCall(const CXXMemberCall &Other) : CXXInstanceCall(Other) {}
virtual void cloneTo(void *Dest) const { new (Dest) CXXMemberCall(*this); }
void cloneTo(void *Dest) const override { new (Dest) CXXMemberCall(*this); }
public:
virtual const CXXMemberCallExpr *getOriginExpr() const {
return cast<CXXMemberCallExpr>(CXXInstanceCall::getOriginExpr());
}
virtual unsigned getNumArgs() const {
unsigned getNumArgs() const override {
if (const CallExpr *CE = getOriginExpr())
return CE->getNumArgs();
return 0;
}
virtual const Expr *getArgExpr(unsigned Index) const {
const Expr *getArgExpr(unsigned Index) const override {
return getOriginExpr()->getArg(Index);
}
virtual const Expr *getCXXThisExpr() const;
virtual RuntimeDefinition getRuntimeDefinition() const;
const Expr *getCXXThisExpr() const override;
virtual Kind getKind() const { return CE_CXXMember; }
RuntimeDefinition getRuntimeDefinition() const override;
Kind getKind() const override { return CE_CXXMember; }
static bool classof(const CallEvent *CA) {
return CA->getKind() == CE_CXXMember;
@ -607,7 +607,7 @@ protected:
CXXMemberOperatorCall(const CXXMemberOperatorCall &Other)
: CXXInstanceCall(Other) {}
virtual void cloneTo(void *Dest) const {
void cloneTo(void *Dest) const override {
new (Dest) CXXMemberOperatorCall(*this);
}
@ -616,16 +616,16 @@ public:
return cast<CXXOperatorCallExpr>(CXXInstanceCall::getOriginExpr());
}
virtual unsigned getNumArgs() const {
unsigned getNumArgs() const override {
return getOriginExpr()->getNumArgs() - 1;
}
virtual const Expr *getArgExpr(unsigned Index) const {
const Expr *getArgExpr(unsigned Index) const override {
return getOriginExpr()->getArg(Index + 1);
}
virtual const Expr *getCXXThisExpr() const;
const Expr *getCXXThisExpr() const override;
virtual Kind getKind() const { return CE_CXXMemberOperator; }
Kind getKind() const override { return CE_CXXMemberOperator; }
static bool classof(const CallEvent *CA) {
return CA->getKind() == CE_CXXMemberOperator;
@ -658,23 +658,23 @@ protected:
}
CXXDestructorCall(const CXXDestructorCall &Other) : CXXInstanceCall(Other) {}
virtual void cloneTo(void *Dest) const { new (Dest) CXXDestructorCall(*this); }
void cloneTo(void *Dest) const override {new (Dest) CXXDestructorCall(*this);}
public:
virtual SourceRange getSourceRange() const { return Location; }
virtual unsigned getNumArgs() const { return 0; }
SourceRange getSourceRange() const override { return Location; }
unsigned getNumArgs() const override { return 0; }
virtual RuntimeDefinition getRuntimeDefinition() const;
RuntimeDefinition getRuntimeDefinition() const override;
/// \brief Returns the value of the implicit 'this' object.
virtual SVal getCXXThisVal() const;
SVal getCXXThisVal() const override;
/// Returns true if this is a call to a base class destructor.
bool isBaseDestructor() const {
return DtorDataTy::getFromOpaqueValue(Data).getInt();
}
virtual Kind getKind() const { return CE_CXXDestructor; }
Kind getKind() const override { return CE_CXXDestructor; }
static bool classof(const CallEvent *CA) {
return CA->getKind() == CE_CXXDestructor;
@ -702,32 +702,32 @@ protected:
}
CXXConstructorCall(const CXXConstructorCall &Other) : AnyFunctionCall(Other){}
virtual void cloneTo(void *Dest) const { new (Dest) CXXConstructorCall(*this); }
void cloneTo(void *Dest) const override { new (Dest) CXXConstructorCall(*this); }
virtual void getExtraInvalidatedValues(ValueList &Values) const;
void getExtraInvalidatedValues(ValueList &Values) const override;
public:
virtual const CXXConstructExpr *getOriginExpr() const {
return cast<CXXConstructExpr>(AnyFunctionCall::getOriginExpr());
}
virtual const CXXConstructorDecl *getDecl() const {
const CXXConstructorDecl *getDecl() const override {
return getOriginExpr()->getConstructor();
}
virtual unsigned getNumArgs() const { return getOriginExpr()->getNumArgs(); }
unsigned getNumArgs() const override { return getOriginExpr()->getNumArgs(); }
virtual const Expr *getArgExpr(unsigned Index) const {
const Expr *getArgExpr(unsigned Index) const override {
return getOriginExpr()->getArg(Index);
}
/// \brief Returns the value of the implicit 'this' object.
SVal getCXXThisVal() const;
virtual void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const;
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const override;
virtual Kind getKind() const { return CE_CXXConstructor; }
Kind getKind() const override { return CE_CXXConstructor; }
static bool classof(const CallEvent *CA) {
return CA->getKind() == CE_CXXConstructor;
@ -746,29 +746,29 @@ protected:
: AnyFunctionCall(E, St, LCtx) {}
CXXAllocatorCall(const CXXAllocatorCall &Other) : AnyFunctionCall(Other) {}
virtual void cloneTo(void *Dest) const { new (Dest) CXXAllocatorCall(*this); }
void cloneTo(void *Dest) const override { new (Dest) CXXAllocatorCall(*this); }
public:
virtual const CXXNewExpr *getOriginExpr() const {
return cast<CXXNewExpr>(AnyFunctionCall::getOriginExpr());
}
virtual const FunctionDecl *getDecl() const {
const FunctionDecl *getDecl() const override {
return getOriginExpr()->getOperatorNew();
}
virtual unsigned getNumArgs() const {
unsigned getNumArgs() const override {
return getOriginExpr()->getNumPlacementArgs() + 1;
}
virtual const Expr *getArgExpr(unsigned Index) const {
const Expr *getArgExpr(unsigned Index) const override {
// The first argument of an allocator call is the size of the allocation.
if (Index == 0)
return 0;
return getOriginExpr()->getPlacementArg(Index - 1);
}
virtual Kind getKind() const { return CE_CXXAllocator; }
Kind getKind() const override { return CE_CXXAllocator; }
static bool classof(const CallEvent *CE) {
return CE->getKind() == CE_CXXAllocator;
@ -801,9 +801,9 @@ protected:
}
ObjCMethodCall(const ObjCMethodCall &Other) : CallEvent(Other) {}
virtual void cloneTo(void *Dest) const { new (Dest) ObjCMethodCall(*this); }
void cloneTo(void *Dest) const override { new (Dest) ObjCMethodCall(*this); }
virtual void getExtraInvalidatedValues(ValueList &Values) const;
void getExtraInvalidatedValues(ValueList &Values) const override;
/// Check if the selector may have multiple definitions (may have overrides).
virtual bool canBeOverridenInSubclass(ObjCInterfaceDecl *IDecl,
@ -813,13 +813,13 @@ public:
virtual const ObjCMessageExpr *getOriginExpr() const {
return cast<ObjCMessageExpr>(CallEvent::getOriginExpr());
}
virtual const ObjCMethodDecl *getDecl() const {
const ObjCMethodDecl *getDecl() const override {
return getOriginExpr()->getMethodDecl();
}
virtual unsigned getNumArgs() const {
unsigned getNumArgs() const override {
return getOriginExpr()->getNumArgs();
}
virtual const Expr *getArgExpr(unsigned Index) const {
const Expr *getArgExpr(unsigned Index) const override {
return getOriginExpr()->getArg(Index);
}
@ -833,7 +833,7 @@ public:
return getOriginExpr()->getSelector();
}
virtual SourceRange getSourceRange() const;
SourceRange getSourceRange() const override;
/// \brief Returns the value of the receiver at the time of this call.
SVal getReceiverSVal() const;
@ -870,16 +870,16 @@ public:
llvm_unreachable("Unknown message kind");
}
virtual RuntimeDefinition getRuntimeDefinition() const;
RuntimeDefinition getRuntimeDefinition() const override;
virtual bool argumentsMayEscape() const;
bool argumentsMayEscape() const override;
virtual void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const;
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
BindingsTy &Bindings) const override;
virtual ArrayRef<ParmVarDecl*> parameters() const;
ArrayRef<ParmVarDecl*> parameters() const override;
virtual Kind getKind() const { return CE_ObjCMessage; }
Kind getKind() const override { return CE_ObjCMessage; }
static bool classof(const CallEvent *CA) {
return CA->getKind() == CE_ObjCMessage;

View File

@ -312,7 +312,7 @@ public:
/// \class NodeBuilderWithSinks
/// \brief This node builder keeps track of the generated sink nodes.
class NodeBuilderWithSinks: public NodeBuilder {
virtual void anchor();
void anchor() override;
protected:
SmallVector<ExplodedNode*, 2> sinksGenerated;
ProgramPoint &Location;
@ -399,7 +399,7 @@ public:
/// \brief BranchNodeBuilder is responsible for constructing the nodes
/// corresponding to the two branches of the if statement - true and false.
class BranchNodeBuilder: public NodeBuilder {
virtual void anchor();
void anchor() override;
const CFGBlock *DstT;
const CFGBlock *DstF;

View File

@ -122,7 +122,7 @@ public:
/// getContext - Return the ASTContext associated with this analysis.
ASTContext &getContext() const { return AMgr.getASTContext(); }
virtual AnalysisManager &getAnalysisManager() { return AMgr; }
AnalysisManager &getAnalysisManager() override { return AMgr; }
CheckerManager &getCheckerManager() const {
return *AMgr.getCheckerManager();
@ -154,7 +154,7 @@ public:
/// getInitialState - Return the initial state used for the root vertex
/// in the ExplodedGraph.
ProgramStateRef getInitialState(const LocationContext *InitLoc);
ProgramStateRef getInitialState(const LocationContext *InitLoc) override;
ExplodedGraph& getGraph() { return G; }
const ExplodedGraph& getGraph() const { return G; }
@ -192,7 +192,7 @@ public:
/// processCFGElement - Called by CoreEngine. Used to generate new successor
/// nodes by processing the 'effects' of a CFG element.
void processCFGElement(const CFGElement E, ExplodedNode *Pred,
unsigned StmtIdx, NodeBuilderContext *Ctx);
unsigned StmtIdx, NodeBuilderContext *Ctx) override;
void ProcessStmt(const CFGStmt S, ExplodedNode *Pred);
@ -214,10 +214,10 @@ public:
ExplodedNode *Pred, ExplodedNodeSet &Dst);
/// Called by CoreEngine when processing the entrance of a CFGBlock.
virtual void processCFGBlockEntrance(const BlockEdge &L,
NodeBuilderWithSinks &nodeBuilder,
ExplodedNode *Pred);
void processCFGBlockEntrance(const BlockEdge &L,
NodeBuilderWithSinks &nodeBuilder,
ExplodedNode *Pred) override;
/// ProcessBranch - Called by CoreEngine. Used to generate successor
/// nodes by processing the 'effects' of a branch condition.
void processBranch(const Stmt *Condition, const Stmt *Term,
@ -225,7 +225,7 @@ public:
ExplodedNode *Pred,
ExplodedNodeSet &Dst,
const CFGBlock *DstT,
const CFGBlock *DstF);
const CFGBlock *DstF) override;
/// Called by CoreEngine. Used to processing branching behavior
/// at static initalizers.
@ -234,20 +234,20 @@ public:
ExplodedNode *Pred,
ExplodedNodeSet &Dst,
const CFGBlock *DstT,
const CFGBlock *DstF);
const CFGBlock *DstF) override;
/// processIndirectGoto - Called by CoreEngine. Used to generate successor
/// nodes by processing the 'effects' of a computed goto jump.
void processIndirectGoto(IndirectGotoNodeBuilder& builder);
void processIndirectGoto(IndirectGotoNodeBuilder& builder) override;
/// ProcessSwitch - Called by CoreEngine. Used to generate successor
/// nodes by processing the 'effects' of a switch statement.
void processSwitch(SwitchNodeBuilder& builder);
void processSwitch(SwitchNodeBuilder& builder) override;
/// Called by CoreEngine. Used to generate end-of-path
/// nodes when the control reaches the end of a function.
void processEndOfFunction(NodeBuilderContext& BC,
ExplodedNode *Pred);
ExplodedNode *Pred) override;
/// Remove dead bindings/symbols before exiting a function.
void removeDeadOnEndOfFunction(NodeBuilderContext& BC,
@ -255,22 +255,23 @@ public:
ExplodedNodeSet &Dst);
/// Generate the entry node of the callee.
void processCallEnter(CallEnter CE, ExplodedNode *Pred);
void processCallEnter(CallEnter CE, ExplodedNode *Pred) override;
/// Generate the sequence of nodes that simulate the call exit and the post
/// visit for CallExpr.
void processCallExit(ExplodedNode *Pred);
void processCallExit(ExplodedNode *Pred) override;
/// Called by CoreEngine when the analysis worklist has terminated.
void processEndWorklist(bool hasWorkRemaining);
void processEndWorklist(bool hasWorkRemaining) override;
/// evalAssume - Callback function invoked by the ConstraintManager when
/// making assumptions about state values.
ProgramStateRef processAssume(ProgramStateRef state, SVal cond,bool assumption);
ProgramStateRef processAssume(ProgramStateRef state, SVal cond,
bool assumption) override;
/// wantsRegionChangeUpdate - Called by ProgramStateManager to determine if a
/// region change should trigger a processRegionChanges update.
bool wantsRegionChangeUpdate(ProgramStateRef state);
bool wantsRegionChangeUpdate(ProgramStateRef state) override;
/// processRegionChanges - Called by ProgramStateManager whenever a change is made
/// to the store. Used to update checkers that track region values.
@ -279,13 +280,13 @@ public:
const InvalidatedSymbols *invalidated,
ArrayRef<const MemRegion *> ExplicitRegions,
ArrayRef<const MemRegion *> Regions,
const CallEvent *Call);
const CallEvent *Call) override;
/// printState - Called by ProgramStateManager to print checker-specific data.
void printState(raw_ostream &Out, ProgramStateRef State,
const char *NL, const char *Sep);
const char *NL, const char *Sep) override;
virtual ProgramStateManager& getStateManager() { return StateMgr; }
ProgramStateManager& getStateManager() override { return StateMgr; }
StoreManager& getStoreManager() { return StateMgr.getStoreManager(); }
@ -480,17 +481,17 @@ protected:
/// Call PointerEscape callback when a value escapes as a result of bind.
ProgramStateRef processPointerEscapedOnBind(ProgramStateRef State,
SVal Loc, SVal Val);
SVal Loc, SVal Val) override;
/// Call PointerEscape callback when a value escapes as a result of
/// region invalidation.
/// \param[in] ITraits Specifies invalidation traits for regions/symbols.
ProgramStateRef notifyCheckersOfPointerEscape(
ProgramStateRef State,
const InvalidatedSymbols *Invalidated,
ArrayRef<const MemRegion *> ExplicitRegions,
ArrayRef<const MemRegion *> Regions,
const CallEvent *Call,
RegionAndSymbolInvalidationTraits &ITraits);
ProgramStateRef State,
const InvalidatedSymbols *Invalidated,
ArrayRef<const MemRegion *> ExplicitRegions,
ArrayRef<const MemRegion *> Regions,
const CallEvent *Call,
RegionAndSymbolInvalidationTraits &ITraits) override;
public:
// FIXME: 'tag' should be removed, and a LocationContext should be used

View File

@ -204,12 +204,12 @@ protected:
assert(classof(this));
}
MemRegionManager* getMemRegionManager() const { return Mgr; }
MemRegionManager* getMemRegionManager() const override { return Mgr; }
public:
bool isBoundable() const { return false; }
void Profile(llvm::FoldingSetNodeID &ID) const;
bool isBoundable() const override { return false; }
void Profile(llvm::FoldingSetNodeID &ID) const override;
static bool classof(const MemRegion *R) {
Kind k = R->getKind();
@ -243,9 +243,9 @@ class StaticGlobalSpaceRegion : public GlobalsSpaceRegion {
: GlobalsSpaceRegion(mgr, StaticGlobalSpaceRegionKind), CR(cr) {}
public:
void Profile(llvm::FoldingSetNodeID &ID) const;
void dumpToStream(raw_ostream &os) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
void dumpToStream(raw_ostream &os) const override;
const CodeTextRegion *getCodeRegion() const { return CR; }
@ -286,7 +286,7 @@ class GlobalSystemSpaceRegion : public NonStaticGlobalSpaceRegion {
public:
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion *R) {
return R->getKind() == GlobalSystemSpaceRegionKind;
@ -306,7 +306,7 @@ class GlobalImmutableSpaceRegion : public NonStaticGlobalSpaceRegion {
public:
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion *R) {
return R->getKind() == GlobalImmutableSpaceRegionKind;
@ -324,7 +324,7 @@ class GlobalInternalSpaceRegion : public NonStaticGlobalSpaceRegion {
public:
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion *R) {
return R->getKind() == GlobalInternalSpaceRegionKind;
@ -339,7 +339,7 @@ class HeapSpaceRegion : public MemSpaceRegion {
: MemSpaceRegion(mgr, HeapSpaceRegionKind) {}
public:
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion *R) {
return R->getKind() == HeapSpaceRegionKind;
@ -353,7 +353,7 @@ class UnknownSpaceRegion : public MemSpaceRegion {
: MemSpaceRegion(mgr, UnknownSpaceRegionKind) {}
public:
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion *R) {
return R->getKind() == UnknownSpaceRegionKind;
@ -373,7 +373,7 @@ protected:
public:
const StackFrameContext *getStackFrame() const { return SFC; }
void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
static bool classof(const MemRegion *R) {
Kind k = R->getKind();
@ -389,7 +389,7 @@ class StackLocalsSpaceRegion : public StackSpaceRegion {
: StackSpaceRegion(mgr, StackLocalsSpaceRegionKind, sfc) {}
public:
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion *R) {
return R->getKind() == StackLocalsSpaceRegionKind;
@ -404,7 +404,7 @@ private:
: StackSpaceRegion(mgr, StackArgumentsSpaceRegionKind, sfc) {}
public:
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion *R) {
return R->getKind() == StackArgumentsSpaceRegionKind;
@ -430,9 +430,9 @@ public:
return UnknownVal();
}
MemRegionManager* getMemRegionManager() const;
MemRegionManager* getMemRegionManager() const override;
virtual bool isSubRegionOf(const MemRegion* R) const;
bool isSubRegionOf(const MemRegion* R) const override;
static bool classof(const MemRegion* R) {
return R->getKind() > END_MEMSPACES;
@ -459,16 +459,16 @@ public:
const Expr *getExpr() const { return Ex; }
bool isBoundable() const { return true; }
bool isBoundable() const override { return true; }
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const;
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override;
void Profile(llvm::FoldingSetNodeID& ID) const;
void Profile(llvm::FoldingSetNodeID& ID) const override;
static void ProfileRegion(llvm::FoldingSetNodeID& ID, const Expr *Ex,
unsigned Cnt, const MemRegion *superRegion);
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == AllocaRegionKind;
@ -478,7 +478,7 @@ public:
/// TypedRegion - An abstract class representing regions that are typed.
class TypedRegion : public SubRegion {
public:
virtual void anchor();
void anchor() override;
protected:
TypedRegion(const MemRegion* sReg, Kind k) : SubRegion(sReg, k) {}
@ -489,7 +489,7 @@ public:
return getLocationType().getDesugaredType(Context);
}
bool isBoundable() const { return true; }
bool isBoundable() const override { return true; }
static bool classof(const MemRegion* R) {
unsigned k = R->getKind();
@ -500,14 +500,14 @@ public:
/// TypedValueRegion - An abstract class representing regions having a typed value.
class TypedValueRegion : public TypedRegion {
public:
virtual void anchor();
void anchor() override;
protected:
TypedValueRegion(const MemRegion* sReg, Kind k) : TypedRegion(sReg, k) {}
public:
virtual QualType getValueType() const = 0;
virtual QualType getLocationType() const {
QualType getLocationType() const override {
// FIXME: We can possibly optimize this later to cache this value.
QualType T = getValueType();
ASTContext &ctx = getContext();
@ -521,7 +521,7 @@ public:
return T.getTypePtrOrNull() ? T.getDesugaredType(Context) : T;
}
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const;
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override;
static bool classof(const MemRegion* R) {
unsigned k = R->getKind();
@ -532,12 +532,12 @@ public:
class CodeTextRegion : public TypedRegion {
public:
virtual void anchor();
void anchor() override;
protected:
CodeTextRegion(const MemRegion *sreg, Kind k) : TypedRegion(sreg, k) {}
public:
bool isBoundable() const { return false; }
bool isBoundable() const override { return false; }
static bool classof(const MemRegion* R) {
Kind k = R->getKind();
return k >= FunctionTextRegionKind && k <= BlockTextRegionKind;
@ -552,8 +552,8 @@ public:
: CodeTextRegion(sreg, FunctionTextRegionKind), FD(fd) {
assert(isa<ObjCMethodDecl>(fd) || isa<FunctionDecl>(fd));
}
QualType getLocationType() const {
QualType getLocationType() const override {
const ASTContext &Ctx = getContext();
if (const FunctionDecl *D = dyn_cast<FunctionDecl>(FD)) {
return Ctx.getPointerType(D->getType());
@ -570,11 +570,11 @@ public:
const NamedDecl *getDecl() const {
return FD;
}
virtual void dumpToStream(raw_ostream &os) const;
void Profile(llvm::FoldingSetNodeID& ID) const;
void dumpToStream(raw_ostream &os) const override;
void Profile(llvm::FoldingSetNodeID& ID) const override;
static void ProfileRegion(llvm::FoldingSetNodeID& ID, const NamedDecl *FD,
const MemRegion*);
@ -602,7 +602,7 @@ class BlockTextRegion : public CodeTextRegion {
: CodeTextRegion(sreg, BlockTextRegionKind), BD(bd), AC(ac), locTy(lTy) {}
public:
QualType getLocationType() const {
QualType getLocationType() const override {
return locTy;
}
@ -611,11 +611,11 @@ public:
}
AnalysisDeclContext *getAnalysisDeclContext() const { return AC; }
virtual void dumpToStream(raw_ostream &os) const;
void Profile(llvm::FoldingSetNodeID& ID) const;
virtual void dumpToStream(raw_ostream &os) const override;
void Profile(llvm::FoldingSetNodeID& ID) const override;
static void ProfileRegion(llvm::FoldingSetNodeID& ID, const BlockDecl *BD,
CanQualType, const AnalysisDeclContext*,
const MemRegion*);
@ -650,8 +650,8 @@ public:
const BlockDecl *getDecl() const { return BC->getDecl(); }
QualType getLocationType() const { return BC->getLocationType(); }
QualType getLocationType() const override { return BC->getLocationType(); }
class referenced_vars_iterator {
const MemRegion * const *R;
const MemRegion * const *OriginalR;
@ -688,11 +688,11 @@ public:
referenced_vars_iterator referenced_vars_begin() const;
referenced_vars_iterator referenced_vars_end() const;
virtual void dumpToStream(raw_ostream &os) const;
void Profile(llvm::FoldingSetNodeID& ID) const;
void dumpToStream(raw_ostream &os) const override;
void Profile(llvm::FoldingSetNodeID& ID) const override;
static void ProfileRegion(llvm::FoldingSetNodeID&, const BlockTextRegion *,
const LocationContext *, unsigned,
const MemRegion *);
@ -723,17 +723,17 @@ public:
return sym;
}
bool isBoundable() const { return true; }
bool isBoundable() const override { return true; }
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const;
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override;
void Profile(llvm::FoldingSetNodeID& ID) const;
void Profile(llvm::FoldingSetNodeID& ID) const override;
static void ProfileRegion(llvm::FoldingSetNodeID& ID,
SymbolRef sym,
const MemRegion* superRegion);
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == SymbolicRegionKind;
@ -757,19 +757,19 @@ public:
const StringLiteral* getStringLiteral() const { return Str; }
QualType getValueType() const {
QualType getValueType() const override {
return Str->getType();
}
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const;
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override;
bool isBoundable() const { return false; }
bool isBoundable() const override { return false; }
void Profile(llvm::FoldingSetNodeID& ID) const {
void Profile(llvm::FoldingSetNodeID& ID) const override {
ProfileRegion(ID, Str, superRegion);
}
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == StringRegionKind;
@ -792,19 +792,19 @@ protected:
public:
const ObjCStringLiteral* getObjCStringLiteral() const { return Str; }
QualType getValueType() const {
QualType getValueType() const override {
return Str->getType();
}
bool isBoundable() const { return false; }
void Profile(llvm::FoldingSetNodeID& ID) const {
bool isBoundable() const override { return false; }
void Profile(llvm::FoldingSetNodeID& ID) const override {
ProfileRegion(ID, Str, superRegion);
}
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == ObjCStringRegionKind;
}
@ -825,15 +825,15 @@ private:
const CompoundLiteralExpr *CL,
const MemRegion* superRegion);
public:
QualType getValueType() const {
QualType getValueType() const override {
return CL->getType();
}
bool isBoundable() const { return !CL->isFileScope(); }
bool isBoundable() const override { return !CL->isFileScope(); }
void Profile(llvm::FoldingSetNodeID& ID) const;
void Profile(llvm::FoldingSetNodeID& ID) const override;
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
const CompoundLiteralExpr *getLiteralExpr() const { return CL; }
@ -854,7 +854,7 @@ protected:
public:
const Decl *getDecl() const { return D; }
void Profile(llvm::FoldingSetNodeID& ID) const;
void Profile(llvm::FoldingSetNodeID& ID) const override;
static bool classof(const MemRegion* R) {
unsigned k = R->getKind();
@ -874,27 +874,27 @@ class VarRegion : public DeclRegion {
DeclRegion::ProfileRegion(ID, VD, superRegion, VarRegionKind);
}
void Profile(llvm::FoldingSetNodeID& ID) const;
void Profile(llvm::FoldingSetNodeID& ID) const override;
public:
const VarDecl *getDecl() const { return cast<VarDecl>(D); }
const StackFrameContext *getStackFrame() const;
QualType getValueType() const {
QualType getValueType() const override {
// FIXME: We can cache this if needed.
return getDecl()->getType();
}
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == VarRegionKind;
}
bool canPrintPrettyAsExpr() const;
bool canPrintPrettyAsExpr() const override;
void printPrettyAsExpr(raw_ostream &os) const;
void printPrettyAsExpr(raw_ostream &os) const override;
};
/// CXXThisRegion - Represents the region for the implicit 'this' parameter
@ -910,15 +910,15 @@ class CXXThisRegion : public TypedValueRegion {
const PointerType *PT,
const MemRegion *sReg);
void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
public:
QualType getValueType() const {
public:
QualType getValueType() const override {
return QualType(ThisPointerTy, 0);
}
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == CXXThisRegionKind;
}
@ -936,12 +936,12 @@ class FieldRegion : public DeclRegion {
public:
const FieldDecl *getDecl() const { return cast<FieldDecl>(D); }
QualType getValueType() const {
QualType getValueType() const override {
// FIXME: We can cache this if needed.
return getDecl()->getType();
}
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const;
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override;
static void ProfileRegion(llvm::FoldingSetNodeID& ID, const FieldDecl *FD,
const MemRegion* superRegion) {
@ -952,12 +952,12 @@ public:
return R->getKind() == FieldRegionKind;
}
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
bool canPrintPretty() const;
void printPretty(raw_ostream &os) const;
bool canPrintPrettyAsExpr() const;
void printPrettyAsExpr(raw_ostream &os) const;
bool canPrintPretty() const override;
void printPretty(raw_ostream &os) const override;
bool canPrintPrettyAsExpr() const override;
void printPrettyAsExpr(raw_ostream &os) const override;
};
class ObjCIvarRegion : public DeclRegion {
@ -971,12 +971,12 @@ class ObjCIvarRegion : public DeclRegion {
public:
const ObjCIvarDecl *getDecl() const;
QualType getValueType() const;
QualType getValueType() const override;
bool canPrintPrettyAsExpr() const;
void printPrettyAsExpr(raw_ostream &os) const;
bool canPrintPrettyAsExpr() const override;
void printPrettyAsExpr(raw_ostream &os) const override;
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == ObjCIvarRegionKind;
@ -1029,7 +1029,7 @@ public:
NonLoc getIndex() const { return Index; }
QualType getValueType() const {
QualType getValueType() const override {
return ElementType;
}
@ -1039,9 +1039,9 @@ public:
/// Compute the offset within the array. The array might also be a subobject.
RegionRawOffset getAsArrayOffset() const;
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
void Profile(llvm::FoldingSetNodeID& ID) const;
void Profile(llvm::FoldingSetNodeID& ID) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == ElementRegionKind;
@ -1063,13 +1063,13 @@ class CXXTempObjectRegion : public TypedValueRegion {
public:
const Expr *getExpr() const { return Ex; }
QualType getValueType() const {
QualType getValueType() const override {
return Ex->getType();
}
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
static bool classof(const MemRegion* R) {
return R->getKind() == CXXTempObjectRegionKind;
@ -1094,19 +1094,19 @@ public:
const CXXRecordDecl *getDecl() const { return Data.getPointer(); }
bool isVirtual() const { return Data.getInt(); }
QualType getValueType() const;
QualType getValueType() const override;
void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
void Profile(llvm::FoldingSetNodeID &ID) const;
void Profile(llvm::FoldingSetNodeID &ID) const override;
static bool classof(const MemRegion *region) {
return region->getKind() == CXXBaseObjectRegionKind;
}
bool canPrintPrettyAsExpr() const;
void printPrettyAsExpr(raw_ostream &os) const;
bool canPrintPrettyAsExpr() const override;
void printPrettyAsExpr(raw_ostream &os) const override;
};
template<typename RegionTy>

View File

@ -223,7 +223,7 @@ public:
FindUniqueBinding(SymbolRef sym) : Sym(sym), Binding(0), First(true) {}
bool HandleBinding(StoreManager& SMgr, Store store, const MemRegion* R,
SVal val);
SVal val) override;
LLVM_EXPLICIT operator bool() { return First && Binding; }
const MemRegion *getRegion() { return Binding; }
};

View File

@ -105,7 +105,7 @@ typedef unsigned SymbolID;
/// \brief A symbol representing data which can be stored in a memory location
/// (region).
class SymbolData : public SymExpr {
virtual void anchor();
void anchor() override;
const SymbolID Sym;
protected:
@ -138,13 +138,13 @@ public:
profile.AddPointer(R);
}
virtual void Profile(llvm::FoldingSetNodeID& profile) {
void Profile(llvm::FoldingSetNodeID& profile) override {
Profile(profile, R);
}
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
QualType getType() const;
QualType getType() const override;
// Implement isa<T> support.
static inline bool classof(const SymExpr *SE) {
@ -173,9 +173,9 @@ public:
unsigned getCount() const { return Count; }
const void *getTag() const { return SymbolTag; }
QualType getType() const;
QualType getType() const override;
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static void Profile(llvm::FoldingSetNodeID& profile, const Stmt *S,
QualType T, unsigned Count, const LocationContext *LCtx,
@ -188,7 +188,7 @@ public:
profile.AddPointer(SymbolTag);
}
virtual void Profile(llvm::FoldingSetNodeID& profile) {
void Profile(llvm::FoldingSetNodeID& profile) override {
Profile(profile, S, T, Count, LCtx, SymbolTag);
}
@ -211,9 +211,9 @@ public:
SymbolRef getParentSymbol() const { return parentSymbol; }
const TypedValueRegion *getRegion() const { return R; }
QualType getType() const;
QualType getType() const override;
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static void Profile(llvm::FoldingSetNodeID& profile, SymbolRef parent,
const TypedValueRegion *r) {
@ -222,7 +222,7 @@ public:
profile.AddPointer(parent);
}
virtual void Profile(llvm::FoldingSetNodeID& profile) {
void Profile(llvm::FoldingSetNodeID& profile) override {
Profile(profile, parentSymbol, R);
}
@ -244,16 +244,16 @@ public:
const SubRegion *getRegion() const { return R; }
QualType getType() const;
QualType getType() const override;
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static void Profile(llvm::FoldingSetNodeID& profile, const SubRegion *R) {
profile.AddInteger((unsigned) ExtentKind);
profile.AddPointer(R);
}
virtual void Profile(llvm::FoldingSetNodeID& profile) {
void Profile(llvm::FoldingSetNodeID& profile) override {
Profile(profile, R);
}
@ -283,9 +283,9 @@ public:
unsigned getCount() const { return Count; }
const void *getTag() const { return Tag; }
QualType getType() const;
QualType getType() const override;
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static void Profile(llvm::FoldingSetNodeID& profile, const MemRegion *R,
const Stmt *S, QualType T, unsigned Count,
@ -298,7 +298,7 @@ public:
profile.AddPointer(Tag);
}
virtual void Profile(llvm::FoldingSetNodeID& profile) {
void Profile(llvm::FoldingSetNodeID& profile) override {
Profile(profile, R, S, T, Count, Tag);
}
@ -320,11 +320,11 @@ public:
SymbolCast(const SymExpr *In, QualType From, QualType To) :
SymExpr(CastSymbolKind), Operand(In), FromTy(From), ToTy(To) { }
QualType getType() const { return ToTy; }
QualType getType() const override { return ToTy; }
const SymExpr *getOperand() const { return Operand; }
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static void Profile(llvm::FoldingSetNodeID& ID,
const SymExpr *In, QualType From, QualType To) {
@ -334,7 +334,7 @@ public:
ID.Add(To);
}
void Profile(llvm::FoldingSetNodeID& ID) {
void Profile(llvm::FoldingSetNodeID& ID) override {
Profile(ID, Operand, FromTy, ToTy);
}
@ -356,7 +356,7 @@ protected:
public:
// FIXME: We probably need to make this out-of-line to avoid redundant
// generation of virtual functions.
QualType getType() const { return T; }
QualType getType() const override { return T; }
BinaryOperator::Opcode getOpcode() const { return Op; }
@ -377,7 +377,7 @@ public:
const llvm::APSInt& rhs, QualType t)
: BinarySymExpr(SymIntKind, op, t), LHS(lhs), RHS(rhs) {}
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
const SymExpr *getLHS() const { return LHS; }
const llvm::APSInt &getRHS() const { return RHS; }
@ -392,7 +392,7 @@ public:
ID.Add(t);
}
void Profile(llvm::FoldingSetNodeID& ID) {
void Profile(llvm::FoldingSetNodeID& ID) override {
Profile(ID, LHS, getOpcode(), RHS, getType());
}
@ -412,7 +412,7 @@ public:
const SymExpr *rhs, QualType t)
: BinarySymExpr(IntSymKind, op, t), LHS(lhs), RHS(rhs) {}
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
const SymExpr *getRHS() const { return RHS; }
const llvm::APSInt &getLHS() const { return LHS; }
@ -427,7 +427,7 @@ public:
ID.Add(t);
}
void Profile(llvm::FoldingSetNodeID& ID) {
void Profile(llvm::FoldingSetNodeID& ID) override {
Profile(ID, LHS, getOpcode(), RHS, getType());
}
@ -450,7 +450,7 @@ public:
const SymExpr *getLHS() const { return LHS; }
const SymExpr *getRHS() const { return RHS; }
virtual void dumpToStream(raw_ostream &os) const;
void dumpToStream(raw_ostream &os) const override;
static void Profile(llvm::FoldingSetNodeID& ID, const SymExpr *lhs,
BinaryOperator::Opcode op, const SymExpr *rhs, QualType t) {
@ -461,7 +461,7 @@ public:
ID.Add(t);
}
void Profile(llvm::FoldingSetNodeID& ID) {
void Profile(llvm::FoldingSetNodeID& ID) override {
Profile(ID, LHS, getOpcode(), RHS, getType());
}

View File

@ -22,8 +22,8 @@ namespace ento {
class AnalysisAction : public ASTFrontendAction {
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile);
ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override;
};
void printCheckerHelp(raw_ostream &OS, ArrayRef<std::string> plugins);

View File

@ -49,13 +49,13 @@ public:
/// This class implements ArgumentsAdjuster interface and converts input
/// command line arguments to the "syntax check only" variant.
class ClangSyntaxOnlyAdjuster : public ArgumentsAdjuster {
virtual CommandLineArguments Adjust(const CommandLineArguments &Args);
CommandLineArguments Adjust(const CommandLineArguments &Args) override;
};
/// \brief An argument adjuster which removes output-related command line
/// arguments.
class ClangStripOutputAdjuster : public ArgumentsAdjuster {
virtual CommandLineArguments Adjust(const CommandLineArguments &Args);
CommandLineArguments Adjust(const CommandLineArguments &Args) override;
};
} // end namespace tooling

View File

@ -190,19 +190,19 @@ public:
/// Will always return a vector with one entry that contains the directory
/// and command line specified at construction with "clang-tool" as argv[0]
/// and 'FilePath' as positional argument.
virtual std::vector<CompileCommand> getCompileCommands(
StringRef FilePath) const;
std::vector<CompileCommand>
getCompileCommands(StringRef FilePath) const override;
/// \brief Returns the list of all files available in the compilation database.
///
/// Note: This is always an empty list for the fixed compilation database.
virtual std::vector<std::string> getAllFiles() const;
std::vector<std::string> getAllFiles() const override;
/// \brief Returns all compile commands for all the files in the compilation
/// database.
///
/// Note: This is always an empty list for the fixed compilation database.
virtual std::vector<CompileCommand> getAllCompileCommands() const;
std::vector<CompileCommand> getAllCompileCommands() const override;
private:
/// This is built up to contain a single entry vector to be returned from

View File

@ -67,17 +67,17 @@ public:
///
/// FIXME: Currently FilePath must be an absolute path inside the
/// source directory which does not have symlinks resolved.
virtual std::vector<CompileCommand> getCompileCommands(
StringRef FilePath) const;
std::vector<CompileCommand>
getCompileCommands(StringRef FilePath) const override;
/// \brief Returns the list of all files available in the compilation database.
///
/// These are the 'file' entries of the JSON objects.
virtual std::vector<std::string> getAllFiles() const;
std::vector<std::string> getAllFiles() const override;
/// \brief Returns all compile commands for all the files in the compilation
/// database.
virtual std::vector<CompileCommand> getAllCompileCommands() const;
std::vector<CompileCommand> getAllCompileCommands() const override;
private:
/// \brief Constructs a JSON compilation database on a memory buffer.

View File

@ -52,7 +52,7 @@ protected:
class ReplaceStmtWithText : public RefactoringCallback {
public:
ReplaceStmtWithText(StringRef FromId, StringRef ToText);
virtual void run(const ast_matchers::MatchFinder::MatchResult &Result);
void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
private:
std::string FromId;
@ -64,7 +64,7 @@ private:
class ReplaceStmtWithStmt : public RefactoringCallback {
public:
ReplaceStmtWithStmt(StringRef FromId, StringRef ToId);
virtual void run(const ast_matchers::MatchFinder::MatchResult &Result);
void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
private:
std::string FromId;
@ -77,7 +77,7 @@ private:
class ReplaceIfStmtWithItsBody : public RefactoringCallback {
public:
ReplaceIfStmtWithItsBody(StringRef Id, bool PickTrueBranch);
virtual void run(const ast_matchers::MatchFinder::MatchResult &Result);
void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
private:
std::string Id;

View File

@ -80,7 +80,7 @@ public:
/// \brief Invokes the compiler with a FrontendAction created by create().
bool runInvocation(clang::CompilerInvocation *Invocation, FileManager *Files,
DiagnosticConsumer *DiagConsumer);
DiagnosticConsumer *DiagConsumer) override;
/// \brief Returns a new clang::FrontendAction.
///
@ -306,7 +306,7 @@ template <typename T>
FrontendActionFactory *newFrontendActionFactory() {
class SimpleFrontendActionFactory : public FrontendActionFactory {
public:
virtual clang::FrontendAction *create() { return new T; }
clang::FrontendAction *create() override { return new T; }
};
return new SimpleFrontendActionFactory;
@ -321,7 +321,7 @@ inline FrontendActionFactory *newFrontendActionFactory(
SourceFileCallbacks *Callbacks)
: ConsumerFactory(ConsumerFactory), Callbacks(Callbacks) {}
virtual clang::FrontendAction *create() {
clang::FrontendAction *create() override {
return new ConsumerFactoryAdaptor(ConsumerFactory, Callbacks);
}
@ -333,20 +333,20 @@ inline FrontendActionFactory *newFrontendActionFactory(
: ConsumerFactory(ConsumerFactory), Callbacks(Callbacks) {}
clang::ASTConsumer *CreateASTConsumer(clang::CompilerInstance &,
StringRef) {
StringRef) override {
return ConsumerFactory->newASTConsumer();
}
protected:
virtual bool BeginSourceFileAction(CompilerInstance &CI,
StringRef Filename) override {
bool BeginSourceFileAction(CompilerInstance &CI,
StringRef Filename) override {
if (!clang::ASTFrontendAction::BeginSourceFileAction(CI, Filename))
return false;
if (Callbacks != NULL)
return Callbacks->handleBeginSource(CI, Filename);
return true;
}
virtual void EndSourceFileAction() override {
void EndSourceFileAction() override {
if (Callbacks != NULL)
Callbacks->handleEndSource();
clang::ASTFrontendAction::EndSourceFileAction();

View File

@ -90,10 +90,9 @@ protected:
/// \c getSplit() needs to be implemented by child classes.
class BreakableSingleLineToken : public BreakableToken {
public:
virtual unsigned getLineCount() const;
virtual unsigned getLineLengthAfterSplit(unsigned LineIndex,
unsigned TailOffset,
StringRef::size_type Length) const;
unsigned getLineCount() const override;
unsigned getLineLengthAfterSplit(unsigned LineIndex, unsigned TailOffset,
StringRef::size_type Length) const override;
protected:
BreakableSingleLineToken(const FormatToken &Tok, unsigned IndentLevel,
@ -123,13 +122,12 @@ public:
StringRef Postfix, bool InPPDirective,
encoding::Encoding Encoding, const FormatStyle &Style);
virtual Split getSplit(unsigned LineIndex, unsigned TailOffset,
unsigned ColumnLimit) const;
virtual void insertBreak(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces);
virtual void replaceWhitespace(unsigned LineIndex, unsigned TailOffset,
Split Split,
WhitespaceManager &Whitespaces) {}
Split getSplit(unsigned LineIndex, unsigned TailOffset,
unsigned ColumnLimit) const override;
void insertBreak(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces) override;
void replaceWhitespace(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces) override {}
};
class BreakableLineComment : public BreakableSingleLineToken {
@ -142,15 +140,14 @@ public:
unsigned StartColumn, bool InPPDirective,
encoding::Encoding Encoding, const FormatStyle &Style);
virtual Split getSplit(unsigned LineIndex, unsigned TailOffset,
unsigned ColumnLimit) const;
virtual void insertBreak(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces);
virtual void replaceWhitespace(unsigned LineIndex, unsigned TailOffset,
Split Split,
WhitespaceManager &Whitespaces);
virtual void replaceWhitespaceBefore(unsigned LineIndex,
WhitespaceManager &Whitespaces);
Split getSplit(unsigned LineIndex, unsigned TailOffset,
unsigned ColumnLimit) const override;
void insertBreak(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces) override;
void replaceWhitespace(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces) override;
void replaceWhitespaceBefore(unsigned LineIndex,
WhitespaceManager &Whitespaces) override;
private:
// The prefix without an additional space if one was added.
@ -170,19 +167,17 @@ public:
bool FirstInLine, bool InPPDirective,
encoding::Encoding Encoding, const FormatStyle &Style);
virtual unsigned getLineCount() const;
virtual unsigned getLineLengthAfterSplit(unsigned LineIndex,
unsigned TailOffset,
StringRef::size_type Length) const;
virtual Split getSplit(unsigned LineIndex, unsigned TailOffset,
unsigned ColumnLimit) const;
virtual void insertBreak(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces);
virtual void replaceWhitespace(unsigned LineIndex, unsigned TailOffset,
Split Split,
WhitespaceManager &Whitespaces);
virtual void replaceWhitespaceBefore(unsigned LineIndex,
WhitespaceManager &Whitespaces);
unsigned getLineCount() const override;
unsigned getLineLengthAfterSplit(unsigned LineIndex, unsigned TailOffset,
StringRef::size_type Length) const override;
Split getSplit(unsigned LineIndex, unsigned TailOffset,
unsigned ColumnLimit) const override;
void insertBreak(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces) override;
void replaceWhitespace(unsigned LineIndex, unsigned TailOffset, Split Split,
WhitespaceManager &Whitespaces) override;
void replaceWhitespaceBefore(unsigned LineIndex,
WhitespaceManager &Whitespaces) override;
private:
// Rearranges the whitespace between Lines[LineIndex-1] and Lines[LineIndex],

View File

@ -1651,12 +1651,12 @@ private:
HasBinPackedFunction || !HasOnePerLineFunction;
}
virtual void consumeUnwrappedLine(const UnwrappedLine &TheLine) {
void consumeUnwrappedLine(const UnwrappedLine &TheLine) override {
assert(!UnwrappedLines.empty());
UnwrappedLines.back().push_back(TheLine);
}
virtual void finishRun() {
void finishRun() override {
UnwrappedLines.push_back(SmallVector<UnwrappedLine, 16>());
}

View File

@ -432,17 +432,16 @@ public:
CommaSeparatedList(const FormatStyle &Style)
: TokenRole(Style), HasNestedBracedList(false) {}
virtual void precomputeFormattingInfos(const FormatToken *Token);
void precomputeFormattingInfos(const FormatToken *Token) override;
virtual unsigned formatAfterToken(LineState &State,
ContinuationIndenter *Indenter,
bool DryRun);
unsigned formatAfterToken(LineState &State, ContinuationIndenter *Indenter,
bool DryRun) override;
virtual unsigned formatFromToken(LineState &State,
ContinuationIndenter *Indenter, bool DryRun);
unsigned formatFromToken(LineState &State, ContinuationIndenter *Indenter,
bool DryRun) override;
/// \brief Adds \p Token as the next comma to the \c CommaSeparated list.
virtual void CommaFound(const FormatToken *Token) { Commas.push_back(Token); }
void CommaFound(const FormatToken *Token) override { Commas.push_back(Token);}
private:
/// \brief A struct that holds information on how to format a given list with

View File

@ -74,7 +74,7 @@ public:
StructuralError = PreviousStructuralError;
}
virtual FormatToken *getNextToken() {
FormatToken *getNextToken() override {
// The \c UnwrappedLineParser guards against this by never calling
// \c getNextToken() after it has encountered the first eof token.
assert(!eof());
@ -84,9 +84,9 @@ public:
return Token;
}
virtual unsigned getPosition() { return PreviousTokenSource->getPosition(); }
unsigned getPosition() override { return PreviousTokenSource->getPosition(); }
virtual FormatToken *setPosition(unsigned Position) {
FormatToken *setPosition(unsigned Position) override {
Token = PreviousTokenSource->setPosition(Position);
return Token;
}
@ -180,17 +180,17 @@ public:
IndexedTokenSource(ArrayRef<FormatToken *> Tokens)
: Tokens(Tokens), Position(-1) {}
virtual FormatToken *getNextToken() {
FormatToken *getNextToken() override {
++Position;
return Tokens[Position];
}
virtual unsigned getPosition() {
unsigned getPosition() override {
assert(Position >= 0);
return Position;
}
virtual FormatToken *setPosition(unsigned P) {
FormatToken *setPosition(unsigned P) override {
Position = P;
return Tokens[Position];
}

View File

@ -62,10 +62,10 @@ class RewritesReceiver : public edit::EditsReceiver {
public:
RewritesReceiver(Rewriter &Rewrite) : Rewrite(Rewrite) { }
virtual void insert(SourceLocation loc, StringRef text) {
void insert(SourceLocation loc, StringRef text) override {
Rewrite.InsertText(loc, text);
}
virtual void replace(CharSourceRange range, StringRef text) {
void replace(CharSourceRange range, StringRef text) override {
Rewrite.ReplaceText(range.getBegin(), Rewrite.getRangeSize(range), text);
}
};

View File

@ -48,7 +48,7 @@ ASTConsumer *FixItAction::CreateASTConsumer(CompilerInstance &CI,
namespace {
class FixItRewriteInPlace : public FixItOptions {
public:
std::string RewriteFilename(const std::string &Filename, int &fd) {
std::string RewriteFilename(const std::string &Filename, int &fd) override {
fd = -1;
return Filename;
}
@ -63,7 +63,7 @@ public:
this->FixWhatYouCan = FixWhatYouCan;
}
std::string RewriteFilename(const std::string &Filename, int &fd) {
std::string RewriteFilename(const std::string &Filename, int &fd) override {
fd = -1;
SmallString<128> Path(Filename);
llvm::sys::path::replace_extension(Path,
@ -74,7 +74,7 @@ public:
class FixItRewriteToTemp : public FixItOptions {
public:
std::string RewriteFilename(const std::string &Filename, int &fd) {
std::string RewriteFilename(const std::string &Filename, int &fd) override {
SmallString<128> Path;
llvm::sys::fs::createTemporaryFile(llvm::sys::path::filename(Filename),
llvm::sys::path::extension(Filename), fd,

View File

@ -42,8 +42,8 @@ namespace {
: Out(OS), PP(pp), SyntaxHighlight(_SyntaxHighlight),
HighlightMacros(_HighlightMacros) {}
void Initialize(ASTContext &context);
void HandleTranslationUnit(ASTContext &Ctx);
void Initialize(ASTContext &context) override;
void HandleTranslationUnit(ASTContext &Ctx) override;
};
}

View File

@ -55,21 +55,16 @@ public:
PredefinesBuffer = Buf;
}
private:
virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,
SrcMgr::CharacteristicKind FileType,
FileID PrevFID);
virtual void FileSkipped(const FileEntry &ParentFile,
const Token &FilenameTok,
SrcMgr::CharacteristicKind FileType);
virtual void InclusionDirective(SourceLocation HashLoc,
const Token &IncludeTok,
StringRef FileName,
bool IsAngled,
CharSourceRange FilenameRange,
const FileEntry *File,
StringRef SearchPath,
StringRef RelativePath,
const Module *Imported);
void FileChanged(SourceLocation Loc, FileChangeReason Reason,
SrcMgr::CharacteristicKind FileType,
FileID PrevFID) override;
void FileSkipped(const FileEntry &ParentFile, const Token &FilenameTok,
SrcMgr::CharacteristicKind FileType) override;
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
StringRef FileName, bool IsAngled,
CharSourceRange FilenameRange, const FileEntry *File,
StringRef SearchPath, StringRef RelativePath,
const Module *Imported) override;
void WriteLineInfo(const char *Filename, int Line,
SrcMgr::CharacteristicKind FileType,
StringRef EOL, StringRef Extra = StringRef());

View File

@ -185,7 +185,7 @@ namespace {
public:
llvm::DenseMap<ObjCMethodDecl*, std::string> MethodInternalNames;
// Top Level Driver code.
virtual bool HandleTopLevelDecl(DeclGroupRef D) {
bool HandleTopLevelDecl(DeclGroupRef D) override {
for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I) {
if (ObjCInterfaceDecl *Class = dyn_cast<ObjCInterfaceDecl>(*I)) {
if (!Class->isThisDeclarationADefinition()) {
@ -221,8 +221,8 @@ namespace {
}
return true;
}
virtual void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) {
void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override {
for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I) {
if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(*I)) {
if (isTopLevelBlockPointerType(TD->getUnderlyingType()))
@ -243,8 +243,8 @@ namespace {
bool silenceMacroWarn, bool LineInfo);
~RewriteModernObjC() {}
virtual void HandleTranslationUnit(ASTContext &C);
void HandleTranslationUnit(ASTContext &C) override;
void ReplaceStmt(Stmt *Old, Stmt *New) {
Stmt *ReplacingStmt = ReplacedNodes[Old];
@ -414,9 +414,9 @@ namespace {
void RewriteIvarOffsetSymbols(ObjCInterfaceDecl *CDecl,
std::string &Result);
virtual void Initialize(ASTContext &context);
void Initialize(ASTContext &context) override;
// Misc. AST transformation routines. Sometimes they end up calling
// rewriting routines on the new ASTs.
CallExpr *SynthesizeCallToFunctionDecl(FunctionDecl *FD,

View File

@ -165,7 +165,7 @@ namespace {
public:
// Top Level Driver code.
virtual bool HandleTopLevelDecl(DeclGroupRef D) {
bool HandleTopLevelDecl(DeclGroupRef D) override {
for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I) {
if (ObjCInterfaceDecl *Class = dyn_cast<ObjCInterfaceDecl>(*I)) {
if (!Class->isThisDeclarationADefinition()) {
@ -193,7 +193,7 @@ namespace {
~RewriteObjC() {}
virtual void HandleTranslationUnit(ASTContext &C);
void HandleTranslationUnit(ASTContext &C) override;
void ReplaceStmt(Stmt *Old, Stmt *New) {
Stmt *ReplacingStmt = ReplacedNodes[Old];
@ -328,9 +328,9 @@ namespace {
void RewriteObjCInternalStruct(ObjCInterfaceDecl *CDecl,
std::string &Result);
virtual void Initialize(ASTContext &context) = 0;
virtual void Initialize(ASTContext &context) override = 0;
// Metadata Rewriting.
virtual void RewriteMetaDataIntoBuffer(std::string &Result) = 0;
virtual void RewriteObjCProtocolListMetaData(const ObjCList<ObjCProtocolDecl> &Prots,
@ -521,8 +521,8 @@ namespace {
silenceMacroWarn) {}
~RewriteObjCFragileABI() {}
virtual void Initialize(ASTContext &context);
virtual void Initialize(ASTContext &context) override;
// Rewriting metadata
template<typename MethodIterator>
void RewriteObjCMethodsMetaData(MethodIterator MethodBegin,
@ -531,23 +531,22 @@ namespace {
StringRef prefix,
StringRef ClassName,
std::string &Result);
virtual void RewriteObjCProtocolMetaData(ObjCProtocolDecl *Protocol,
StringRef prefix,
StringRef ClassName,
std::string &Result);
virtual void RewriteObjCProtocolListMetaData(
const ObjCList<ObjCProtocolDecl> &Prots,
StringRef prefix, StringRef ClassName, std::string &Result);
virtual void RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
std::string &Result);
virtual void RewriteMetaDataIntoBuffer(std::string &Result);
virtual void RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *CDecl,
std::string &Result);
void RewriteObjCProtocolMetaData(ObjCProtocolDecl *Protocol,
StringRef prefix, StringRef ClassName,
std::string &Result) override;
void RewriteObjCProtocolListMetaData(
const ObjCList<ObjCProtocolDecl> &Prots,
StringRef prefix, StringRef ClassName, std::string &Result) override;
void RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
std::string &Result) override;
void RewriteMetaDataIntoBuffer(std::string &Result) override;
void RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *CDecl,
std::string &Result) override;
// Rewriting ivar
virtual void RewriteIvarOffsetComputation(ObjCIvarDecl *ivar,
std::string &Result);
virtual Stmt *RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV);
void RewriteIvarOffsetComputation(ObjCIvarDecl *ivar,
std::string &Result) override;
Stmt *RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) override;
};
}

View File

@ -255,8 +255,8 @@ public:
return false;
}
virtual void observeStmt(const Stmt *S, const CFGBlock *block,
const LiveVariables::LivenessValues &Live) {
void observeStmt(const Stmt *S, const CFGBlock *block,
const LiveVariables::LivenessValues &Live) override {
currentBlock = block;

View File

@ -139,7 +139,7 @@ private:
SecKeychainBugVisitor(SymbolRef S) : Sym(S) {}
virtual ~SecKeychainBugVisitor() {}
void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override {
static int X = 0;
ID.AddPointer(&X);
ID.AddPointer(Sym);
@ -148,7 +148,7 @@ private:
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
BugReport &BR) override;
};
};
}

View File

@ -196,7 +196,7 @@ public:
PointerEscapeKind Kind) const;
void printState(raw_ostream &Out, ProgramStateRef State,
const char *NL, const char *Sep) const;
const char *NL, const char *Sep) const override;
private:
mutable std::unique_ptr<BugType> BT_DoubleFree[CK_NumCheckKinds];
@ -364,7 +364,7 @@ private:
virtual ~MallocBugVisitor() {}
void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override {
static int X = 0;
ID.AddPointer(&X);
ID.AddPointer(Sym);
@ -406,11 +406,11 @@ private:
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
BugReport &BR) override;
PathDiagnosticPiece* getEndPath(BugReporterContext &BRC,
const ExplodedNode *EndPathNode,
BugReport &BR) {
BugReport &BR) override {
if (!IsLeak)
return 0;
@ -428,7 +428,8 @@ private:
StackHintGeneratorForReallocationFailed(SymbolRef S, StringRef M)
: StackHintGeneratorForSymbol(S, M) {}
virtual std::string getMessageForArg(const Expr *ArgE, unsigned ArgIndex) {
std::string getMessageForArg(const Expr *ArgE,
unsigned ArgIndex) override {
// Printed parameters start at 1, not 0.
++ArgIndex;
@ -441,7 +442,7 @@ private:
return os.str();
}
virtual std::string getMessageForReturn(const CallExpr *CallExpr) {
std::string getMessageForReturn(const CallExpr *CallExpr) override {
return "Reallocation of returned value failed";
}
};
@ -463,7 +464,7 @@ public:
StopTrackingCallback(ProgramStateRef st) : state(st) {}
ProgramStateRef getState() const { return state; }
bool VisitSymbol(SymbolRef sym) {
bool VisitSymbol(SymbolRef sym) override {
state = state->remove<RegionState>(sym);
return true;
}

View File

@ -74,7 +74,7 @@ public:
void checkPostCall(const CallEvent &CE, CheckerContext &C) const;
void printState(raw_ostream &Out, ProgramStateRef State,
const char *NL, const char *Sep) const;
const char *NL, const char *Sep) const override;
};
} // end anonymous namespace

View File

@ -1563,7 +1563,7 @@ namespace {
UseAfterRelease(const CheckerBase *checker)
: CFRefBug(checker, "Use-after-release") {}
const char *getDescription() const {
const char *getDescription() const override {
return "Reference-counted object is used after it is released";
}
};
@ -1572,7 +1572,7 @@ namespace {
public:
BadRelease(const CheckerBase *checker) : CFRefBug(checker, "Bad release") {}
const char *getDescription() const {
const char *getDescription() const override {
return "Incorrect decrement of the reference count of an object that is "
"not owned at this point by the caller";
}
@ -1583,7 +1583,7 @@ namespace {
DeallocGC(const CheckerBase *checker)
: CFRefBug(checker, "-dealloc called while using garbage collection") {}
const char *getDescription() const {
const char *getDescription() const override {
return "-dealloc called while using garbage collection";
}
};
@ -1593,7 +1593,7 @@ namespace {
DeallocNotOwned(const CheckerBase *checker)
: CFRefBug(checker, "-dealloc sent to non-exclusively owned object") {}
const char *getDescription() const {
const char *getDescription() const override {
return "-dealloc sent to object that may be referenced elsewhere";
}
};
@ -1603,7 +1603,7 @@ namespace {
OverAutorelease(const CheckerBase *checker)
: CFRefBug(checker, "Object autoreleased too many times") {}
const char *getDescription() const {
const char *getDescription() const override {
return "Object autoreleased too many times";
}
};
@ -1613,7 +1613,7 @@ namespace {
ReturnedNotOwnedForOwned(const CheckerBase *checker)
: CFRefBug(checker, "Method should return an owned object") {}
const char *getDescription() const {
const char *getDescription() const override {
return "Object with a +0 retain count returned to caller where a +1 "
"(owning) retain count is expected";
}
@ -1626,9 +1626,9 @@ namespace {
setSuppressOnSink(true);
}
const char *getDescription() const { return ""; }
const char *getDescription() const override { return ""; }
bool isLeak() const { return true; }
bool isLeak() const override { return true; }
};
//===---------===//
@ -1645,20 +1645,20 @@ namespace {
CFRefReportVisitor(SymbolRef sym, bool gcEnabled, const SummaryLogTy &log)
: Sym(sym), SummaryLog(log), GCEnabled(gcEnabled) {}
virtual void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override {
static int x = 0;
ID.AddPointer(&x);
ID.AddPointer(Sym);
}
virtual PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR) override;
virtual PathDiagnosticPiece *getEndPath(BugReporterContext &BRC,
const ExplodedNode *N,
BugReport &BR);
PathDiagnosticPiece *getEndPath(BugReporterContext &BRC,
const ExplodedNode *N,
BugReport &BR) override;
};
class CFRefLeakReportVisitor : public CFRefReportVisitor {
@ -1669,9 +1669,9 @@ namespace {
PathDiagnosticPiece *getEndPath(BugReporterContext &BRC,
const ExplodedNode *N,
BugReport &BR);
BugReport &BR) override;
virtual BugReporterVisitor *clone() const {
BugReporterVisitor *clone() const override {
// The curiously-recurring template pattern only works for one level of
// subclassing. Rather than make a new template base for
// CFRefReportVisitor, we simply override clone() to do the right thing.
@ -1702,7 +1702,7 @@ namespace {
addGCModeDescription(LOpts, GCEnabled);
}
virtual std::pair<ranges_iterator, ranges_iterator> getRanges() {
std::pair<ranges_iterator, ranges_iterator> getRanges() override {
const CFRefBug& BugTy = static_cast<CFRefBug&>(getBugType());
if (!BugTy.isLeak())
return BugReport::getRanges();
@ -1719,7 +1719,7 @@ namespace {
CheckerContext &Ctx,
bool IncludeAllocationLine);
PathDiagnosticLocation getLocation(const SourceManager &SM) const {
PathDiagnosticLocation getLocation(const SourceManager &SM) const override {
assert(Location.isValid());
return Location;
}
@ -2472,7 +2472,7 @@ public:
}
void printState(raw_ostream &Out, ProgramStateRef State,
const char *NL, const char *Sep) const;
const char *NL, const char *Sep) const override;
void checkBind(SVal loc, SVal val, const Stmt *S, CheckerContext &C) const;
void checkPostStmt(const BlockExpr *BE, CheckerContext &C) const;
@ -2550,7 +2550,7 @@ public:
StopTrackingCallback(ProgramStateRef st) : state(st) {}
ProgramStateRef getState() const { return state; }
bool VisitSymbol(SymbolRef sym) {
bool VisitSymbol(SymbolRef sym) override {
state = state->remove<RefBindings>(sym);
return true;
}

View File

@ -99,7 +99,7 @@ public:
StopTrackingCallback(ProgramStateRef st) : state(st) {}
ProgramStateRef getState() const { return state; }
bool VisitSymbol(SymbolRef sym) {
bool VisitSymbol(SymbolRef sym) override {
state = state->remove<StreamMap>(sym);
return true;
}

View File

@ -177,8 +177,8 @@ void StackAddrEscapeChecker::checkEndFunction(CheckerContext &Ctx) const {
{}
bool HandleBinding(StoreManager &SMgr, Store store,
const MemRegion *region, SVal val) {
const MemRegion *region, SVal val) override {
if (!isa<GlobalsSpaceRegion>(region->getMemorySpace()))
return true;

View File

@ -311,7 +311,7 @@ class NodeMapClosure : public BugReport::NodeResolver {
public:
NodeMapClosure(InterExplodedGraphMap &m) : M(m) {}
const ExplodedNode *getOriginalNode(const ExplodedNode *N) {
const ExplodedNode *getOriginalNode(const ExplodedNode *N) override {
return M.lookup(N);
}
};
@ -345,7 +345,7 @@ public:
return getParentMap().getParent(S);
}
virtual NodeMapClosure& getNodeResolver() { return NMC; }
NodeMapClosure& getNodeResolver() override { return NMC; }
PathDiagnosticLocation getEnclosingStmtLocation(const Stmt *S);

View File

@ -156,7 +156,7 @@ public:
return static_cast<void *>(&Tag);
}
virtual void Profile(llvm::FoldingSetNodeID &ID) const {
void Profile(llvm::FoldingSetNodeID &ID) const override {
ID.AddPointer(ReturnVisitor::getTag());
ID.AddPointer(StackFrame);
ID.AddBoolean(EnableNullFPSuppression);
@ -386,7 +386,7 @@ public:
PathDiagnosticPiece *VisitNode(const ExplodedNode *N,
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR) {
BugReport &BR) override {
switch (Mode) {
case Initial:
return visitNodeInitial(N, PrevN, BRC, BR);
@ -401,7 +401,7 @@ public:
PathDiagnosticPiece *getEndPath(BugReporterContext &BRC,
const ExplodedNode *N,
BugReport &BR) {
BugReport &BR) override {
if (EnableNullFPSuppression)
BR.markInvalid(ReturnVisitor::getTag(), StackFrame);
return 0;

View File

@ -43,22 +43,22 @@ namespace {
class DFS : public WorkList {
SmallVector<WorkListUnit,20> Stack;
public:
virtual bool hasWork() const {
bool hasWork() const override {
return !Stack.empty();
}
virtual void enqueue(const WorkListUnit& U) {
void enqueue(const WorkListUnit& U) override {
Stack.push_back(U);
}
virtual WorkListUnit dequeue() {
WorkListUnit dequeue() override {
assert (!Stack.empty());
const WorkListUnit& U = Stack.back();
Stack.pop_back(); // This technically "invalidates" U, but we are fine.
return U;
}
virtual bool visitItemsInWorkList(Visitor &V) {
bool visitItemsInWorkList(Visitor &V) override {
for (SmallVectorImpl<WorkListUnit>::iterator
I = Stack.begin(), E = Stack.end(); I != E; ++I) {
if (V.visit(*I))
@ -71,21 +71,21 @@ public:
class BFS : public WorkList {
std::deque<WorkListUnit> Queue;
public:
virtual bool hasWork() const {
bool hasWork() const override {
return !Queue.empty();
}
virtual void enqueue(const WorkListUnit& U) {
void enqueue(const WorkListUnit& U) override {
Queue.push_back(U);
}
virtual WorkListUnit dequeue() {
WorkListUnit dequeue() override {
WorkListUnit U = Queue.front();
Queue.pop_front();
return U;
}
virtual bool visitItemsInWorkList(Visitor &V) {
bool visitItemsInWorkList(Visitor &V) override {
for (std::deque<WorkListUnit>::iterator
I = Queue.begin(), E = Queue.end(); I != E; ++I) {
if (V.visit(*I))
@ -109,18 +109,18 @@ namespace {
std::deque<WorkListUnit> Queue;
SmallVector<WorkListUnit,20> Stack;
public:
virtual bool hasWork() const {
bool hasWork() const override {
return !Queue.empty() || !Stack.empty();
}
virtual void enqueue(const WorkListUnit& U) {
void enqueue(const WorkListUnit& U) override {
if (U.getNode()->getLocation().getAs<BlockEntrance>())
Queue.push_front(U);
else
Stack.push_back(U);
}
virtual WorkListUnit dequeue() {
WorkListUnit dequeue() override {
// Process all basic blocks to completion.
if (!Stack.empty()) {
const WorkListUnit& U = Stack.back();
@ -135,7 +135,7 @@ namespace {
Queue.pop_front();
return U;
}
virtual bool visitItemsInWorkList(Visitor &V) {
bool visitItemsInWorkList(Visitor &V) override {
for (SmallVectorImpl<WorkListUnit>::iterator
I = Stack.begin(), E = Stack.end(); I != E; ++I) {
if (V.visit(*I))

View File

@ -123,11 +123,11 @@ class MarkLiveCallback : public SymbolVisitor {
SymbolReaper &SymReaper;
public:
MarkLiveCallback(SymbolReaper &symreaper) : SymReaper(symreaper) {}
bool VisitSymbol(SymbolRef sym) {
bool VisitSymbol(SymbolRef sym) override {
SymReaper.markLive(sym);
return true;
}
bool VisitMemRegion(const MemRegion *R) {
bool VisitMemRegion(const MemRegion *R) override {
SymReaper.markLive(R);
return true;
}

View File

@ -1863,7 +1863,7 @@ public:
CollectReachableSymbolsCallback(ProgramStateRef State) {}
const InvalidatedSymbols &getSymbols() const { return Symbols; }
bool VisitSymbol(SymbolRef Sym) {
bool VisitSymbol(SymbolRef Sym) override {
Symbols.insert(Sym);
return true;
}

View File

@ -44,10 +44,10 @@ public:
virtual ~HTMLDiagnostics() { FlushDiagnostics(NULL); }
virtual void FlushDiagnosticsImpl(std::vector<const PathDiagnostic *> &Diags,
FilesMade *filesMade);
void FlushDiagnosticsImpl(std::vector<const PathDiagnostic *> &Diags,
FilesMade *filesMade) override;
virtual StringRef getName() const {
StringRef getName() const override {
return "HTMLDiagnostics";
}

View File

@ -40,15 +40,17 @@ namespace {
virtual ~PlistDiagnostics() {}
void FlushDiagnosticsImpl(std::vector<const PathDiagnostic *> &Diags,
FilesMade *filesMade);
virtual StringRef getName() const {
FilesMade *filesMade) override;
virtual StringRef getName() const override {
return "PlistDiagnostics";
}
PathGenerationScheme getGenerationScheme() const { return Extensive; }
bool supportsLogicalOpControlFlow() const { return true; }
virtual bool supportsCrossFileDiagnostics() const {
PathGenerationScheme getGenerationScheme() const override {
return Extensive;
}
bool supportsLogicalOpControlFlow() const override { return true; }
bool supportsCrossFileDiagnostics() const override {
return SupportsCrossFileDiagnostics;
}
};

View File

@ -33,7 +33,7 @@ public:
assert(LCtx);
}
virtual void print(raw_ostream &OS) const {
void print(raw_ostream &OS) const override {
OS << "While analyzing stack: \n";
LCtx->dumpStack(OS, "\t");
}

View File

@ -290,35 +290,37 @@ public:
ProgramStateRef assumeSymNE(ProgramStateRef state, SymbolRef sym,
const llvm::APSInt& Int,
const llvm::APSInt& Adjustment);
const llvm::APSInt& Adjustment) override;
ProgramStateRef assumeSymEQ(ProgramStateRef state, SymbolRef sym,
const llvm::APSInt& Int,
const llvm::APSInt& Adjustment);
const llvm::APSInt& Adjustment) override;
ProgramStateRef assumeSymLT(ProgramStateRef state, SymbolRef sym,
const llvm::APSInt& Int,
const llvm::APSInt& Adjustment);
const llvm::APSInt& Adjustment) override;
ProgramStateRef assumeSymGT(ProgramStateRef state, SymbolRef sym,
const llvm::APSInt& Int,
const llvm::APSInt& Adjustment);
const llvm::APSInt& Adjustment) override;
ProgramStateRef assumeSymGE(ProgramStateRef state, SymbolRef sym,
const llvm::APSInt& Int,
const llvm::APSInt& Adjustment);
const llvm::APSInt& Adjustment) override;
ProgramStateRef assumeSymLE(ProgramStateRef state, SymbolRef sym,
const llvm::APSInt& Int,
const llvm::APSInt& Adjustment);
const llvm::APSInt& Adjustment) override;
const llvm::APSInt* getSymVal(ProgramStateRef St, SymbolRef sym) const;
ConditionTruthVal checkNull(ProgramStateRef State, SymbolRef Sym);
const llvm::APSInt* getSymVal(ProgramStateRef St,
SymbolRef sym) const override;
ConditionTruthVal checkNull(ProgramStateRef State, SymbolRef Sym) override;
ProgramStateRef removeDeadBindings(ProgramStateRef St, SymbolReaper& SymReaper);
ProgramStateRef removeDeadBindings(ProgramStateRef St,
SymbolReaper& SymReaper) override;
void print(ProgramStateRef St, raw_ostream &Out,
const char* nl, const char *sep);
const char* nl, const char *sep) override;
private:
RangeSet::Factory F;

View File

@ -372,9 +372,9 @@ public:
/// version of that lvalue (i.e., a pointer to the first element of
/// the array). This is called by ExprEngine when evaluating
/// casts from arrays to pointers.
SVal ArrayToPointer(Loc Array, QualType ElementTy);
SVal ArrayToPointer(Loc Array, QualType ElementTy) override;
StoreRef getInitialStore(const LocationContext *InitLoc) {
StoreRef getInitialStore(const LocationContext *InitLoc) override {
return StoreRef(RBFactory.getEmptyMap().getRootWithoutRetain(), *this);
}
@ -396,24 +396,24 @@ public:
InvalidatedSymbols &IS,
RegionAndSymbolInvalidationTraits &ITraits,
InvalidatedRegions *Invalidated,
InvalidatedRegions *InvalidatedTopLevel);
InvalidatedRegions *InvalidatedTopLevel) override;
bool scanReachableSymbols(Store S, const MemRegion *R,
ScanReachableSymbols &Callbacks);
ScanReachableSymbols &Callbacks) override;
RegionBindingsRef removeSubRegionBindings(RegionBindingsConstRef B,
const SubRegion *R);
public: // Part of public interface to class.
virtual StoreRef Bind(Store store, Loc LV, SVal V) {
StoreRef Bind(Store store, Loc LV, SVal V) override {
return StoreRef(bind(getRegionBindings(store), LV, V).asStore(), *this);
}
RegionBindingsRef bind(RegionBindingsConstRef B, Loc LV, SVal V);
// BindDefault is only used to initialize a region with a default value.
StoreRef BindDefault(Store store, const MemRegion *R, SVal V) {
StoreRef BindDefault(Store store, const MemRegion *R, SVal V) override {
RegionBindingsRef B = getRegionBindings(store);
assert(!B.lookup(R, BindingKey::Direct));
@ -467,20 +467,20 @@ public: // Part of public interface to class.
/// \brief Create a new store with the specified binding removed.
/// \param ST the original store, that is the basis for the new store.
/// \param L the location whose binding should be removed.
virtual StoreRef killBinding(Store ST, Loc L);
StoreRef killBinding(Store ST, Loc L) override;
void incrementReferenceCount(Store store) {
void incrementReferenceCount(Store store) override {
getRegionBindings(store).manualRetain();
}
/// If the StoreManager supports it, decrement the reference count of
/// the specified Store object. If the reference count hits 0, the memory
/// associated with the object is recycled.
void decrementReferenceCount(Store store) {
void decrementReferenceCount(Store store) override {
getRegionBindings(store).manualRelease();
}
bool includedInBindings(Store store, const MemRegion *region) const;
bool includedInBindings(Store store, const MemRegion *region) const override;
/// \brief Return the value bound to specified location in a given state.
///
@ -495,7 +495,7 @@ public: // Part of public interface to class.
/// return undefined
/// else
/// return symbolic
virtual SVal getBinding(Store S, Loc L, QualType T) {
SVal getBinding(Store S, Loc L, QualType T) override {
return getBinding(getRegionBindings(S), L, T);
}
@ -560,15 +560,16 @@ public: // Part of public interface to class.
/// removeDeadBindings - Scans the RegionStore of 'state' for dead values.
/// It returns a new Store with these values removed.
StoreRef removeDeadBindings(Store store, const StackFrameContext *LCtx,
SymbolReaper& SymReaper);
SymbolReaper& SymReaper) override;
//===------------------------------------------------------------------===//
// Region "extents".
//===------------------------------------------------------------------===//
// FIXME: This method will soon be eliminated; see the note in Store.h.
DefinedOrUnknownSVal getSizeInElements(ProgramStateRef state,
const MemRegion* R, QualType EleTy);
const MemRegion* R,
QualType EleTy) override;
//===------------------------------------------------------------------===//
// Utility methods.
@ -581,9 +582,9 @@ public: // Part of public interface to class.
}
void print(Store store, raw_ostream &Out, const char* nl,
const char *sep);
const char *sep) override;
void iterBindings(Store store, BindingsHandler& f) {
void iterBindings(Store store, BindingsHandler& f) override {
RegionBindingsRef B = getRegionBindings(store);
for (RegionBindingsRef::iterator I = B.begin(), E = B.end(); I != E; ++I) {
const ClusterBindings &Cluster = I.getData();

View File

@ -34,7 +34,7 @@ public:
//===------------------------------------------------------------------===//
ProgramStateRef assume(ProgramStateRef state, DefinedSVal Cond,
bool Assumption);
bool Assumption) override;
ProgramStateRef assume(ProgramStateRef state, NonLoc Cond, bool Assumption);
@ -82,7 +82,7 @@ protected:
BasicValueFactory &getBasicVals() const { return SVB.getBasicValueFactory(); }
SymbolManager &getSymbolManager() const { return SVB.getSymbolManager(); }
bool canReasonAbout(SVal X) const;
bool canReasonAbout(SVal X) const override;
ProgramStateRef assumeAux(ProgramStateRef state,
NonLoc Cond,

View File

@ -21,9 +21,9 @@ using namespace ento;
namespace {
class SimpleSValBuilder : public SValBuilder {
protected:
virtual SVal dispatchCast(SVal val, QualType castTy);
virtual SVal evalCastFromNonLoc(NonLoc val, QualType castTy);
virtual SVal evalCastFromLoc(Loc val, QualType castTy);
SVal dispatchCast(SVal val, QualType castTy) override;
SVal evalCastFromNonLoc(NonLoc val, QualType castTy) override;
SVal evalCastFromLoc(Loc val, QualType castTy) override;
public:
SimpleSValBuilder(llvm::BumpPtrAllocator &alloc, ASTContext &context,
@ -31,19 +31,19 @@ public:
: SValBuilder(alloc, context, stateMgr) {}
virtual ~SimpleSValBuilder() {}
virtual SVal evalMinus(NonLoc val);
virtual SVal evalComplement(NonLoc val);
virtual SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op,
NonLoc lhs, NonLoc rhs, QualType resultTy);
virtual SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op,
Loc lhs, Loc rhs, QualType resultTy);
virtual SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op,
Loc lhs, NonLoc rhs, QualType resultTy);
SVal evalMinus(NonLoc val) override;
SVal evalComplement(NonLoc val) override;
SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op,
NonLoc lhs, NonLoc rhs, QualType resultTy) override;
SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op,
Loc lhs, Loc rhs, QualType resultTy) override;
SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op,
Loc lhs, NonLoc rhs, QualType resultTy) override;
/// getKnownValue - evaluates a given SVal. If the SVal has only one possible
/// (integer) value, that value is returned. Otherwise, returns NULL.
virtual const llvm::APSInt *getKnownValue(ProgramStateRef state, SVal V);
const llvm::APSInt *getKnownValue(ProgramStateRef state, SVal V) override;
SVal MakeSymIntVal(const SymExpr *LHS, BinaryOperator::Opcode op,
const llvm::APSInt &RHS, QualType resultTy);
};

View File

@ -90,12 +90,12 @@ public:
ClangDiagPathDiagConsumer(DiagnosticsEngine &Diag)
: Diag(Diag), IncludePath(false) {}
virtual ~ClangDiagPathDiagConsumer() {}
virtual StringRef getName() const { return "ClangDiags"; }
StringRef getName() const override { return "ClangDiags"; }
virtual bool supportsLogicalOpControlFlow() const { return true; }
virtual bool supportsCrossFileDiagnostics() const { return true; }
bool supportsLogicalOpControlFlow() const override { return true; }
bool supportsCrossFileDiagnostics() const override { return true; }
virtual PathGenerationScheme getGenerationScheme() const {
PathGenerationScheme getGenerationScheme() const override {
return IncludePath ? Minimal : None;
}
@ -104,7 +104,7 @@ public:
}
void FlushDiagnosticsImpl(std::vector<const PathDiagnostic *> &Diags,
FilesMade *filesMade) {
FilesMade *filesMade) override {
unsigned WarnID = Diag.getCustomDiagID(DiagnosticsEngine::Warning, "%0");
unsigned NoteID = Diag.getCustomDiagID(DiagnosticsEngine::Note, "%0");
@ -282,7 +282,7 @@ public:
}
}
virtual void Initialize(ASTContext &Context) {
void Initialize(ASTContext &Context) override {
Ctx = &Context;
checkerMgr.reset(createCheckerManager(*Opts, PP.getLangOpts(), Plugins,
PP.getDiagnostics()));
@ -298,10 +298,10 @@ public:
/// \brief Store the top level decls in the set to be processed later on.
/// (Doing this pre-processing avoids deserialization of data from PCH.)
virtual bool HandleTopLevelDecl(DeclGroupRef D);
virtual void HandleTopLevelDeclInObjCContainer(DeclGroupRef D);
bool HandleTopLevelDecl(DeclGroupRef D) override;
void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override;
virtual void HandleTranslationUnit(ASTContext &C);
void HandleTranslationUnit(ASTContext &C) override;
/// \brief Determine which inlining mode should be used when this function is
/// analyzed. This allows to redefine the default inlining policies when
@ -716,7 +716,7 @@ public:
~UbigraphViz();
virtual void AddEdge(ExplodedNode *Src, ExplodedNode *Dst);
void AddEdge(ExplodedNode *Src, ExplodedNode *Dst) override;
};
} // end anonymous namespace

View File

@ -24,7 +24,7 @@ namespace tooling {
/// \brief Default \c PathComparator using \c llvm::sys::fs::equivalent().
struct DefaultPathComparator : public PathComparator {
virtual ~DefaultPathComparator() {}
virtual bool equivalent(StringRef FileA, StringRef FileB) const {
bool equivalent(StringRef FileA, StringRef FileB) const override {
return FileA == FileB || llvm::sys::fs::equivalent(FileA, FileB);
}
};

View File

@ -118,8 +118,8 @@ std::vector<std::string> unescapeCommandLine(
}
class JSONCompilationDatabasePlugin : public CompilationDatabasePlugin {
virtual CompilationDatabase *loadFromDirectory(
StringRef Directory, std::string &ErrorMessage) {
CompilationDatabase *loadFromDirectory(StringRef Directory,
std::string &ErrorMessage) override {
SmallString<1024> JSONDatabasePath(Directory);
llvm::sys::path::append(JSONDatabasePath, "compile_commands.json");
std::unique_ptr<CompilationDatabase> Database(

View File

@ -160,7 +160,7 @@ class SingleFrontendActionFactory : public FrontendActionFactory {
public:
SingleFrontendActionFactory(FrontendAction *Action) : Action(Action) {}
FrontendAction *create() { return Action; }
FrontendAction *create() override { return Action; }
};
}
@ -380,7 +380,7 @@ public:
ASTBuilderAction(std::vector<ASTUnit *> &ASTs) : ASTs(ASTs) {}
bool runInvocation(CompilerInvocation *Invocation, FileManager *Files,
DiagnosticConsumer *DiagConsumer) {
DiagnosticConsumer *DiagConsumer) override {
// FIXME: This should use the provided FileManager.
ASTUnit *AST = ASTUnit::LoadFromCompilerInvocation(
Invocation, CompilerInstance::createDiagnostics(