This is not supported in Wasm, unless the data was encoded instructions, but that wouldn't work with the assembler's other functionality (enforcing nesting etc.).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/lib/MC/WasmObjectWriter.cpp | ||
|---|---|---|
| 494 | Note this check may strictly not be necessary anymore, but the unchecked dereference that was there before seemed a bit fragile for an invariant established elsewhere. Maybe better as an assert? | |
lgtm with a test for the parse error.
| llvm/lib/MC/MCParser/WasmAsmParser.cpp | ||
|---|---|---|
| 224 ↗ | (On Diff #320643) | CurrentSection? |
| 235 ↗ | (On Diff #320643) | I think it would be good to have a test for this user-facing error.. partly because I think we could use more .s file tests in general and the tests kind of act as documentation for what is and isn't possible with our .s format. |
- Moved checking of type to AsmParser label parsing.
- Improved MCSymbolWasm default type handling slightly.
- Added error test case.
| llvm/include/llvm/MC/MCSymbolWasm.h | ||
|---|---|---|
| 59 | Was able to get rid of the deprecated method. | |
| llvm/lib/MC/WasmObjectWriter.cpp | ||
|---|---|---|
| 1708 | So we still can end up with symbol that don't have exploit type and in that case we default to data symbols? | |
Any reason to keep the deprecated method around? Why not just remove it? I guess a followup that removes it would be fine too.