[all-commits] [llvm/llvm-project] 589142: [clang] Use std::nullopt instead of None (NFC)

kazutakahirata via All-commits all-commits at lists.llvm.org
Sat Dec 3 11:55:05 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5891420e6848e86a069dc6b7b73f175e22388f4a
      https://github.com/llvm/llvm-project/commit/5891420e6848e86a069dc6b7b73f175e22388f4a
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-12-03 (Sat, 03 Dec 2022)

  Changed paths:
    M clang/include/clang/APINotes/Types.h
    M clang/include/clang/ASTMatchers/ASTMatchFinder.h
    M clang/include/clang/ASTMatchers/ASTMatchersInternal.h
    M clang/include/clang/Driver/Job.h
    M clang/include/clang/Frontend/ASTUnit.h
    M clang/include/clang/Frontend/CommandLineSourceLoc.h
    M clang/include/clang/Frontend/FrontendOptions.h
    M clang/include/clang/Lex/DirectoryLookup.h
    M clang/include/clang/Lex/ModuleMap.h
    M clang/include/clang/Lex/PreprocessingRecord.h
    M clang/include/clang/Lex/Preprocessor.h
    M clang/include/clang/Parse/Parser.h
    M clang/include/clang/Serialization/ModuleFile.h
    M clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
    M clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
    M clang/include/clang/Tooling/DependencyScanning/DependencyScanningWorker.h
    M clang/lib/APINotes/APINotesYAMLCompiler.cpp
    M clang/lib/ARCMigrate/Internals.h
    M clang/lib/ARCMigrate/ObjCMT.cpp
    M clang/lib/ASTMatchers/ASTMatchFinder.cpp
    M clang/lib/ASTMatchers/ASTMatchersInternal.cpp
    M clang/lib/ASTMatchers/Dynamic/Marshallers.cpp
    M clang/lib/ASTMatchers/Dynamic/Marshallers.h
    M clang/lib/ASTMatchers/Dynamic/Parser.cpp
    M clang/lib/ASTMatchers/Dynamic/VariantValue.cpp
    M clang/lib/CrossTU/CrossTranslationUnit.cpp
    M clang/lib/DirectoryWatcher/DirectoryScanner.cpp
    M clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
    M clang/lib/Driver/Compilation.cpp
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/AIX.cpp
    M clang/lib/Driver/ToolChains/Darwin.cpp
    M clang/lib/Driver/ToolChains/Gnu.h
    M clang/lib/ExtractAPI/ExtractAPIConsumer.cpp
    M clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
    M clang/lib/Format/ContinuationIndenter.cpp
    M clang/lib/Format/Format.cpp
    M clang/lib/Frontend/ASTUnit.cpp
    M clang/lib/Frontend/CompilerInstance.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/lib/Frontend/DiagnosticRenderer.cpp
    M clang/lib/Frontend/FrontendAction.cpp
    M clang/lib/Frontend/TextDiagnostic.cpp
    M clang/lib/Index/IndexingContext.h
    M clang/lib/Lex/DependencyDirectivesScanner.cpp
    M clang/lib/Lex/HeaderMap.cpp
    M clang/lib/Lex/HeaderSearch.cpp
    M clang/lib/Lex/InitHeaderSearch.cpp
    M clang/lib/Lex/Lexer.cpp
    M clang/lib/Lex/ModuleMap.cpp
    M clang/lib/Lex/PPDirectives.cpp
    M clang/lib/Lex/PPMacroExpansion.cpp
    M clang/lib/Parse/ParseDecl.cpp
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Parse/ParseExpr.cpp
    M clang/lib/Parse/ParseExprCXX.cpp
    M clang/lib/Parse/ParseInit.cpp
    M clang/lib/Parse/ParseObjc.cpp
    M clang/lib/Parse/ParseOpenMP.cpp
    M clang/lib/Parse/ParsePragma.cpp
    M clang/lib/Parse/ParseStmt.cpp
    M clang/lib/Parse/ParseTemplate.cpp
    M clang/lib/Parse/Parser.cpp
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/lib/Serialization/ASTWriterDecl.cpp
    M clang/lib/Serialization/ModuleManager.cpp
    M clang/lib/Support/RISCVVIntrinsicUtils.cpp
    M clang/lib/Tooling/ASTDiff/ASTDiff.cpp
    M clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
    M clang/lib/Tooling/Inclusions/HeaderAnalysis.cpp
    M clang/lib/Tooling/Inclusions/HeaderIncludes.cpp
    M clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
    M clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
    M clang/lib/Tooling/Refactoring/ASTSelection.cpp
    M clang/lib/Tooling/Syntax/Tokens.cpp
    M clang/lib/Tooling/Transformer/Parsing.cpp
    M clang/lib/Tooling/Transformer/SourceCode.cpp
    M clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    M clang/tools/clang-refactor/ClangRefactor.cpp
    M clang/tools/clang-refactor/TestSupport.cpp
    M clang/tools/diagtool/FindDiagnosticID.cpp
    M clang/tools/driver/cc1_main.cpp
    M clang/tools/driver/cc1gen_reproducer_main.cpp
    M clang/tools/driver/driver.cpp
    M clang/tools/libclang/CIndex.cpp
    M clang/tools/libclang/CXType.cpp
    M clang/utils/TableGen/NeonEmitter.cpp

  Log Message:
  -----------
  [clang] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716


  Commit: cd8702efe7e6cacfd82cc4909e42718224bcd5d0
      https://github.com/llvm/llvm-project/commit/cd8702efe7e6cacfd82cc4909e42718224bcd5d0
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-12-03 (Sat, 03 Dec 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
    M clang-tools-extra/clang-tidy/ClangTidyCheck.h
    M clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
    M clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
    M clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp
    M clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp
    M clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
    M clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp
    M clang-tools-extra/clang-tidy/bugprone/BadSignalToKillThreadCheck.cpp
    M clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
    M clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
    M clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp
    M clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp
    M clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
    M clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
    M clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp
    M clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp
    M clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp
    M clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
    M clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
    M clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp
    M clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
    M clang-tools-extra/clang-tidy/readability/IsolateDeclarationCheck.cpp
    M clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp
    M clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp
    M clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp
    M clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
    M clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
    M clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp
    M clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp
    M clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp
    M clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
    M clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
    M clang-tools-extra/clang-tidy/utils/LexerUtils.cpp
    M clang-tools-extra/clang-tidy/utils/NamespaceAliaser.cpp
    M clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
    M clang-tools-extra/clang-tidy/utils/TypeTraits.cpp
    M clang-tools-extra/clang-tidy/utils/UsingInserter.cpp

  Log Message:
  -----------
  [clang-tidy] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716


  Commit: 059a23c0f01fd6e5bcef0e403d8108a761ad66f5
      https://github.com/llvm/llvm-project/commit/059a23c0f01fd6e5bcef0e403d8108a761ad66f5
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-12-03 (Sat, 03 Dec 2022)

  Changed paths:
    M clang-tools-extra/clang-doc/HTMLGenerator.cpp
    M clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.cpp
    M clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbols.cpp
    M clang-tools-extra/clang-query/Query.cpp
    M clang-tools-extra/clangd/AST.cpp
    M clang-tools-extra/clangd/ClangdLSPServer.cpp
    M clang-tools-extra/clangd/ClangdServer.cpp
    M clang-tools-extra/clangd/ClangdServer.h
    M clang-tools-extra/clangd/CodeComplete.cpp
    M clang-tools-extra/clangd/CompileCommands.cpp
    M clang-tools-extra/clangd/Config.h
    M clang-tools-extra/clangd/ConfigCompile.cpp
    M clang-tools-extra/clangd/ConfigYAML.cpp
    M clang-tools-extra/clangd/Diagnostics.cpp
    M clang-tools-extra/clangd/DraftStore.cpp
    M clang-tools-extra/clangd/DumpAST.cpp
    M clang-tools-extra/clangd/ExpectedTypes.cpp
    M clang-tools-extra/clangd/FS.cpp
    M clang-tools-extra/clangd/FindSymbols.cpp
    M clang-tools-extra/clangd/FuzzyMatch.cpp
    M clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
    M clang-tools-extra/clangd/GlobalCompilationDatabase.h
    M clang-tools-extra/clangd/HeaderSourceSwitch.cpp
    M clang-tools-extra/clangd/Headers.cpp
    M clang-tools-extra/clangd/Hover.cpp
    M clang-tools-extra/clangd/IncludeCleaner.cpp
    M clang-tools-extra/clangd/IncludeFixer.cpp
    M clang-tools-extra/clangd/InlayHints.cpp
    M clang-tools-extra/clangd/ParsedAST.cpp
    M clang-tools-extra/clangd/PathMapping.cpp
    M clang-tools-extra/clangd/Preamble.cpp
    M clang-tools-extra/clangd/Quality.cpp
    M clang-tools-extra/clangd/Selection.cpp
    M clang-tools-extra/clangd/SemanticHighlighting.cpp
    M clang-tools-extra/clangd/SemanticSelection.cpp
    M clang-tools-extra/clangd/SourceCode.cpp
    M clang-tools-extra/clangd/SourceCode.h
    M clang-tools-extra/clangd/SystemIncludeExtractor.cpp
    M clang-tools-extra/clangd/TUScheduler.cpp
    M clang-tools-extra/clangd/XRefs.cpp
    M clang-tools-extra/clangd/index/Background.cpp
    M clang-tools-extra/clangd/index/FileIndex.cpp
    M clang-tools-extra/clangd/index/IndexAction.cpp
    M clang-tools-extra/clangd/index/StdLib.cpp
    M clang-tools-extra/clangd/index/SymbolCollector.cpp
    M clang-tools-extra/clangd/index/dex/PostingList.cpp
    M clang-tools-extra/clangd/refactor/InsertionPoint.cpp
    M clang-tools-extra/clangd/refactor/Rename.cpp
    M clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
    M clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
    M clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
    M clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
    M clang-tools-extra/clangd/refactor/tweaks/ObjCMemberwiseInitializer.cpp
    M clang-tools-extra/clangd/support/FileCache.cpp
    M clang-tools-extra/clangd/support/ThreadsafeFS.cpp
    M clang-tools-extra/clangd/tool/Check.cpp
    M clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h
    M clang-tools-extra/pseudo/lib/DirectiveTree.cpp
    M clang-tools-extra/pseudo/lib/Forest.cpp
    M clang-tools-extra/pseudo/lib/grammar/Grammar.cpp

  Log Message:
  -----------
  [clang-tools-extra] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716


Compare: https://github.com/llvm/llvm-project/compare/0c2f6e36f9b2...059a23c0f01f


More information about the All-commits mailing list