[lld] [LLD][COFF] Generate X64 thunks for ARM64EC entry points and patchable functions. (PR #105499)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 22 04:03:36 PDT 2024
================
@@ -1317,6 +1317,72 @@ void LinkerDriver::convertResources() {
f->includeResourceChunks();
}
+void LinkerDriver::maybeCreateECExportThunk(StringRef name, Symbol *&sym) {
+ Defined *def;
+ if (!sym)
+ return;
+ if (auto undef = dyn_cast<Undefined>(sym))
+ def = undef->getWeakAlias();
+ else
+ def = dyn_cast<Defined>(sym);
+ if (!def)
+ return;
+
+ if (def->getChunk()->getArm64ECRangeType() != chpe_range_type::Arm64EC)
----------------
mstorsjo wrote:
Hmm, `getArm64ECRangeType()` return a `std::optional<>` - don't we usually need to somewhat check that it really is set and not nullopt, and then kinda unwrap/dereference it to get the actual value? Or I guess this does that, somewhat, and nullopt obviously returns true for the `operator!=`?
I.e., I presume this combo actually works on both GCC, Clang and MSVC, but have you tested that it works (and doesn't e.g. assert) on nullopt?
https://github.com/llvm/llvm-project/pull/105499
More information about the llvm-commits
mailing list