[llvm] replace many GlobalValue->getValueType calls with more specific queries (PR #177039)
Jameson Nash via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 21 09:11:29 PST 2026
================
@@ -404,7 +404,7 @@ void WebAssemblyAsmPrinter::emitEndOfAsmFile(Module &M) {
if (!G.hasInitializer() && G.hasExternalLinkage() &&
!WebAssembly::isWasmVarAddressSpace(G.getAddressSpace()) &&
G.getValueType()->isSized()) {
----------------
vtjnash wrote:
Yeah, I was just realizing that too. Though in this specific case, I believe that confusion is original to the code here too, which appears to have intend to query that this external object has a known fixed size (since it immediately getFixedValue if this test passes). I don't know that WASM has SVE though, so the difference is largely academic here.
I'll revise my statement and say this use of getValueType appears to be more nearly testing if the exact size is known for linking. I don't know the implications of calling `emitELFSize` on this subset of external globals however to say exactly what or how this would be changed to.
https://github.com/llvm/llvm-project/pull/177039
More information about the llvm-commits
mailing list