[llvm] [Object][COFF][NFC] Document writeImportLibrary. (PR #81600)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 04:40:45 PST 2024


https://github.com/cjacek created https://github.com/llvm/llvm-project/pull/81600

As suggested in #81426.

 CC @zmodem

>From 32242fbbc97339e17be3dad3d5fcd57a170a746c Mon Sep 17 00:00:00 2001
From: Jacek Caban <jacek at codeweavers.com>
Date: Tue, 13 Feb 2024 13:35:28 +0100
Subject: [PATCH] [Object][COFF][NFC] Document writeImportLibrary.

---
 llvm/include/llvm/Object/COFFImportFile.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/llvm/include/llvm/Object/COFFImportFile.h b/llvm/include/llvm/Object/COFFImportFile.h
index 23c3e6a1f0784a..f4671d7405dbda 100644
--- a/llvm/include/llvm/Object/COFFImportFile.h
+++ b/llvm/include/llvm/Object/COFFImportFile.h
@@ -135,6 +135,18 @@ struct COFFShortExport {
   }
 };
 
+/// Writes a COFF import library containing entries described by the Exports
+/// array.
+///
+/// For hybrid targets such as ARM64EC, additional native entry points can be
+/// exposed using the NativeExports parameter. When NativeExports is used, the
+/// output import library will expose these native ARM64 imports alongside the
+/// entries described in the Exports array. Such a library can be used for
+/// linking both ARM64EC and pure ARM64 objects, and the linker will pick only
+/// the exports relevant to the target platform.
+///
+/// For non-hybrid targets, the NativeExports parameter should not be used.
+/// Instead, pass std::nullopt or an empty array to this parameter.
 Error writeImportLibrary(StringRef ImportName, StringRef Path,
                          ArrayRef<COFFShortExport> Exports,
                          ArrayRef<COFFShortExport> NativeExports,



More information about the llvm-commits mailing list