Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Enable target attribute when invoked through clang driver (#7…
…4889) d80e46d added support for the target function attribute. However, it turns out that commit has a nasty bug/oversight. As the tests in that revision show, everything works if clang -cc1 is directly invoked. I was suprised to learn this morning that compiling with clang (i.e. the typical user workflow) did not work. The bug is that if a set of explicit negative extensions is passed to cc1 at the command line (as the clang driver always does), we were copying these negative extensions to the end of the rewritten extension list. When this was later parsed, this had the effect of turning back off any extension that the target attribute had enabled. This patch updates the logic to only propagate the features from the input which don't appear in the rewritten form in either positive or negative form. Note that this code structure is still highly suspect. In particular I'm fairly sure that mixing extension versions with this code will result in odd results. However, I figure its better to have something which mostly works than something which doesn't work at all.
- Loading branch information