diff options
author | Pierre Moreau <dev@pmoreau.org> | 2018-02-13 22:47:15 +0100 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-02-27 12:21:13 -0500 |
commit | bdd6617faae5f9fa962ad73d36b70223c1dcf682 (patch) | |
tree | a80940da98ae2643a01b3b0c7a22cf224d29f052 /include | |
parent | 64298bfd15ab1aa59328f3ffdccc861cbfc35ea7 (diff) | |
download | spirv-tools-bdd6617faae5f9fa962ad73d36b70223c1dcf682.tar.gz |
linker: Allow modules to be partially linked
Fixes: https://github.com/KhronosGroup/SPIRV-Tools/issues/1144
Diffstat (limited to 'include')
-rw-r--r-- | include/spirv-tools/linker.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/spirv-tools/linker.hpp b/include/spirv-tools/linker.hpp index df56251f..cce78a44 100644 --- a/include/spirv-tools/linker.hpp +++ b/include/spirv-tools/linker.hpp @@ -26,7 +26,10 @@ namespace spvtools { class LinkerOptions { public: - LinkerOptions() : create_library_(false), verify_ids_(false) {} + LinkerOptions() + : create_library_(false), + verify_ids_(false), + allow_partial_linkage_(false) {} // Returns whether a library or an executable should be produced by the // linking phase. @@ -50,9 +53,20 @@ class LinkerOptions { // context. void SetVerifyIds(bool verify_ids) { verify_ids_ = verify_ids; } + // Returns whether to allow for imported symbols to have no corresponding + // exported symbols + bool GetAllowPartialLinkage() const { return allow_partial_linkage_; } + + // Sets whether to allow for imported symbols to have no corresponding + // exported symbols + void SetAllowPartialLinkage(bool allow_partial_linkage) { + allow_partial_linkage_ = allow_partial_linkage; + } + private: bool create_library_; bool verify_ids_; + bool allow_partial_linkage_; }; // Links one or more SPIR-V modules into a new SPIR-V module. That is, combine |