Author: hans Date: Thu Sep 10 12:07:54 2015 New Revision: 247302 URL: http://llvm.org/viewvc/llvm-project?rev=247302&view=rev Log: Re-commit r247218: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
This never broke the build; it was the LLVM side, r247216, that caused problems. Modified: cfe/trunk/lib/Basic/Targets.cpp cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp cfe/trunk/lib/Driver/ToolChains.h cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp cfe/trunk/lib/Frontend/PCHContainerOperations.cpp Modified: cfe/trunk/lib/Basic/Targets.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=247302&r1=247301&r2=247302&view=diff ============================================================================== --- cfe/trunk/lib/Basic/Targets.cpp (original) +++ cfe/trunk/lib/Basic/Targets.cpp Thu Sep 10 12:07:54 2015 @@ -30,6 +30,7 @@ #include "llvm/Support/TargetParser.h" #include <algorithm> #include <memory> + using namespace clang; //===----------------------------------------------------------------------===// @@ -739,7 +740,7 @@ namespace { template <typename Target> class WebAssemblyOSTargetInfo : public OSTargetInfo<Target> { void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, - MacroBuilder &Builder) const override final { + MacroBuilder &Builder) const final { // A common platform macro. if (Opts.POSIXThreads) Builder.defineMacro("_REENTRANT"); @@ -749,7 +750,7 @@ class WebAssemblyOSTargetInfo : public O } // As an optimization, group static init code together in a section. - const char *getStaticInitSectionSpecifier() const override final { + const char *getStaticInitSectionSpecifier() const final { return ".text.__startup"; } @@ -7011,13 +7012,13 @@ private: Features["simd128"] = true; return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec); } - bool hasFeature(StringRef Feature) const override final { + bool hasFeature(StringRef Feature) const final { return llvm::StringSwitch<bool>(Feature) .Case("simd128", SIMDLevel >= SIMD128) .Default(false); } bool handleTargetFeatures(std::vector<std::string> &Features, - DiagnosticsEngine &Diags) override final { + DiagnosticsEngine &Diags) final { for (const auto &Feature : Features) { if (Feature == "+simd128") { SIMDLevel = std::max(SIMDLevel, SIMD128); @@ -7034,7 +7035,7 @@ private: } return true; } - bool setCPU(const std::string &Name) override final { + bool setCPU(const std::string &Name) final { return llvm::StringSwitch<bool>(Name) .Case("mvp", true) .Case("bleeding-edge", true) @@ -7042,32 +7043,32 @@ private: .Default(false); } void getTargetBuiltins(const Builtin::Info *&Records, - unsigned &NumRecords) const override final { + unsigned &NumRecords) const final { Records = BuiltinInfo; NumRecords = clang::WebAssembly::LastTSBuiltin - Builtin::FirstTSBuiltin; } - BuiltinVaListKind getBuiltinVaListKind() const override final { + BuiltinVaListKind getBuiltinVaListKind() const final { // TODO: Implement va_list properly. return VoidPtrBuiltinVaList; } void getGCCRegNames(const char *const *&Names, - unsigned &NumNames) const override final { + unsigned &NumNames) const final { Names = nullptr; NumNames = 0; } void getGCCRegAliases(const GCCRegAlias *&Aliases, - unsigned &NumAliases) const override final { + unsigned &NumAliases) const final { Aliases = nullptr; NumAliases = 0; } bool validateAsmConstraint(const char *&Name, - TargetInfo::ConstraintInfo &Info) const override final { + TargetInfo::ConstraintInfo &Info) const final { return false; } - const char *getClobbers() const override final { return ""; } - bool isCLZForZeroUndef() const override final { return false; } - bool hasInt128Type() const override final { return true; } + const char *getClobbers() const final { return ""; } + bool isCLZForZeroUndef() const final { return false; } + bool hasInt128Type() const final { return true; } }; const Builtin::Info WebAssemblyTargetInfo::BuiltinInfo[] = { Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=247302&r1=247301&r2=247302&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original) +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Thu Sep 10 12:07:54 2015 @@ -59,7 +59,7 @@ public: virtual const VarDecl *getThreadIDVariable() const = 0; /// \brief Emit the captured statement body. - virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) override; + void EmitBody(CodeGenFunction &CGF, const Stmt *S) override; /// \brief Get an LValue for the current ThreadID variable. /// \return LValue for thread id variable. This LValue always has type int32*. @@ -156,7 +156,7 @@ public: return OuterRegionInfo->getContextValue(); llvm_unreachable("No context value for inlined OpenMP region"); } - virtual void setContextValue(llvm::Value *V) override { + void setContextValue(llvm::Value *V) override { if (OuterRegionInfo) { OuterRegionInfo->setContextValue(V); return; @@ -229,7 +229,7 @@ public: } }; -} // namespace +} // anonymous namespace static LValue emitLoadOfPointerLValue(CodeGenFunction &CGF, Address PtrAddr, QualType Ty) { @@ -1286,7 +1286,7 @@ public: CGF.EmitRuntimeCall(Callee, Args); } }; -} // namespace +} // anonymous namespace void CGOpenMPRuntime::emitCriticalRegion(CodeGenFunction &CGF, StringRef CriticalName, @@ -1834,7 +1834,7 @@ enum KmpTaskTFields { /// \brief Function with call of destructors for private variables. KmpTaskTDestructors, }; -} // namespace +} // anonymous namespace void CGOpenMPRuntime::emitKmpRoutineEntryT(QualType KmpInt32Ty) { if (!KmpRoutineEntryPtrTy) { @@ -1869,7 +1869,7 @@ struct PrivateHelpersTy { const VarDecl *PrivateElemInit; }; typedef std::pair<CharUnits /*Align*/, PrivateHelpersTy> PrivateDataTy; -} // namespace +} // anonymous namespace static RecordDecl * createPrivatesRecordDecl(CodeGenModule &CGM, @@ -2910,4 +2910,3 @@ void CGOpenMPRuntime::emitCancelCall(Cod } } } - Modified: cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp?rev=247302&r1=247301&r2=247302&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (original) +++ cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp Thu Sep 10 12:07:54 2015 @@ -30,6 +30,7 @@ #include "llvm/Object/ObjectFile.h" #include "llvm/Support/TargetRegistry.h" #include <memory> + using namespace clang; #define DEBUG_TYPE "pchcontainer" @@ -139,7 +140,7 @@ public: CodeGenOpts.SplitDwarfFile = OutputFileName; } - virtual ~PCHContainerGenerator() {} + ~PCHContainerGenerator() override = default; void Initialize(ASTContext &Context) override { assert(!Ctx && "initialized multiple times"); @@ -254,7 +255,7 @@ public: } }; -} // namespace +} // anonymous namespace std::unique_ptr<ASTConsumer> ObjectFilePCHContainerWriter::CreatePCHContainerGenerator( @@ -290,5 +291,4 @@ void ObjectFilePCHContainerReader::Extra // As a fallback, treat the buffer as a raw AST. StreamFile.init((const unsigned char *)Buffer.getBufferStart(), (const unsigned char *)Buffer.getBufferEnd()); - return; } Modified: cfe/trunk/lib/Driver/ToolChains.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=247302&r1=247301&r2=247302&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains.h (original) +++ cfe/trunk/lib/Driver/ToolChains.h Thu Sep 10 12:07:54 2015 @@ -923,7 +923,7 @@ public: const llvm::opt::ArgList &Args); ~SHAVEToolChain() override; - virtual Tool *SelectTool(const JobAction &JA) const override; + Tool *SelectTool(const JobAction &JA) const override; protected: Tool *getTool(Action::ActionClass AC) const override; @@ -960,4 +960,4 @@ private: } // end namespace driver } // end namespace clang -#endif +#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_H Modified: cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp?rev=247302&r1=247301&r2=247302&view=diff ============================================================================== --- cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp (original) +++ cfe/trunk/lib/Format/UnwrappedLineFormatter.cpp Thu Sep 10 12:07:54 2015 @@ -606,7 +606,7 @@ public: /// \brief Puts all tokens into a single line. unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, - bool DryRun) { + bool DryRun) override { unsigned Penalty = 0; LineState State = Indenter->getInitialState(FirstIndent, &Line, DryRun); while (State.NextToken) { @@ -629,7 +629,7 @@ public: /// \brief Formats the line by finding the best line breaks with line lengths /// below the column limit. unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, - bool DryRun) { + bool DryRun) override { LineState State = Indenter->getInitialState(FirstIndent, &Line, DryRun); // If the ObjC method declaration does not fit on a line, we should format @@ -791,7 +791,7 @@ private: llvm::SpecificBumpPtrAllocator<StateNode> Allocator; }; -} // namespace +} // anonymous namespace unsigned UnwrappedLineFormatter::format(const SmallVectorImpl<AnnotatedLine *> &Lines, Modified: cfe/trunk/lib/Frontend/PCHContainerOperations.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHContainerOperations.cpp?rev=247302&r1=247301&r2=247302&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/PCHContainerOperations.cpp (original) +++ cfe/trunk/lib/Frontend/PCHContainerOperations.cpp Thu Sep 10 12:07:54 2015 @@ -16,6 +16,7 @@ #include "llvm/Bitcode/BitstreamReader.h" #include "llvm/Support/raw_ostream.h" #include "clang/Lex/ModuleLoader.h" + using namespace clang; namespace { @@ -36,7 +37,7 @@ public: std::shared_ptr<PCHBuffer> Buffer) : Buffer(Buffer), OS(OS) {} - virtual ~RawPCHContainerGenerator() {} + ~RawPCHContainerGenerator() override = default; void HandleTranslationUnit(ASTContext &Ctx) override { if (Buffer->IsComplete) { @@ -49,7 +50,8 @@ public: Buffer->Data = std::move(Empty); } }; -} + +} // anonymous namespace std::unique_ptr<ASTConsumer> RawPCHContainerWriter::CreatePCHContainerGenerator( DiagnosticsEngine &Diags, const HeaderSearchOptions &HSO, _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits