[clang] [llvm] [InstallAPI] Report exports discovered in binary but not in interface (PR #86025)

Juergen Ributzka via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 09:08:54 PDT 2024


================
@@ -520,5 +515,136 @@ void DylibVerifier::VerifierContext::emitDiag(
   Report();
 }
 
+// The existence of weak-defined RTTI can not always be inferred from the
+// header files because they can be generated as part of an implementation
+// file.
+// InstallAPI doesn't warn about weak-defined RTTI, because this doesn't affect
+// linking and so can be ignored in text files.
+static bool shouldIgnoreCpp(StringRef Name, bool IsWeakDef) {
+  return (IsWeakDef &&
+          (Name.starts_with("__ZTI") || Name.starts_with("__ZTS")));
+}
+void DylibVerifier::visitSymbolInDylib(const Record &R, SymbolContext &SymCtx) {
+  if (R.isUndefined()) {
+    updateState(Result::Valid);
+    return;
+  }
+  if (R.isInternal()) {
+    updateState(Result::Valid);
+    return;
+  }
+
+  const StringRef SymbolName(SymCtx.SymbolName);
+  // Allow zippered symbols with potentially mismatching availability
+  // between macOS and macCatalyst in the final text file.
----------------
ributzka wrote:

```suggestion
  // between macOS and macCatalyst in the final text-api file.
```

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


More information about the cfe-commits mailing list