- enable LTO need to pass target feature and abi to LTO code generation RISCV backend need the target feature to decide which extension used in code generation.
- move getTargetFeatures to CommonArgs.h and add ForLTOPlugin flag
- add general tools::getTargetABI in CommonArgs.h because different target uses different way to get the target ABI.
|414 ↗||(On Diff #219941)|
The single-dash form of mattr: -plugin-opt=-mattr= should be preferred. --mattr is rare.
|26 ↗||(On Diff #219941)|
The description should probably mention why clang::driver:tools::AddGoldPlugin is insufficient.
I have some nits about explicit comments for arguments and default argument values for backwards compatibility. Other than that, it looks like a nice code cleanup.
This needs /*ForAS=*/true, /*ForLTOPlugin=*/false) so it's clear what the booleans are for. Same for other calls to getTargetFeatures.
The final argument here should probably default to false, so that out-of-tree backends do not break immediately when this patch lands.