From: David Blaikie Date: Fri, 14 Nov 2014 19:09:44 +0000 (+0000) Subject: Remove some redundant virtual specifiers on overriden functions. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3de29e1e7d1a4a3866c0da3b0698072e8d46e86c;p=clang Remove some redundant virtual specifiers on overriden functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222024 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index a9cbfb8538..509c88410e 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -4501,7 +4501,7 @@ public: } StringRef getABI() const override { return ABI; } - virtual bool setABI(const std::string &Name) override { + bool setABI(const std::string &Name) override { if (Name != "aapcs" && Name != "darwinpcs") return false; @@ -4509,7 +4509,7 @@ public: return true; } - virtual bool setCPU(const std::string &Name) override { + bool setCPU(const std::string &Name) override { bool CPUKnown = llvm::StringSwitch(Name) .Case("generic", true) .Cases("cortex-a53", "cortex-a57", true) @@ -4584,7 +4584,7 @@ public: NumRecords = clang::AArch64::LastTSBuiltin - Builtin::FirstTSBuiltin; } - virtual bool hasFeature(StringRef Feature) const override { + bool hasFeature(StringRef Feature) const override { return Feature == "aarch64" || Feature == "arm64" || (Feature == "neon" && FPU == NeonMode); @@ -4609,9 +4609,9 @@ public: return true; } - virtual bool isCLZForZeroUndef() const override { return false; } + bool isCLZForZeroUndef() const override { return false; } - virtual BuiltinVaListKind getBuiltinVaListKind() const override { + BuiltinVaListKind getBuiltinVaListKind() const override { return TargetInfo::AArch64ABIBuiltinVaList; } @@ -4690,7 +4690,7 @@ public: } } - virtual const char *getClobbers() const override { return ""; } + const char *getClobbers() const override { return ""; } int getEHDataRegisterNumber(unsigned RegNo) const override { if (RegNo == 0) @@ -4827,7 +4827,7 @@ public: TheCXXABI.set(TargetCXXABI::iOS64); } - virtual BuiltinVaListKind getBuiltinVaListKind() const override { + BuiltinVaListKind getBuiltinVaListKind() const override { return TargetInfo::CharPtrBuiltinVaList; } }; diff --git a/lib/CodeGen/MicrosoftCXXABI.cpp b/lib/CodeGen/MicrosoftCXXABI.cpp index 5bdda98d68..6da8d8c8a5 100644 --- a/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/lib/CodeGen/MicrosoftCXXABI.cpp @@ -507,7 +507,7 @@ public: return RD->hasAttr(); } - virtual bool isTypeInfoCalculable(QualType Ty) const override { + bool isTypeInfoCalculable(QualType Ty) const override { if (!CGCXXABI::isTypeInfoCalculable(Ty)) return false; if (const auto *MPT = Ty->getAs()) { diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 870e392807..ec82c41240 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -3812,7 +3812,7 @@ private: bool isIllegalVectorType(QualType Ty) const; - virtual void computeInfo(CGFunctionInfo &FI) const override { + void computeInfo(CGFunctionInfo &FI) const override { // To correctly handle Homogeneous Aggregate, we need to keep track of the // number of SIMD and Floating-point registers allocated so far. // If the argument is an HFA or an HVA and there are sufficient unallocated diff --git a/lib/Frontend/Rewrite/RewriteObjC.cpp b/lib/Frontend/Rewrite/RewriteObjC.cpp index be4f82d5de..3350815343 100644 --- a/lib/Frontend/Rewrite/RewriteObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteObjC.cpp @@ -321,7 +321,7 @@ namespace { void RewriteObjCInternalStruct(ObjCInterfaceDecl *CDecl, std::string &Result); - virtual void Initialize(ASTContext &context) override = 0; + void Initialize(ASTContext &context) override = 0; // Metadata Rewriting. virtual void RewriteMetaDataIntoBuffer(std::string &Result) = 0; @@ -513,7 +513,7 @@ namespace { silenceMacroWarn) {} ~RewriteObjCFragileABI() {} - virtual void Initialize(ASTContext &context) override; + void Initialize(ASTContext &context) override; // Rewriting metadata template diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index bc4d458aca..a4b995fa97 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6308,7 +6308,7 @@ static void ReportOverrides(Sema& S, unsigned DiagID, const CXXMethodDecl *MD, /// AddOverriddenMethods - See if a method overrides any in the base classes, /// and if so, check that it's a valid override and remember it. bool Sema::AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD) { - // Look for virtual methods in base classes that this method might override. + // Look for methods in base classes that this method might override. CXXBasePaths Paths; FindOverriddenMethodData Data; Data.Method = MD; diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 925bd99051..0bd1222454 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -1887,7 +1887,7 @@ void Sema::CheckOverrideControl(NamedDecl *D) { } // C++11 [class.virtual]p5: - // If a virtual function is marked with the virt-specifier override and + // If a function is marked with the virt-specifier override and // does not override a member function of a base class, the program is // ill-formed. bool HasOverriddenMethods = @@ -9339,7 +9339,7 @@ class RefBuilder: public ExprBuilder { QualType VarType; public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull(S.BuildDeclRefExpr(Var, VarType, VK_LValue, Loc).get()); } @@ -9349,7 +9349,7 @@ public: class ThisBuilder: public ExprBuilder { public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull(S.ActOnCXXThis(Loc).getAs()); } }; @@ -9361,7 +9361,7 @@ class CastBuilder: public ExprBuilder { const CXXCastPath &Path; public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull(S.ImpCastExprToType(Builder.build(S, Loc), Type, CK_UncheckedDerivedToBase, Kind, &Path).get()); @@ -9376,7 +9376,7 @@ class DerefBuilder: public ExprBuilder { const ExprBuilder &Builder; public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull( S.CreateBuiltinUnaryOp(Loc, UO_Deref, Builder.build(S, Loc)).get()); } @@ -9392,7 +9392,7 @@ class MemberBuilder: public ExprBuilder { LookupResult &MemberLookup; public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull(S.BuildMemberReferenceExpr( Builder.build(S, Loc), Type, Loc, IsArrow, SS, SourceLocation(), nullptr, MemberLookup, nullptr).get()); @@ -9408,7 +9408,7 @@ class MoveCastBuilder: public ExprBuilder { const ExprBuilder &Builder; public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull(CastForMoving(S, Builder.build(S, Loc))); } @@ -9419,7 +9419,7 @@ class LvalueConvBuilder: public ExprBuilder { const ExprBuilder &Builder; public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull( S.DefaultLvalueConversion(Builder.build(S, Loc)).get()); } @@ -9432,7 +9432,7 @@ class SubscriptBuilder: public ExprBuilder { const ExprBuilder &Index; public: - virtual Expr *build(Sema &S, SourceLocation Loc) const override { + Expr *build(Sema &S, SourceLocation Loc) const override { return assertNotNull(S.CreateBuiltinArraySubscriptExpr( Base.build(S, Loc), Loc, Index.build(S, Loc), Loc).get()); } diff --git a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index a615226ea4..a2c66f8814 100644 --- a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -42,7 +42,7 @@ namespace { void FlushDiagnosticsImpl(std::vector &Diags, FilesMade *filesMade) override; - virtual StringRef getName() const override { + StringRef getName() const override { return "PlistDiagnostics"; }