Switch all uses of LLVM_OVERRIDE to just use 'override' directly.

llvm-svn: 202625
This commit is contained in:
Craig Topper 2014-03-02 09:32:10 +00:00
parent 9737e3886b
commit a798a9db93
22 changed files with 55 additions and 56 deletions

View File

@ -420,15 +420,15 @@ public:
InnerMatcher(Other), AllowBind(AllowBind) {}
bool matches(const ast_type_traits::DynTypedNode DynNode,
ASTMatchFinder *Finder, BoundNodesTreeBuilder *Builder) const
LLVM_OVERRIDE {
ASTMatchFinder *Finder,
BoundNodesTreeBuilder *Builder) const override {
if (const T *Node = DynNode.get<T>()) {
return InnerMatcher.matches(*Node, Finder, Builder);
}
return false;
}
llvm::Optional<DynTypedMatcher> tryBind(StringRef ID) const LLVM_OVERRIDE {
llvm::Optional<DynTypedMatcher> tryBind(StringRef ID) const override {
if (!AllowBind)
return llvm::Optional<DynTypedMatcher>();
return DynTypedMatcher(BindableMatcher<T>(InnerMatcher).bind(ID));
@ -534,7 +534,7 @@ public:
explicit HasOverloadedOperatorNameMatcher(const StringRef Name)
: SingleNodeMatcherInterface<T>(), Name(Name) {}
virtual bool matchesNode(const T &Node) const LLVM_OVERRIDE {
virtual bool matchesNode(const T &Node) const override {
return matchesSpecialized(Node);
}

View File

@ -147,9 +147,9 @@ public:
/// \brief Pushes a file system on top of the stack.
void pushOverlay(IntrusiveRefCntPtr<FileSystem> FS);
llvm::ErrorOr<Status> status(const Twine &Path) LLVM_OVERRIDE;
llvm::ErrorOr<Status> status(const Twine &Path) override;
llvm::error_code openFileForRead(const Twine &Path,
OwningPtr<File> &Result) LLVM_OVERRIDE;
OwningPtr<File> &Result) override;
};
/// \brief Get a globally unique ID for a virtual file or directory.

View File

@ -742,7 +742,7 @@ public:
virtual void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop,
const ObjCPropertyDecl *OrigProp,
const ObjCCategoryDecl *ClassExt);
void DeclarationMarkedUsed(const Decl *D) LLVM_OVERRIDE;
void DeclarationMarkedUsed(const Decl *D) override;
};
/// \brief AST and semantic-analysis consumer that generates a

View File

@ -339,14 +339,14 @@ inline FrontendActionFactory *newFrontendActionFactory(
protected:
virtual bool BeginSourceFileAction(CompilerInstance &CI,
StringRef Filename) LLVM_OVERRIDE {
StringRef Filename) override {
if (!clang::ASTFrontendAction::BeginSourceFileAction(CI, Filename))
return false;
if (Callbacks != NULL)
return Callbacks->handleBeginSource(CI, Filename);
return true;
}
virtual void EndSourceFileAction() LLVM_OVERRIDE {
virtual void EndSourceFileAction() override {
if (Callbacks != NULL)
Callbacks->handleEndSource();
clang::ASTFrontendAction::EndSourceFileAction();

View File

@ -393,9 +393,9 @@ public:
DerivedKind(ast_type_traits::ASTNodeKind::getFromNodeKind<DerivedT>()) {
}
bool isConvertibleTo(ast_type_traits::ASTNodeKind Kind, unsigned *Specificity,
ast_type_traits::ASTNodeKind *LeastDerivedKind) const
LLVM_OVERRIDE {
bool
isConvertibleTo(ast_type_traits::ASTNodeKind Kind, unsigned *Specificity,
ast_type_traits::ASTNodeKind *LeastDerivedKind) const override {
// If Kind is not a base of DerivedKind, either DerivedKind is a base of
// Kind (in which case the match will always succeed) or Kind and
// DerivedKind are unrelated (in which case it will always fail), so set

View File

@ -92,12 +92,12 @@ class RealFile : public File {
public:
~RealFile();
ErrorOr<Status> status() LLVM_OVERRIDE;
ErrorOr<Status> status() override;
error_code getBuffer(const Twine &Name, OwningPtr<MemoryBuffer> &Result,
int64_t FileSize = -1,
bool RequiresNullTerminator = true) LLVM_OVERRIDE;
error_code close() LLVM_OVERRIDE;
void setName(StringRef Name) LLVM_OVERRIDE;
bool RequiresNullTerminator = true) override;
error_code close() override;
void setName(StringRef Name) override;
};
} // end anonymous namespace
RealFile::~RealFile() { close(); }
@ -148,9 +148,9 @@ namespace {
/// \brief The file system according to your operating system.
class RealFileSystem : public FileSystem {
public:
ErrorOr<Status> status(const Twine &Path) LLVM_OVERRIDE;
ErrorOr<Status> status(const Twine &Path) override;
error_code openFileForRead(const Twine &Path,
OwningPtr<File> &Result) LLVM_OVERRIDE;
OwningPtr<File> &Result) override;
};
} // end anonymous namespace
@ -387,9 +387,9 @@ public:
void *DiagContext,
IntrusiveRefCntPtr<FileSystem> ExternalFS);
ErrorOr<Status> status(const Twine &Path) LLVM_OVERRIDE;
ErrorOr<Status> status(const Twine &Path) override;
error_code openFileForRead(const Twine &Path,
OwningPtr<File> &Result) LLVM_OVERRIDE;
OwningPtr<File> &Result) override;
};
/// \brief A helper class to hold the common YAML parsing state.

