From 305362576322cbcb517994cd1495fa866ac460e3 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Thu, 6 Nov 2025 21:13:44 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=92=20Add=20missing=20LLVM=5FABI=20ann?= =?UTF-8?q?otations=20(llvm#165908)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: swiftlang/swift#85241 --- llvm/include/llvm/Support/SourceMgr.h | 6 +++--- llvm/include/llvm/Support/VirtualFileSystem.h | 5 +++-- llvm/include/llvm/Support/VirtualOutputBackend.h | 4 ++-- llvm/include/llvm/Support/VirtualOutputBackends.h | 4 ++-- llvm/include/llvm/Support/VirtualOutputError.h | 4 ++-- llvm/include/llvm/Support/VirtualOutputFile.h | 8 ++++---- llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h | 2 +- .../llvm/Transforms/Instrumentation/SanitizerCoverage.h | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/llvm/include/llvm/Support/SourceMgr.h b/llvm/include/llvm/Support/SourceMgr.h index 8320006ff5f6e..43f7e27c26ba1 100644 --- a/llvm/include/llvm/Support/SourceMgr.h +++ b/llvm/include/llvm/Support/SourceMgr.h @@ -103,7 +103,7 @@ class SourceMgr { public: /// Create new source manager without support for include files. - SourceMgr(); + LLVM_ABI SourceMgr(); /// Create new source manager with the capability of finding include files /// via the provided file system. explicit SourceMgr(IntrusiveRefCntPtr FS); @@ -111,10 +111,10 @@ class SourceMgr { SourceMgr &operator=(const SourceMgr &) = delete; SourceMgr(SourceMgr &&); SourceMgr &operator=(SourceMgr &&); - ~SourceMgr(); + LLVM_ABI ~SourceMgr(); IntrusiveRefCntPtr getVirtualFileSystem() const; - void setVirtualFileSystem(IntrusiveRefCntPtr FS); + LLVM_ABI void setVirtualFileSystem(IntrusiveRefCntPtr FS); /// Return the include directories of this source manager. ArrayRef getIncludeDirs() const { return IncludeDirectories; } diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h index 9dfd122fb4cb3..c97119d05c3ea 100644 --- a/llvm/include/llvm/Support/VirtualFileSystem.h +++ b/llvm/include/llvm/Support/VirtualFileSystem.h @@ -1166,8 +1166,9 @@ class LLVM_ABI RedirectingFileSystem /// Collect all pairs of entries from the /// \p VFS. This is used by the module dependency collector to forward /// the entries into the reproducer output VFS YAML file. -void collectVFSEntries(RedirectingFileSystem &VFS, - SmallVectorImpl &CollectedEntries); +LLVM_ABI void +collectVFSEntries(RedirectingFileSystem &VFS, + SmallVectorImpl &CollectedEntries); class YAMLVFSWriter { std::vector Mappings; diff --git a/llvm/include/llvm/Support/VirtualOutputBackend.h b/llvm/include/llvm/Support/VirtualOutputBackend.h index 6a184dd9c6dbb..b7b0a43b02d34 100644 --- a/llvm/include/llvm/Support/VirtualOutputBackend.h +++ b/llvm/include/llvm/Support/VirtualOutputBackend.h @@ -22,7 +22,7 @@ namespace vfs { /// If virtual functions are added here, also add them to \a /// ProxyOutputBackend. class OutputBackend : public RefCountedBase { - virtual void anchor(); + LLVM_ABI virtual void anchor(); public: /// Get a backend that points to the same destination as this one but that @@ -37,7 +37,7 @@ class OutputBackend : public RefCountedBase { /// have been customized). /// /// Thread-safe. - Expected + LLVM_ABI Expected createFile(const Twine &Path, std::optional Config = std::nullopt); diff --git a/llvm/include/llvm/Support/VirtualOutputBackends.h b/llvm/include/llvm/Support/VirtualOutputBackends.h index f6a911cf0cca0..73b455c7ee6b1 100644 --- a/llvm/include/llvm/Support/VirtualOutputBackends.h +++ b/llvm/include/llvm/Support/VirtualOutputBackends.h @@ -64,14 +64,14 @@ class ProxyOutputBackend : public OutputBackend { /// An output backend that creates files on disk, wrapping APIs in sys::fs. class OnDiskOutputBackend : public OutputBackend { - void anchor() override; + LLVM_ABI void anchor() override; protected: IntrusiveRefCntPtr cloneImpl() const override { return clone(); } - Expected> + LLVM_ABI Expected> createFileImpl(StringRef Path, std::optional Config) override; public: diff --git a/llvm/include/llvm/Support/VirtualOutputError.h b/llvm/include/llvm/Support/VirtualOutputError.h index e905b2b034111..c0431dc37d12e 100644 --- a/llvm/include/llvm/Support/VirtualOutputError.h +++ b/llvm/include/llvm/Support/VirtualOutputError.h @@ -42,7 +42,7 @@ class OutputError : public ErrorInfo { } // Used by ErrorInfo::classID. - static char ID; + LLVM_ABI static char ID; OutputError(const Twine &OutputPath, std::error_code EC) : ErrorInfo(EC), OutputPath(OutputPath.str()) { @@ -104,7 +104,7 @@ class TempFileOutputError : public ErrorInfo { } // Used by ErrorInfo::classID. - static char ID; + LLVM_ABI static char ID; TempFileOutputError(const Twine &TempPath, const Twine &OutputPath, std::error_code EC) diff --git a/llvm/include/llvm/Support/VirtualOutputFile.h b/llvm/include/llvm/Support/VirtualOutputFile.h index d5f44e2c9ae40..1f5d6bc9d058f 100644 --- a/llvm/include/llvm/Support/VirtualOutputFile.h +++ b/llvm/include/llvm/Support/VirtualOutputFile.h @@ -74,13 +74,13 @@ class OutputFile { /// /// If there's an open proxy from \a createProxy(), calls \a discard() to /// clean up temporaries followed by \a report_fatal_error(). - Error keep(); + LLVM_ABI Error keep(); /// Discard an output, cleaning up any temporary state. Errors if clean-up /// fails. /// /// If it has already been closed, calls \a report_fatal_error(). - Error discard(); + LLVM_ABI Error discard(); /// Discard the output when destroying it if it's still open, sending the /// result to \a Handler. @@ -92,7 +92,7 @@ class OutputFile { /// producer. Errors if there's already a proxy. The proxy must be deleted /// before calling \a keep(). The proxy will crash if it's written to after /// calling \a discard(). - Expected> createProxy(); + LLVM_ABI Expected> createProxy(); bool hasOpenProxy() const { return OpenProxy; } @@ -126,7 +126,7 @@ class OutputFile { private: /// Destroy \a Impl. Reports fatal error if the file is open and there's no /// handler from \a discardOnDestroy(). - void destroy(); + LLVM_ABI void destroy(); OutputFile &moveFrom(OutputFile &O) { Path = std::move(O.Path); Impl = std::move(O.Impl); diff --git a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h index 8addf49fc0d81..272b96037c753 100644 --- a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h +++ b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h @@ -23,7 +23,7 @@ class Module; /// A pass which infers function attributes from the names and signatures of /// function declarations in a module. struct InferFunctionAttrsPass : PassInfoMixin { - PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); }; } diff --git a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h index f14f5b90a5cc9..e1747eaaf71fa 100644 --- a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h +++ b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h @@ -30,7 +30,7 @@ class Module; /// appends globals to llvm.compiler.used. class SanitizerCoveragePass : public PassInfoMixin { public: - explicit SanitizerCoveragePass( + LLVM_ABI explicit SanitizerCoveragePass( SanitizerCoverageOptions Options = SanitizerCoverageOptions(), const std::vector &AllowlistFiles = std::vector(),