llvm-project
e0477ce1 - [Sema] Set __builtin_wasm placeholder type to v* instead of i (#181146)

Commit
55 days ago
[Sema] Set __builtin_wasm placeholder type to v* instead of i (#181146) The `rewriteBuiltinFunctionDecl` was unconditionally rewriting BuiltinFnTy to FunctionTy, by taking the type from the FDecl instead of copying it from the Fn. That confused BuildResolvedCallExpr immediately afterward, which sets `ResultTy = Context.BoolTy` if the type is declared to be Function rather than BuiltinFn. Thus this only usually matters when also using custom type checking, since otherwise this eventually extracts the type from the FuncT and overwrites the type extracted from the builtin, but that ability is disabled for builtins with custom type checking marked. Either change here is sufficient alone for the current __builtin_wasm declarations, but doing both changes seemed more conservative for possible future builtins. This was introduced originally in b919c7d9eb8598b7f631c1edcd0b874bbdaf99d6. Analysis assisted by Claude Sonnet 4.5
Author
Parents
Loading