[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:55 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()) {
----------------
ributzka wrote:

Please add comments to the various checks and why they are considered valid or ignored.

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


More information about the cfe-commits mailing list