forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (ll…
…vm#74889) 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
Showing
2 changed files
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters