r218774 - Adds 'override' to overriding methods. NFC.
Fariborz Jahanian
fjahanian at apple.com
Wed Oct 1 09:56:40 PDT 2014
Author: fjahanian
Date: Wed Oct 1 11:56:40 2014
New Revision: 218774
URL: http://llvm.org/viewvc/llvm-project?rev=218774&view=rev
Log:
Adds 'override' to overriding methods. NFC.
These were uncoveredby my yet undelivered patch.
Modified:
cfe/trunk/lib/AST/ItaniumCXXABI.cpp
cfe/trunk/lib/AST/MicrosoftCXXABI.cpp
cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h
cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
cfe/trunk/unittests/Tooling/ToolingTest.cpp
Modified: cfe/trunk/lib/AST/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumCXXABI.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumCXXABI.cpp Wed Oct 1 11:56:40 2014
@@ -49,7 +49,7 @@ public:
return ++ManglingNumbers[Key->castAs<FunctionProtoType>()];
}
- unsigned getManglingNumber(const BlockDecl *BD) {
+ unsigned getManglingNumber(const BlockDecl *BD) override {
const Type *Ty = nullptr;
return ++ManglingNumbers[Ty];
}
Modified: cfe/trunk/lib/AST/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftCXXABI.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftCXXABI.cpp Wed Oct 1 11:56:40 2014
@@ -41,7 +41,7 @@ public:
return ++LambdaManglingNumber;
}
- unsigned getManglingNumber(const BlockDecl *BD) {
+ unsigned getManglingNumber(const BlockDecl *BD) override {
const Type *Ty = nullptr;
return ++ManglingNumbers[Ty];
}
Modified: cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h (original)
+++ cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h Wed Oct 1 11:56:40 2014
@@ -564,7 +564,7 @@ public:
virtual VariantMatcher create(const SourceRange &NameRange,
ArrayRef<ParserValue> Args,
- Diagnostics *Error) const {
+ Diagnostics *Error) const override {
if (Args.size() < MinCount || MaxCount < Args.size()) {
const std::string MaxStr =
(MaxCount == UINT_MAX ? "" : Twine(MaxCount)).str();
@@ -587,14 +587,14 @@ public:
return VariantMatcher::VariadicOperatorMatcher(Func, std::move(InnerArgs));
}
- bool isVariadic() const { return true; }
- unsigned getNumArgs() const { return 0; }
+ bool isVariadic() const override { return true; }
+ unsigned getNumArgs() const override { return 0; }
void getArgKinds(ast_type_traits::ASTNodeKind ThisKind, unsigned ArgNo,
- std::vector<ArgKind> &Kinds) const {
+ std::vector<ArgKind> &Kinds) const override {
Kinds.push_back(ThisKind);
}
bool isConvertibleTo(ast_type_traits::ASTNodeKind Kind, unsigned *Specificity,
- ast_type_traits::ASTNodeKind *LeastDerivedKind) const {
+ ast_type_traits::ASTNodeKind *LeastDerivedKind) const override {
if (Specificity)
*Specificity = 1;
if (LeastDerivedKind)
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Oct 1 11:56:40 2014
@@ -4543,7 +4543,7 @@ public:
}
StringRef getABI() const override { return ABI; }
- virtual bool setABI(const std::string &Name) {
+ virtual bool setABI(const std::string &Name) override {
if (Name != "aapcs" && Name != "darwinpcs")
return false;
@@ -4551,7 +4551,7 @@ public:
return true;
}
- virtual bool setCPU(const std::string &Name) {
+ virtual bool setCPU(const std::string &Name) override {
bool CPUKnown = llvm::StringSwitch<bool>(Name)
.Case("generic", true)
.Cases("cortex-a53", "cortex-a57", true)
@@ -4561,7 +4561,7 @@ public:
}
virtual void getTargetDefines(const LangOptions &Opts,
- MacroBuilder &Builder) const {
+ MacroBuilder &Builder) const override {
// Target identification.
Builder.defineMacro("__aarch64__");
@@ -4621,12 +4621,12 @@ public:
}
virtual void getTargetBuiltins(const Builtin::Info *&Records,
- unsigned &NumRecords) const {
+ unsigned &NumRecords) const override {
Records = BuiltinInfo;
NumRecords = clang::AArch64::LastTSBuiltin - Builtin::FirstTSBuiltin;
}
- virtual bool hasFeature(StringRef Feature) const {
+ virtual bool hasFeature(StringRef Feature) const override {
return Feature == "aarch64" ||
Feature == "arm64" ||
(Feature == "neon" && FPU == NeonMode);
@@ -4651,19 +4651,19 @@ public:
return true;
}
- virtual bool isCLZForZeroUndef() const { return false; }
+ virtual bool isCLZForZeroUndef() const override { return false; }
- virtual BuiltinVaListKind getBuiltinVaListKind() const {
+ virtual BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::AArch64ABIBuiltinVaList;
}
virtual void getGCCRegNames(const char *const *&Names,
- unsigned &NumNames) const;
+ unsigned &NumNames) const override;
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
- unsigned &NumAliases) const;
+ unsigned &NumAliases) const override;
virtual bool validateAsmConstraint(const char *&Name,
- TargetInfo::ConstraintInfo &Info) const {
+ TargetInfo::ConstraintInfo &Info) const override {
switch (*Name) {
default:
return false;
@@ -4732,9 +4732,9 @@ public:
}
}
- virtual const char *getClobbers() const { return ""; }
+ virtual const char *getClobbers() const override { return ""; }
- int getEHDataRegisterNumber(unsigned RegNo) const {
+ int getEHDataRegisterNumber(unsigned RegNo) const override {
if (RegNo == 0)
return 0;
if (RegNo == 1)
@@ -4869,7 +4869,7 @@ public:
TheCXXABI.set(TargetCXXABI::iOS64);
}
- virtual BuiltinVaListKind getBuiltinVaListKind() const {
+ virtual BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::CharPtrBuiltinVaList;
}
};
Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Wed Oct 1 11:56:40 2014
@@ -491,7 +491,7 @@ public:
return RD->hasAttr<MSInheritanceAttr>();
}
- virtual bool isTypeInfoCalculable(QualType Ty) const {
+ virtual bool isTypeInfoCalculable(QualType Ty) const override {
if (!CGCXXABI::isTypeInfoCalculable(Ty))
return false;
if (const auto *MPT = Ty->getAs<MemberPointerType>()) {
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Wed Oct 1 11:56:40 2014
@@ -487,7 +487,8 @@ public:
AddCCKextLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
- virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const;
+ virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args)
+ const override;
void
AddLinkARCArgs(const llvm::opt::ArgList &Args,
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Wed Oct 1 11:56:40 2014
@@ -1671,7 +1671,7 @@ class ThreadSafetyReporter : public clan
virtual void handleNegativeNotHeld(StringRef Kind, Name LockName, Name Neg,
- SourceLocation Loc) {
+ SourceLocation Loc) override {
PartialDiagnosticAt Warning(Loc,
S.PDiag(diag::warn_acquire_requires_negative_cap)
<< Kind << LockName << Neg);
Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp Wed Oct 1 11:56:40 2014
@@ -725,7 +725,7 @@ public:
EXPECT_EQ("", Name);
}
- virtual bool run(const BoundNodes *Nodes) {
+ virtual bool run(const BoundNodes *Nodes) override {
const BoundNodes::IDToNodeMap &M = Nodes->getMap();
if (Nodes->getNodeAs<T>(Id)) {
++Count;
@@ -747,7 +747,7 @@ public:
return false;
}
- virtual bool run(const BoundNodes *Nodes, ASTContext *Context) {
+ virtual bool run(const BoundNodes *Nodes, ASTContext *Context) override {
return run(Nodes);
}
Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h Wed Oct 1 11:56:40 2014
@@ -39,7 +39,7 @@ public:
VerifyMatch(BoundNodesCallback *FindResultVerifier, bool *Verified)
: Verified(Verified), FindResultReviewer(FindResultVerifier) {}
- virtual void run(const MatchFinder::MatchResult &Result) {
+ virtual void run(const MatchFinder::MatchResult &Result) override {
if (FindResultReviewer != nullptr) {
*Verified |= FindResultReviewer->run(&Result.Nodes, Result.Context);
} else {
Modified: cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp (original)
+++ cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp Wed Oct 1 11:56:40 2014
@@ -32,7 +32,7 @@ class DummyFileSystem : public vfs::File
public:
DummyFileSystem() : FSID(getNextFSID()), FileID(0) {}
- ErrorOr<vfs::Status> status(const Twine &Path) {
+ ErrorOr<vfs::Status> status(const Twine &Path) override {
std::map<std::string, vfs::Status>::iterator I =
FilesAndDirs.find(Path.str());
if (I == FilesAndDirs.end())
@@ -40,7 +40,7 @@ public:
return I->second;
}
std::error_code openFileForRead(const Twine &Path,
- std::unique_ptr<vfs::File> &Result) {
+ std::unique_ptr<vfs::File> &Result) override {
llvm_unreachable("unimplemented");
}
std::error_code getBufferForFile(const Twine &Name,
Modified: cfe/trunk/unittests/Tooling/ToolingTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/ToolingTest.cpp?rev=218774&r1=218773&r2=218774&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/ToolingTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/ToolingTest.cpp Wed Oct 1 11:56:40 2014
@@ -188,7 +188,7 @@ struct VerifyEndCallback : public Source
++BeginCalled;
return true;
}
- virtual void handleEndSource() {
+ virtual void handleEndSource() override {
++EndCalled;
}
std::unique_ptr<ASTConsumer> newASTConsumer() {
More information about the cfe-commits
mailing list