Also improve assembler parser register validation for .seh_ directives.
This requires moving X86-specific seh directive handling into the x86
backend, which addresses some assembler FIXMEs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
3764 | I think we should continue to accept the numbers to be GNU as compatible. I think the directive_seh.s and seh-directive-errors.s tests are the only remaining tests that use the numbers now, and they only exist to ensure we do the right thing with them. | |
llvm/test/MC/AsmParser/directive_seh.s | ||
22 | Oops, this was supposed to use a the number, but my sed command turned it into a register. |
Thanks! I was hoping to hear from @craig.topper or @RKSimon, but I've been meaning to do this for so long, I think it's time to move forward on it.
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
3791 | Do we need to support 32-bit registers in 32-bit mode? Or is there soemthing about .seh that is only 64-bit? |
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
3791 | These directives should be 64-bit only. There are tests for that at llvm/test/MC/AsmParser/seh-directive-errors.s. I noticed a crash, I'll fix that in a sec. |
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
3612 | if (IDVal == ".seh_stackalloc") is not being handled here, but you've added X86AsmParser::parseDirectiveSEHAllocStack. Is that intended? |
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
3612 | No, that's a mistake, thanks. I was surprised to discover that the AArch64 SEH asm parsing code supports this directive and does something with it, so I had to move it back to MCStreamer, and forgot to delete this. |
if (IDVal == ".seh_stackalloc") is not being handled here, but you've added X86AsmParser::parseDirectiveSEHAllocStack. Is that intended?