Lines Matching +full:bool +full:- +full:property

1 //===-- APINotesYAMLCompiler.cpp - API Notes YAML Format Reader -*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // adds an additional bit of state: e.g. a tri-state boolean attribute (yes, no,
11 // not applied) becomes a tri-state boolean + present. As a result, while these
72 std::optional<bool> NoEscape = false;
156 std::optional<bool> SwiftPrivate;
159 bool DesignatedInit = false;
160 bool Required = false;
202 struct Property {
207 std::optional<bool> SwiftPrivate;
209 std::optional<bool> SwiftImportAsAccessors;
213 typedef std::vector<Property> PropertiesSeq;
216 LLVM_YAML_IS_SEQUENCE_VECTOR(Property)
220 template <> struct MappingTraits<Property> {
221 static void mapping(IO &IO, Property &P) {
240 bool AuditedForNullability = false;
242 std::optional<bool> SwiftPrivate;
246 std::optional<bool> SwiftImportAsNonGeneric;
247 std::optional<bool> SwiftObjCMembers;
287 std::optional<bool> SwiftPrivate;
323 std::optional<bool> SwiftPrivate;
354 std::optional<bool> SwiftPrivate;
413 std::optional<bool> SwiftPrivate;
420 std::optional<bool> FlagEnum;
422 std::optional<bool> SwiftCopyable;
469 std::optional<bool> SwiftPrivate;
542 std::optional<bool> SwiftPrivate;
594 std::optional<bool> SwiftInferImportAsMember;
626 bool parseAPINotes(StringRef YI, Module &M, llvm::SourceMgr::DiagHandlerTy Diag,
630 return static_cast<bool>(IS.error());
634 bool clang::api_notes::parseAndDumpAPINotes(StringRef YI,
655 bool ErrorOccured;
658 bool emitError(llvm::Twine Message) {
712 bool audited = false;
752 bool takesArguments = M.Selector.ends_with(":");
756 M.Selector.split(Args, ":", /*MaxSplit*/ -1, /*KeepEmpty*/ false);
805 llvm::StringMap<std::pair<bool, bool>> KnownMethods;
808 bool IsInstanceMethod = method.Kind == MethodKind::Instance;
809 bool &Known = IsInstanceMethod ? KnownMethods[method.Selector].first
813 (IsInstanceMethod ? "-" : "+") + "[" + C.Name + " " +
825 for (const auto &Property : C.Properties) {
826 // Check for duplicate property definitions.
827 if ((!Property.Kind || *Property.Kind == MethodKind::Instance) &&
828 !KnownInstanceProperties.insert(Property.Name).second) {
829 emitError(llvm::Twine("duplicate definition of instance property '") +
830 C.Name + "." + Property.Name + "'");
834 if ((!Property.Kind || *Property.Kind == MethodKind::Class) &&
835 !KnownClassProperties.insert(Property.Name).second) {
836 emitError(llvm::Twine("duplicate definition of class property '") +
837 C.Name + "." + Property.Name + "'");
841 // Translate from Property into ObjCPropertyInfo.
843 convertAvailability(Property.Availability, PI, Property.Name);
844 PI.setSwiftPrivate(Property.SwiftPrivate);
845 PI.SwiftName = std::string(Property.SwiftName);
846 if (Property.Nullability)
847 PI.setNullabilityAudited(*Property.Nullability);
848 if (Property.SwiftImportAsAccessors)
849 PI.setSwiftImportAsAccessors(*Property.SwiftImportAsAccessors);
850 PI.setType(std::string(Property.Type));
853 if (Property.Kind) {
854 Writer.addObjCProperty(CtxID, Property.Name,
855 *Property.Kind == MethodKind::Instance, PI,
858 Writer.addObjCProperty(CtxID, Property.Name, true, PI, SwiftVersion);
859 Writer.addObjCProperty(CtxID, Property.Name, false, PI, SwiftVersion);
894 ParentContext ? std::optional<ContextID>(ParentContext->id)
973 Ctx ? std::optional(Ctx->id) : std::nullopt;
1097 bool convertModule() {
1098 // Write the top-level items.
1115 static bool compile(const Module &M, const FileEntry *SourceFile,
1128 bool api_notes::compileAPINotes(StringRef YAMLInput,