[clang] [CodeGen][ObjC] Initial WebAssembly Support for GNUstep v2 (PR #183753)
Jonathan Schleifer via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 3 13:09:48 PST 2026
================
@@ -4119,8 +4119,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
if (!ClassAliases.empty()) {
llvm::Type *ArgTypes[2] = {PtrTy, PtrToInt8Ty};
llvm::FunctionType *RegisterAliasTy =
- llvm::FunctionType::get(Builder.getVoidTy(),
- ArgTypes, false);
+ llvm::FunctionType::get(BoolTy, ArgTypes, false);
----------------
Midar wrote:
This has been VoidTy for many, many years now. Because it is void in Clang, the ObjFW runtime declares this as void, too. Changing this to BoolTy would thus suddenly break ABI. (Caveat: ObjFW used to return a bool, until porting to WASM started, which uncovered this mismatch, at which point it has been changed to void. However, bool -> void is not an ABI break for most targets, but the opposite direction certainly is on almost every target, so it's not possible to go back just now.)
There is nothing in the code generated by Clang that even consumes any return value. Hence I suggest you just change it in the GNUstep runtime to return a void, to match reality.
https://github.com/llvm/llvm-project/pull/183753
More information about the cfe-commits
mailing list