This is consistent with what clang and gcc are doing, because
headers such as <cet.h> are specifically designed to be used
in the context of assembly code.
Fixes#16449
Previously, they were only created when we had any TLS segment.
This meant that while the symbol existed, the global itself wouldn't.
The result of this was a crash during symbol names writing as it
would attempt to write the symbol name of a global that didn't exist.
Now we always create them, and instead update its `init` value during
`setupMemory`.
In the future, the entire symbol (and global) will be removed by
the garbage collector.
Implements the `start` section which will execute a given function
at startup of the program. After function execution, the _start
function will be called by the runtime. In the case of shared-memory
we set this section to the function `__wasm_init_memory` which will
initialize all memory on startup.
This also fixes the above mentioned function to ensure we correctly
lower the i32 values.
Lastly, this fixes a typo where we would retrieve a global, instead
of setting its value.
Rather than verifying if importing memory is false, we now rely
on the option that was passed to the CLI (where export is defaulted
to `true` unless only import-memory is given).
* getOwnedFunctionIndex no longer checks if the value is actually a
function.
* The callsites to `intern` that I added want to avoid the `getCoerced`
call, so I added `intern2`.
* Adding to inferred error sets should not happen if the destination
error set is not the inferred error set of the current Sema instance.
* adhoc_inferred_error_set_type can be seen by the backend. Treat it
like anyerror.
when other function's inferred error set is the return type of a
function, it should not try to insert the error set into it.
this implies that this branch fixes a bug in master branch.
When instantiating a generic function call, in the case of a function
call generated by the language, the LazySrcLoc provided for `call_src`
may not point to anything interesting.