View File

@ -575,7 +575,7 @@ public:
}
llvm::GlobalVariable *GetClassGlobal(const std::string &Name,
bool Weak = false) LLVM_OVERRIDE {
bool Weak = false) override {
return 0;
}
};

View File

@ -1273,7 +1273,7 @@ public:
/// GetClassGlobal - Return the global variable for the Objective-C
/// class of the given name.
llvm::GlobalVariable *GetClassGlobal(const std::string &Name,
bool Weak = false) LLVM_OVERRIDE {
bool Weak = false) override {
llvm_unreachable("CGObjCMac::GetClassGlobal");
}
};
@ -1375,7 +1375,7 @@ private:
/// GetClassGlobal - Return the global variable for the Objective-C
/// class of the given name.
llvm::GlobalVariable *GetClassGlobal(const std::string &Name,
bool Weak = false) LLVM_OVERRIDE;
bool Weak = false) override;
/// EmitClassRef - Return a Value*, of type ObjCTypes.ClassPtrTy,
/// for the given class reference.

View File

@ -106,7 +106,7 @@ namespace {
}
}
virtual void HandleTagDeclRequiredDefinition(const TagDecl *D) LLVM_OVERRIDE {
virtual void HandleTagDeclRequiredDefinition(const TagDecl *D) override {
if (Diags.hasErrorOccurred())
return;

View File

@ -251,7 +251,7 @@ MultilibSet &MultilibSet::FilterOut(std::string Regex) {
public:
REFilter(std::string Regex) : R(Regex) {}
bool operator()(const Multilib &M) const LLVM_OVERRIDE {
bool operator()(const Multilib &M) const override {
std::string Error;
if (!R.isValid(Error)) {
llvm::errs() << Error;
@ -288,7 +288,7 @@ bool MultilibSet::select(const Multilib::flags_list &Flags, Multilib &M) const {
FlagSet[StringRef(*I).substr(1)] = isFlagEnabled(*I);
}
}
bool operator()(const Multilib &M) const LLVM_OVERRIDE {
bool operator()(const Multilib &M) const override {
for (Multilib::flags_list::const_iterator I = M.flags().begin(),
E = M.flags().end();
I != E; ++I) {

View File

@ -1526,7 +1526,7 @@ class FilterNonExistent : public MultilibSet::FilterCallback {
std::string Base;
public:
FilterNonExistent(std::string Base) : Base(Base) {}
bool operator()(const Multilib &M) const LLVM_OVERRIDE {
bool operator()(const Multilib &M) const override {
return !llvm::sys::fs::exists(Base + M.gccSuffix() + "/crtbegin.o");
}
};

View File

@ -361,11 +361,11 @@ public:
virtual void
addMinVersionArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const LLVM_OVERRIDE;
llvm::opt::ArgStringList &CmdArgs) const override;
virtual void
addStartObjectFileArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const LLVM_OVERRIDE;
llvm::opt::ArgStringList &CmdArgs) const override;
virtual bool isKernelStatic() const {
return !isTargetIPhoneOS() || isIPhoneOSVersionLT(6, 0);
@ -478,19 +478,19 @@ public:
virtual void
AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const LLVM_OVERRIDE;
llvm::opt::ArgStringList &CmdArgs) const override;
virtual void
AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const LLVM_OVERRIDE;
llvm::opt::ArgStringList &CmdArgs) const override;
virtual void
AddCCKextLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const LLVM_OVERRIDE;
llvm::opt::ArgStringList &CmdArgs) const override;
virtual void
AddLinkARCArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const LLVM_OVERRIDE;
llvm::opt::ArgStringList &CmdArgs) const override;
/// }
};

View File

@ -107,7 +107,7 @@ public:
virtual void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop,
const ObjCPropertyDecl *OrigProp,
const ObjCCategoryDecl *ClassExt);
void DeclarationMarkedUsed(const Decl *D) LLVM_OVERRIDE;
void DeclarationMarkedUsed(const Decl *D) override;
private:
std::vector<ASTMutationListener*> Listeners;

View File

@ -2495,7 +2495,7 @@ public:
explicit MemInitializerValidatorCCC(CXXRecordDecl *ClassDecl)
: ClassDecl(ClassDecl) {}
bool ValidateCandidate(const TypoCorrection &candidate) LLVM_OVERRIDE {
bool ValidateCandidate(const TypoCorrection &candidate) override {
if (NamedDecl *ND = candidate.getCorrectionDecl()) {
if (FieldDecl *Member = dyn_cast<FieldDecl>(ND))
return Member->getDeclContext()->getRedeclContext()->Equals(ClassDecl);
@ -4104,7 +4104,7 @@ bool Sema::RequireNonAbstractType(SourceLocation Loc, QualType T,
NonAbstractTypeDiagnoser(unsigned DiagID, AbstractDiagSelID SelID)
: TypeDiagnoser(DiagID == 0), DiagID(DiagID), SelID(SelID) { }
void diagnose(Sema &S, SourceLocation Loc, QualType T) LLVM_OVERRIDE {
void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
if (Suppressed) return;
if (SelID == -1)
S.Diag(Loc, DiagID) << T;
@ -6941,7 +6941,7 @@ namespace {
// Callback to only accept typo corrections that are namespaces.
class NamespaceValidatorCCC : public CorrectionCandidateCallback {
public:
bool ValidateCandidate(const TypoCorrection &candidate) LLVM_OVERRIDE {
bool ValidateCandidate(const TypoCorrection &candidate) override {
if (NamedDecl *ND = candidate.getCorrectionDecl())
return isa<NamespaceDecl>(ND) || isa<NamespaceAliasDecl>(ND);
return false;
@ -7379,7 +7379,7 @@ public:
: HasTypenameKeyword(HasTypenameKeyword),
IsInstantiation(IsInstantiation), RequireMember(RequireMember) {}
bool ValidateCandidate(const TypoCorrection &Candidate) LLVM_OVERRIDE {
bool ValidateCandidate(const TypoCorrection &Candidate) override {
NamedDecl *ND = Candidate.getCorrectionDecl();
// Keywords are not valid here.
@ -8823,7 +8823,7 @@ class RefBuilder: public ExprBuilder {
QualType VarType;
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(S.BuildDeclRefExpr(Var, VarType, VK_LValue, Loc).take());
}
@ -8833,7 +8833,7 @@ public:
class ThisBuilder: public ExprBuilder {
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(S.ActOnCXXThis(Loc).takeAs<Expr>());
}
};
@ -8845,7 +8845,7 @@ class CastBuilder: public ExprBuilder {
const CXXCastPath &Path;
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(S.ImpCastExprToType(Builder.build(S, Loc), Type,
CK_UncheckedDerivedToBase, Kind,
&Path).take());
@ -8860,7 +8860,7 @@ class DerefBuilder: public ExprBuilder {
const ExprBuilder &Builder;
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(
S.CreateBuiltinUnaryOp(Loc, UO_Deref, Builder.build(S, Loc)).take());
}
@ -8876,7 +8876,7 @@ class MemberBuilder: public ExprBuilder {
LookupResult &MemberLookup;
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(S.BuildMemberReferenceExpr(
Builder.build(S, Loc), Type, Loc, IsArrow, SS, SourceLocation(), 0,
MemberLookup, 0).take());
@ -8892,7 +8892,7 @@ class MoveCastBuilder: public ExprBuilder {
const ExprBuilder &Builder;
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(CastForMoving(S, Builder.build(S, Loc)));
}
@ -8903,7 +8903,7 @@ class LvalueConvBuilder: public ExprBuilder {
const ExprBuilder &Builder;
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(
S.DefaultLvalueConversion(Builder.build(S, Loc)).take());
}
@ -8916,8 +8916,7 @@ class SubscriptBuilder: public ExprBuilder {
const ExprBuilder &Index;
public:
virtual Expr *build(Sema &S, SourceLocation Loc) const
LLVM_OVERRIDE {
virtual Expr *build(Sema &S, SourceLocation Loc) const override {
return assertNotNull(S.CreateBuiltinArraySubscriptExpr(
Base.build(S, Loc), Loc, Index.build(S, Loc), Loc).take());
}

View File

@ -381,7 +381,7 @@ public:
}
virtual void
AddDiagnosticConsumer(PathDiagnosticConsumer *Consumer) LLVM_OVERRIDE {
AddDiagnosticConsumer(PathDiagnosticConsumer *Consumer) override {
PathConsumers.push_back(Consumer);
}

View File

@ -157,7 +157,7 @@ public:
UnusedInputDiagConsumer(DiagnosticConsumer *Other) : Other(Other) {}
virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Info) LLVM_OVERRIDE {
const Diagnostic &Info) override {
if (Info.getID() == clang::diag::warn_drv_input_file_unused) {
// Arg 1 for this diagnostic is the option that didn't get used.
UnusedInputs.push_back(Info.getArgStdStr(0));

View File

@ -152,7 +152,7 @@ public:
}
virtual CommandLineArguments
Adjust(const CommandLineArguments &Args) LLVM_OVERRIDE {
Adjust(const CommandLineArguments &Args) override {
CommandLineArguments Return(Args);
CommandLineArguments::iterator I;

View File

@ -281,7 +281,7 @@ namespace {
class StringSetSaver : public llvm::cl::StringSaver {
public:
StringSetSaver(std::set<std::string> &Storage) : Storage(Storage) {}
const char *SaveString(const char *Str) LLVM_OVERRIDE {
const char *SaveString(const char *Str) override {
return SaveStringInSet(Storage, Str);
}
private:

View File

@ -665,7 +665,7 @@ public:
: Id(Id), ExpectedCount(ExpectedCount), Count(0),
ExpectedName(ExpectedName) {}
void onEndOfTranslationUnit() LLVM_OVERRIDE {
void onEndOfTranslationUnit() override {
if (ExpectedCount != -1)
EXPECT_EQ(ExpectedCount, Count);
if (!ExpectedName.empty())

View File

@ -47,7 +47,7 @@ public:
}
}
void onEndOfTranslationUnit() LLVM_OVERRIDE {
void onEndOfTranslationUnit() override {
if (FindResultReviewer)
FindResultReviewer->onEndOfTranslationUnit();
}

View File

@ -256,7 +256,7 @@ TEST(MultilibTest, SetRegexFilter) {
TEST(MultilibTest, SetFilterObject) {
// Filter object
struct StartsWithP : public MultilibSet::FilterCallback {
bool operator()(const Multilib &M) const LLVM_OVERRIDE {
bool operator()(const Multilib &M) const override {
return StringRef(M.gccSuffix()).startswith("/p");
}
};

View File

@ -177,7 +177,7 @@ TEST(ToolInvocation, TestVirtualModulesCompilation) {
struct VerifyEndCallback : public SourceFileCallbacks {
VerifyEndCallback() : BeginCalled(0), EndCalled(0), Matched(false) {}
virtual bool handleBeginSource(CompilerInstance &CI,
StringRef Filename) LLVM_OVERRIDE {
StringRef Filename) override {
++BeginCalled;
return true;
}
@ -243,7 +243,7 @@ struct CheckSyntaxOnlyAdjuster: public ArgumentsAdjuster {
CheckSyntaxOnlyAdjuster(bool &Found, bool &Ran) : Found(Found), Ran(Ran) { }
virtual CommandLineArguments
Adjust(const CommandLineArguments &Args) LLVM_OVERRIDE {
Adjust(const CommandLineArguments &Args) override {
Ran = true;
for (unsigned I = 0, E = Args.size(); I != E; ++I) {
if (Args[I] == "-fsyntax-only") {