Lines Matching +full:diag +full:- +full:version
1 //===- TextStub.cpp -------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
31 // clang-format off
39 --- # the tag !tapi-tbd-v1 is optional and
44 install-name: /u/l/libfoo.dylib #
45 current-version: 1.2.3 # Optional: defaults to 1.0
46 compatibility-version: 1.0 # Optional: defaults to 1.0
47 swift-version: 0 # Optional: defaults to 0
48 objc-constraint: none # Optional: defaults to none
54 - archs: [ arm64 ] # the list of architecture slices
55 allowed-clients: [ client ] # Optional: List of clients
56 re-exports: [ ] # Optional: List of re-exports
58 objc-classes: [] # Optional: List of Objective-C classes
59 objc-ivars: [] # Optional: List of Objective C Instance
61 weak-def-symbols: [] # Optional: List of weak defined symbols
62 thread-local-symbols: [] # Optional: List of thread local symbols
69 --- !tapi-tbd-v2
75 install-name: /u/l/libfoo.dylib #
76 current-version: 1.2.3 # Optional: defaults to 1.0
77 compatibility-version: 1.0 # Optional: defaults to 1.0
78 swift-version: 0 # Optional: defaults to 0
79 objc-constraint: retain_release # Optional: defaults to retain_release
80 parent-umbrella: # Optional:
88 - archs: [ arm64 ] # the list of architecture slices
89 allowed-clients: [ client ] # Optional: List of clients
90 re-exports: [ ] # Optional: List of re-exports
92 objc-classes: [] # Optional: List of Objective-C classes
93 objc-ivars: [] # Optional: List of Objective C Instance
95 weak-def-symbols: [] # Optional: List of weak defined symbols
96 thread-local-symbols: [] # Optional: List of thread local symbols
99 - archs: [ arm64 ] # the list of architecture slices
101 objc-classes: [] # Optional: List of Objective-C classes
102 objc-ivars: [] # Optional: List of Objective C Instance Variables
103 weak-ref-symbols: [] # Optional: List of weak defined symbols
110 --- !tapi-tbd-v3
116 install-name: /u/l/libfoo.dylib #
117 current-version: 1.2.3 # Optional: defaults to 1.0
118 compatibility-version: 1.0 # Optional: defaults to 1.0
119 swift-abi-version: 0 # Optional: defaults to 0
120 objc-constraint: retain_release # Optional: defaults to retain_release
121 parent-umbrella: # Optional:
129 - archs: [ arm64 ] # the list of architecture slices
130 allowed-clients: [ client ] # Optional: List of clients
131 re-exports: [ ] # Optional: List of re-exports
133 objc-classes: [] # Optional: List of Objective-C classes
134 objc-eh-types: [] # Optional: List of Objective-C classes
136 objc-ivars: [] # Optional: List of Objective C Instance
138 weak-def-symbols: [] # Optional: List of weak defined symbols
139 thread-local-symbols: [] # Optional: List of thread local symbols
142 - archs: [ arm64 ] # the list of architecture slices
144 objc-classes: [] # Optional: List of Objective-C classes
145 objc-eh-types: [] # Optional: List of Objective-C classes
147 objc-ivars: [] # Optional: List of Objective C Instance Variables
148 weak-ref-symbols: [] # Optional: List of weak defined symbols
155 --- !tapi-tbd
156 tbd-version: 4 # The tbd version for format
157 targets: [ armv7-ios, x86_64-maccatalyst ] # The list of applicable tapi supported target triples
159 - target: armv7-ios
161 - target: x86_64-maccatalyst
164 install-name: /u/l/libfoo.dylib #
165 current-version: 1.2.3 # Optional: defaults to 1.0
166 compatibility-version: 1.0 # Optional: defaults to 1.0
167 swift-abi-version: 0 # Optional: defaults to 0
168 parent-umbrella: # Optional:
169 allowable-clients:
170 - targets: [ armv7-ios ] # Optional:
174 re-exports: # List of reexport sections
181 - targets: [ arm64-macos ] # The list of target triples associated with symb…
183 objc-classes: [] # Optional: List of Objective-C classes
184 objc-eh-types: [] # Optional: List of Objective-C classes
186 objc-ivars: [] # Optional: List of Objective C Instance
188 weak-symbols: [] # Optional: List of weak defined symbols
189 thread-local-symbols: [] # Optional: List of thread local symbols
190 - targets: [ arm64-macos, x86_64-maccatalyst ] # Optional: Targets for applicable additional sym…
194 - targets: [ arm64-macos ] # The list of target triples associated with symbols
196 objc-classes: [] # Optional: List of Objective-C classes
197 objc-eh-types: [] # Optional: List of Objective-C classes
199 objc-ivars: [] # Optional: List of Objective C Instance Variables
200 weak-symbols: [] # Optional: List of weak defined symbols
202 // clang-format on
279 assert((!Ctx || Ctx->FileKind != FileType::Invalid) && in mapping()
283 if (Ctx->FileKind == FileType::TBD_V1) in mapping()
284 IO.mapOptional("allowed-clients", Section.AllowableClients); in mapping()
286 IO.mapOptional("allowable-clients", Section.AllowableClients); in mapping()
287 IO.mapOptional("re-exports", Section.ReexportedLibraries); in mapping()
289 IO.mapOptional("objc-classes", Section.Classes); in mapping()
290 if (Ctx->FileKind == FileType::TBD_V3) in mapping()
291 IO.mapOptional("objc-eh-types", Section.ClassEHs); in mapping()
292 IO.mapOptional("objc-ivars", Section.IVars); in mapping()
293 IO.mapOptional("weak-def-symbols", Section.WeakDefSymbols); in mapping()
294 IO.mapOptional("thread-local-symbols", Section.TLVSymbols); in mapping()
301 assert((!Ctx || Ctx->FileKind != FileType::Invalid) && in mapping()
306 IO.mapOptional("objc-classes", Section.Classes); in mapping()
307 if (Ctx->FileKind == FileType::TBD_V3) in mapping()
308 IO.mapOptional("objc-eh-types", Section.ClassEHs); in mapping()
309 IO.mapOptional("objc-ivars", Section.IVars); in mapping()
310 IO.mapOptional("weak-ref-symbols", Section.WeakRefSymbols); in mapping()
318 IO.mapOptional("objc-classes", Section.Classes); in mapping()
319 IO.mapOptional("objc-eh-types", Section.ClassEHs); in mapping()
320 IO.mapOptional("objc-ivars", Section.Ivars); in mapping()
321 IO.mapOptional("weak-symbols", Section.WeakSymbols); in mapping()
322 IO.mapOptional("thread-local-symbols", Section.TlvSymbols); in mapping()
370 OS << Value.Arch << "-"; in output()
404 Architectures = File->getArchitectures(); in NormalizedTBD()
405 Platforms = File->getPlatforms(); in NormalizedTBD()
406 InstallName = File->getInstallName(); in NormalizedTBD()
407 CurrentVersion = PackedVersion(File->getCurrentVersion()); in NormalizedTBD()
408 CompatibilityVersion = PackedVersion(File->getCompatibilityVersion()); in NormalizedTBD()
409 SwiftABIVersion = File->getSwiftABIVersion(); in NormalizedTBD()
410 ObjCConstraint = File->getObjCConstraint(); in NormalizedTBD()
413 if (!File->isApplicationExtensionSafe()) in NormalizedTBD()
416 if (!File->isTwoLevelNamespace()) in NormalizedTBD()
419 if (!File->umbrellas().empty()) in NormalizedTBD()
420 ParentUmbrella = File->umbrellas().begin()->second; in NormalizedTBD()
423 for (const auto &Library : File->allowableClients()) in NormalizedTBD()
426 for (const auto &Library : File->reexportedLibraries()) in NormalizedTBD()
430 for (const auto *Symbol : File->symbols()) { in NormalizedTBD()
431 auto Architectures = Symbol->getArchitectures(); in NormalizedTBD()
440 for (const auto &Library : File->allowableClients()) in NormalizedTBD()
444 for (const auto &Library : File->reexportedLibraries()) in NormalizedTBD()
453 switch (Symbol->getKind()) { in NormalizedTBD()
455 if (Symbol->isWeakDefined()) in NormalizedTBD()
456 Section.WeakDefSymbols.emplace_back(Symbol->getName()); in NormalizedTBD()
457 else if (Symbol->isThreadLocalValue()) in NormalizedTBD()
458 Section.TLVSymbols.emplace_back(Symbol->getName()); in NormalizedTBD()
460 Section.Symbols.emplace_back(Symbol->getName()); in NormalizedTBD()
463 if (File->getFileType() != FileType::TBD_V3) in NormalizedTBD()
465 copyString("_" + Symbol->getName().str())); in NormalizedTBD()
467 Section.Classes.emplace_back(Symbol->getName()); in NormalizedTBD()
470 if (File->getFileType() != FileType::TBD_V3) in NormalizedTBD()
472 copyString("_OBJC_EHTYPE_$_" + Symbol->getName().str())); in NormalizedTBD()
474 Section.ClassEHs.emplace_back(Symbol->getName()); in NormalizedTBD()
477 if (File->getFileType() != FileType::TBD_V3) in NormalizedTBD()
479 copyString("_" + Symbol->getName().str())); in NormalizedTBD()
481 Section.IVars.emplace_back(Symbol->getName()); in NormalizedTBD()
497 for (const auto *Symbol : File->undefineds()) { in NormalizedTBD()
498 auto Architectures = Symbol->getArchitectures(); in NormalizedTBD()
512 switch (Symbol->getKind()) { in NormalizedTBD()
514 if (Symbol->isWeakReferenced()) in NormalizedTBD()
515 Section.WeakRefSymbols.emplace_back(Symbol->getName()); in NormalizedTBD()
517 Section.Symbols.emplace_back(Symbol->getName()); in NormalizedTBD()
520 if (File->getFileType() != FileType::TBD_V3) in NormalizedTBD()
522 copyString("_" + Symbol->getName().str())); in NormalizedTBD()
524 Section.Classes.emplace_back(Symbol->getName()); in NormalizedTBD()
527 if (File->getFileType() != FileType::TBD_V3) in NormalizedTBD()
529 copyString("_OBJC_EHTYPE_$_" + Symbol->getName().str())); in NormalizedTBD()
531 Section.ClassEHs.emplace_back(Symbol->getName()); in NormalizedTBD()
534 if (File->getFileType() != FileType::TBD_V3) in NormalizedTBD()
536 copyString("_" + Symbol->getName().str())); in NormalizedTBD()
538 Section.IVars.emplace_back(Symbol->getName()); in NormalizedTBD()
551 // TBD v1 - TBD v3 files only support one platform and several
578 File->setPath(Ctx->Path); in denormalize()
579 File->setFileType(Ctx->FileKind); in denormalize()
580 File->addTargets(synthesizeTargets(Architectures, Platforms)); in denormalize()
581 File->setInstallName(InstallName); in denormalize()
582 File->setCurrentVersion(CurrentVersion); in denormalize()
583 File->setCompatibilityVersion(CompatibilityVersion); in denormalize()
584 File->setSwiftABIVersion(SwiftABIVersion); in denormalize()
585 File->setObjCConstraint(ObjCConstraint); in denormalize()
586 for (const auto &Target : File->targets()) in denormalize()
587 File->addParentUmbrella(Target, ParentUmbrella); in denormalize()
589 if (Ctx->FileKind == FileType::TBD_V1) { in denormalize()
590 File->setTwoLevelNamespace(); in denormalize()
591 File->setApplicationExtensionSafe(); in denormalize()
593 File->setTwoLevelNamespace(!(Flags & TBDFlags::FlatNamespace)); in denormalize()
594 File->setApplicationExtensionSafe( in denormalize()
609 File->addAllowableClient(Lib, Target); in denormalize()
613 File->addReexportedLibrary(Lib, Target); in denormalize()
616 if (Ctx->FileKind != FileType::TBD_V3 && in denormalize()
618 File->addSymbol(EncodeKind::ObjectiveCClassEHType, in denormalize()
621 File->addSymbol(EncodeKind::GlobalSymbol, Symbol, Targets, Flags); in denormalize()
625 if (Ctx->FileKind != FileType::TBD_V3) in denormalize()
627 File->addSymbol(EncodeKind::ObjectiveCClass, Name, Targets, Flags); in denormalize()
630 File->addSymbol(EncodeKind::ObjectiveCClassEHType, Symbol, Targets, in denormalize()
634 if (Ctx->FileKind != FileType::TBD_V3) in denormalize()
636 File->addSymbol(EncodeKind::ObjectiveCInstanceVariable, Name, Targets, in denormalize()
640 File->addSymbol(EncodeKind::GlobalSymbol, Symbol, Targets, in denormalize()
643 File->addSymbol(EncodeKind::GlobalSymbol, Symbol, Targets, in denormalize()
651 if (Ctx->FileKind != FileType::TBD_V3 && in denormalize()
653 File->addSymbol(EncodeKind::ObjectiveCClassEHType, in denormalize()
657 File->addSymbol(EncodeKind::GlobalSymbol, Symbol, Targets, in denormalize()
662 if (Ctx->FileKind != FileType::TBD_V3) in denormalize()
664 File->addSymbol(EncodeKind::ObjectiveCClass, Name, Targets, in denormalize()
668 File->addSymbol(EncodeKind::ObjectiveCClassEHType, Symbol, Targets, in denormalize()
672 if (Ctx->FileKind != FileType::TBD_V3) in denormalize()
674 File->addSymbol(EncodeKind::ObjectiveCInstanceVariable, Name, Targets, in denormalize()
678 File->addSymbol(EncodeKind::GlobalSymbol, Symbol, Targets, in denormalize()
711 if (IO.mapTag("!tapi-tbd", false)) in setFileTypeForInput()
712 Ctx->FileKind = FileType::TBD_V4; in setFileTypeForInput()
713 else if (IO.mapTag("!tapi-tbd-v3", false)) in setFileTypeForInput()
714 Ctx->FileKind = FileType::TBD_V3; in setFileTypeForInput()
715 else if (IO.mapTag("!tapi-tbd-v2", false)) in setFileTypeForInput()
716 Ctx->FileKind = FileType::TBD_V2; in setFileTypeForInput()
717 else if (IO.mapTag("!tapi-tbd-v1", false) || in setFileTypeForInput()
719 Ctx->FileKind = FileType::TBD_V1; in setFileTypeForInput()
721 Ctx->FileKind = FileType::Invalid; in setFileTypeForInput()
729 (Ctx && Ctx->FileKind != FileType::Invalid)) && in mapping()
734 switch (Ctx->FileKind) { in mapping()
746 switch (Ctx->FileKind) { in mapping()
753 IO.mapTag("!tapi-tbd-v3", true); in mapping()
756 IO.mapTag("!tapi-tbd-v2", true); in mapping()
763 mapKeysToValues(Ctx->FileKind, IO, File); in mapping()
772 TBDVersion = Ctx->FileKind >> 4; in NormalizedTBD_V4()
773 Targets.insert(Targets.begin(), File->targets().begin(), in NormalizedTBD_V4()
774 File->targets().end()); in NormalizedTBD_V4()
775 InstallName = File->getInstallName(); in NormalizedTBD_V4()
776 CurrentVersion = File->getCurrentVersion(); in NormalizedTBD_V4()
777 CompatibilityVersion = File->getCompatibilityVersion(); in NormalizedTBD_V4()
778 SwiftABIVersion = File->getSwiftABIVersion(); in NormalizedTBD_V4()
781 if (!File->isApplicationExtensionSafe()) in NormalizedTBD_V4()
784 if (!File->isTwoLevelNamespace()) in NormalizedTBD_V4()
787 if (File->isOSLibNotForSharedCache()) in NormalizedTBD_V4()
792 for (const auto &it : File->umbrellas()) in NormalizedTBD_V4()
804 assignTargetsToLibrary(File->allowableClients(), AllowableClients); in NormalizedTBD_V4()
805 assignTargetsToLibrary(File->reexportedLibraries(), ReexportedLibraries); in NormalizedTBD_V4()
813 TargetList Targets(Symbol->targets()); in NormalizedTBD_V4()
827 switch (Symbol->getKind()) { in NormalizedTBD_V4()
829 if (Symbol->isWeakDefined()) in NormalizedTBD_V4()
830 CurrentSection.WeakSymbols.emplace_back(Symbol->getName()); in NormalizedTBD_V4()
831 else if (Symbol->isThreadLocalValue()) in NormalizedTBD_V4()
832 CurrentSection.TlvSymbols.emplace_back(Symbol->getName()); in NormalizedTBD_V4()
834 CurrentSection.Symbols.emplace_back(Symbol->getName()); in NormalizedTBD_V4()
837 CurrentSection.Classes.emplace_back(Symbol->getName()); in NormalizedTBD_V4()
840 CurrentSection.ClassEHs.emplace_back(Symbol->getName()); in NormalizedTBD_V4()
843 CurrentSection.Ivars.emplace_back(Symbol->getName()); in NormalizedTBD_V4()
857 handleSymbols(Exports, File->exports()); in NormalizedTBD_V4()
858 handleSymbols(Reexports, File->reexports()); in NormalizedTBD_V4()
859 handleSymbols(Undefineds, File->undefineds()); in NormalizedTBD_V4()
867 File->setPath(Ctx->Path); in denormalize()
868 File->setFileType(Ctx->FileKind); in denormalize()
869 File->addTargets(Targets); in denormalize()
870 File->setInstallName(InstallName); in denormalize()
871 File->setCurrentVersion(CurrentVersion); in denormalize()
872 File->setCompatibilityVersion(CompatibilityVersion); in denormalize()
873 File->setSwiftABIVersion(SwiftABIVersion); in denormalize()
876 File->addParentUmbrella(target, CurrentSection.Umbrella); in denormalize()
877 File->setTwoLevelNamespace(!(Flags & TBDFlags::FlatNamespace)); in denormalize()
878 File->setApplicationExtensionSafe( in denormalize()
880 File->setOSLibNotForSharedCache( in denormalize()
886 File->addAllowableClient(lib, Target); in denormalize()
892 File->addReexportedLibrary(Lib, Target); in denormalize()
904 File->addSymbol(EncodeKind::GlobalSymbol, sym, in denormalize()
908 File->addSymbol(EncodeKind::ObjectiveCClass, sym, in denormalize()
912 File->addSymbol(EncodeKind::ObjectiveCClassEHType, sym, in denormalize()
916 File->addSymbol(EncodeKind::ObjectiveCInstanceVariable, sym, in denormalize()
924 File->addSymbol(EncodeKind::GlobalSymbol, sym, in denormalize()
929 File->addSymbol(EncodeKind::GlobalSymbol, sym, in denormalize()
977 CurrentSection.Values.emplace_back(it.first->getInstallName()); in assignTargetsToLibrary()
989 IO.mapRequired("archs", Keys->Architectures); in mapKeysToValues()
992 IO.mapRequired("platform", Keys->Platforms); in mapKeysToValues()
994 IO.mapOptional("flags", Keys->Flags, TBDFlags::None); in mapKeysToValues()
995 IO.mapRequired("install-name", Keys->InstallName); in mapKeysToValues()
996 IO.mapOptional("current-version", Keys->CurrentVersion, in mapKeysToValues()
998 IO.mapOptional("compatibility-version", Keys->CompatibilityVersion, in mapKeysToValues()
1001 IO.mapOptional("swift-version", Keys->SwiftABIVersion, SwiftVersion(0)); in mapKeysToValues()
1003 IO.mapOptional("swift-abi-version", Keys->SwiftABIVersion, in mapKeysToValues()
1005 IO.mapOptional("objc-constraint", Keys->ObjCConstraint, in mapKeysToValues()
1010 IO.mapOptional("parent-umbrella", Keys->ParentUmbrella, StringRef()); in mapKeysToValues()
1011 IO.mapOptional("exports", Keys->Exports); in mapKeysToValues()
1013 IO.mapOptional("undefineds", Keys->Undefineds); in mapKeysToValues()
1020 IO.mapTag("!tapi-tbd", true); in mapKeysToValuesV4()
1021 IO.mapRequired("tbd-version", Keys->TBDVersion); in mapKeysToValuesV4()
1022 IO.mapRequired("targets", Keys->Targets); in mapKeysToValuesV4()
1024 IO.mapOptional("flags", Keys->Flags, TBDFlags::None); in mapKeysToValuesV4()
1025 IO.mapRequired("install-name", Keys->InstallName); in mapKeysToValuesV4()
1026 IO.mapOptional("current-version", Keys->CurrentVersion, in mapKeysToValuesV4()
1028 IO.mapOptional("compatibility-version", Keys->CompatibilityVersion, in mapKeysToValuesV4()
1030 IO.mapOptional("swift-abi-version", Keys->SwiftABIVersion, SwiftVersion(0)); in mapKeysToValuesV4()
1031 IO.mapOptional("parent-umbrella", Keys->ParentUmbrellas); in mapKeysToValuesV4()
1033 IO.mapOptionalWithContext("allowable-clients", Keys->AllowableClients, in mapKeysToValuesV4()
1036 IO.mapOptionalWithContext("reexported-libraries", Keys->ReexportedLibraries, in mapKeysToValuesV4()
1038 IO.mapOptional("exports", Keys->Exports); in mapKeysToValuesV4()
1039 IO.mapOptional("reexports", Keys->Reexports); in mapKeysToValuesV4()
1040 IO.mapOptional("undefineds", Keys->Undefineds); in mapKeysToValuesV4()
1060 static void DiagHandler(const SMDiagnostic &Diag, void *Context) { in DiagHandler() argument
1065 SMDiagnostic NewDiag(*Diag.getSourceMgr(), Diag.getLoc(), File->Path, in DiagHandler()
1066 Diag.getLineNo(), Diag.getColumnNo(), Diag.getKind(), in DiagHandler()
1067 Diag.getMessage(), Diag.getLineContents(), in DiagHandler()
1068 Diag.getRanges(), Diag.getFixIts()); in DiagHandler()
1071 File->ErrorMessage = ("malformed file\n" + Message).str(); in DiagHandler()
1082 if (TAPIFile.starts_with("--- !tapi-tbd")) in canRead()
1085 if (TAPIFile.starts_with("--- !tapi-tbd-v3")) in canRead()
1088 if (TAPIFile.starts_with("--- !tapi-tbd-v2")) in canRead()
1091 if (TAPIFile.starts_with("--- !tapi-tbd-v1") || in canRead()
1092 TAPIFile.starts_with("---\narchs:")) in canRead()
1113 (*FileOrErr)->setPath(Ctx.Path); in get()
1128 File->addDocument( in get()