Support .option rvc and norvc to enable/disable C extension within file.
|22 ↗||(On Diff #143232)|
Kito, can you add an instruction before the first .option rvc to make sure the default behavior is unaltered:
|21 ↗||(On Diff #143232)|
This should be pure virtual method that you only implement in your RISCVTsargetELFstreamer and your RISCVASMstreamer. Making it virtual causes extra entries for your vtable.
Look at MCStreamer.h line 62
- Fix coding style issue.
- Add more instructions to testcase.
- Make emitDirectiveOptionRVC and emitDirectiveOptionNoRVC to pure virtual function.
- Return nullptr rather than RISCVTargetStreamer in createRISCVObjectTargetStreamer, because we have pure virtual function in RISCVTargetStreamer now.
Thanks Kito. Could you please add some tests for the new warning/failure cases introduced by this patch? e.g. .option with unrecognised identifier etc.
|98–99 ↗||(On Diff #143682)|
Unnecessary comment - the function call is pretty self-descriptive.
There's a corner case we're probably going to encounter here vs gcc.
In GCC, .option rvc or .option norvc in inline asm will have the effect of enabling/disabling instruction compression from that point onwards. I assume it won't have that effect with LLVM unless you use -save-temps. It might be that we decide this use of inline asm isn't supported by LLVM and people should use appropriate function or module attributes instead. Either way, a test which demonstrates the behaviour would be worthwhile.