diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td index f952b08502db1..8a26aace90a14 100644 --- a/clang/include/clang/AST/PropertiesBase.td +++ b/clang/include/clang/AST/PropertiesBase.td @@ -41,7 +41,7 @@ class RefPropertyType : PropertyType { let PackOptional = "value ? *value : nullptr"; let UnpackOptional = - "value ? llvm::Optional<" # CXXName # ">(value) : llvm::None"; + "value ? llvm::Optional<" # CXXName # ">(value) : std::nullopt"; } /// Property types that correspond to a specific subclass of another type. @@ -58,7 +58,7 @@ class DefaultValuePropertyType : PropertyType { let PackOptional = "value ? *value : " # CXXName # "()"; let UnpackOptional = - "value.isNull() ? llvm::None : llvm::Optional<" # CXXName # ">(value)"; + "value.isNull() ? std::nullopt : llvm::Optional<" # CXXName # ">(value)"; } /// Property types that correspond to integer types and support optional @@ -67,7 +67,7 @@ class CountPropertyType : PropertyType { let PackOptional = "value ? *value + 1 : 0"; let UnpackOptional = - "value ? llvm::Optional<" # CXXName # ">(value - 1) : llvm::None"; + "value ? llvm::Optional<" # CXXName # ">(value - 1) : std::nullopt"; } def APInt : PropertyType<"llvm::APInt"> { let PassByReference = 1; } diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index 89bbc0fde7096..84cf787487b7b 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -668,7 +668,7 @@ let Class = TemplateSpecializationType in { node->isTypeAlias() ? llvm::Optional(node->getAliasedType()) : node->isCanonicalUnqualified() - ? llvm::None + ? std::nullopt : llvm::Optional(node->getCanonicalTypeInternal()) }]; } @@ -834,7 +834,7 @@ let Class = DependentNameType in { def : Property<"underlyingType", Optional> { let Read = [{ node->isCanonicalUnqualified() - ? llvm::None + ? std::nullopt : llvm::Optional(node->getCanonicalTypeInternal()) }]; } diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index b7f7e507dd6cf..3ae1813d5d734 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -2116,7 +2116,7 @@ void PragmaClangAttributeSupport::generateParsingHelpers(raw_ostream &OS) { // Generate routines that check the names of sub-rules. OS << "Optional " "defaultIsAttributeSubjectMatchSubRuleFor(StringRef, bool) {\n"; - OS << " return None;\n"; + OS << " return std::nullopt;\n"; OS << "}\n\n"; llvm::MapVector> @@ -2139,7 +2139,7 @@ void PragmaClangAttributeSupport::generateParsingHelpers(raw_ostream &OS) { OS << " Case(\"" << Rule.getName() << "\", " << Rule.getEnumValue() << ").\n"; } - OS << " Default(None);\n"; + OS << " Default(std::nullopt);\n"; OS << " return " "llvm::StringSwitch>(Name).\n"; for (const auto &Rule : SubMatchRule.second) { @@ -2147,7 +2147,7 @@ void PragmaClangAttributeSupport::generateParsingHelpers(raw_ostream &OS) { OS << " Case(\"" << Rule.getName() << "\", " << Rule.getEnumValue() << ").\n"; } - OS << " Default(None);\n"; + OS << " Default(std::nullopt);\n"; OS << "}\n\n"; } @@ -2171,7 +2171,7 @@ void PragmaClangAttributeSupport::generateParsingHelpers(raw_ostream &OS) { OS << " Case(\"" << Rule.getName() << "\", std::make_pair(" << Rule.getEnumValue() << ", " << SubRuleFunction << ")).\n"; } - OS << " Default(std::make_pair(None, " + OS << " Default(std::make_pair(std::nullopt, " "defaultIsAttributeSubjectMatchSubRuleFor));\n"; OS << "}\n\n";