llvm-project
0e2ebe79 - [RISC-V] Update streamer ArchString in emitTargetFeaturePush() (#225133)

Commit
67 days ago
[RISC-V] Update streamer ArchString in emitTargetFeaturePush() (#225133) Previously, RISCVAsmPrinter::emitTargetFeaturePush() only emitted `.option push` and `.option arch` without updating the streamer's active ArchString. When emitting an ELF object file directly (`-filetype=obj`), RISCVTargetELFStreamer::emitDirectiveOptionArch() is a no-op while emitTargetFeaturePop() resets ArchString back to the pushed ArchString, so module-level inline assembly and functions with custom `target-features` failed to emit updated `$x<arch>` mapping symbols. Call RTS.setArchString() with the parsed ISA string in emitTargetFeaturePush() so `-filetype=obj` records the active `$x<arch>` mapping symbol alongside `.option arch`. This commit was created with the help of AI tools Pull-Request: https://github.com/llvm/llvm-project/pull/225133
Author
Parents
Loading