[clang] [InstallAPI] Handle zippered frameworks (PR #88205)

Cyndy Ishida via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 09:29:05 PDT 2024


================
@@ -588,13 +622,58 @@ void DylibVerifier::visitSymbolInDylib(const Record &R, SymbolContext &SymCtx) {
     }
   }
 
+  const bool IsLinkerSymbol = SymbolName.starts_with("$ld$");
+
+  if (R.isVerified()) {
+    // Check for unavailable symbols.
+    // This should only occur in the zippered case where we ignored
+    // availability until all headers have been parsed.
+    auto It = DeferredZipperedSymbols.find(SymCtx.SymbolName);
+    if (It == DeferredZipperedSymbols.end()) {
+      updateState(Result::Valid);
+      return;
+    }
+
+    ZipperedDeclSources Locs;
+    for (const ZipperedDeclSource &ZSource : It->second) {
+      if (ZSource.FA->Avail.isObsoleted()) {
+        updateState(Result::Ignore);
+        return;
+      }
+      if (ZSource.T.Arch != Ctx.Target.Arch)
+        continue;
+      Locs.emplace_back(ZSource);
+    }
+    assert(Locs.size() == 2 && "Expected two decls for zippered symbol");
----------------
cyndyishida wrote:

Ah, so that errors out differently with 
```
error: no declaration found for exported symbol '_unavailableSymbol' in a dynamic library
```
in clang-installapi & tapi. That should be improved to also show the source location, can do in a separate patch. 

https://github.com/llvm/llvm-project/pull/88205


More information about the cfe-commits mailing list