-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[TargetVersion] Only enable on RISC-V and AArch64 #115991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
28f7a2a
5355896
659b628
5f7a3eb
a92daf6
182e79f
1d60b21
132ea98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3040,6 +3040,11 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, | |
| enum FirstParam { Unsupported }; | ||
| enum SecondParam { None }; | ||
| enum ThirdParam { Target, TargetClones, TargetVersion }; | ||
|
|
||
| if (!Context.getTargetInfo().getTriple().isRISCV() && | ||
| !Context.getTargetInfo().getTriple().isAArch64()) | ||
| return Diag(LiteralLoc, diag::err_target_version_unsupported); | ||
|
||
|
|
||
| llvm::SmallVector<StringRef, 8> Features; | ||
| if (Context.getTargetInfo().getTriple().isRISCV()) { | ||
| llvm::SmallVector<StringRef, 8> AttrStrs; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s | ||
BeMg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| //expected-error@+1 {{target_version attribute is not supported on this target}} | ||
| int __attribute__((target_version("aes"))) foo(void) { return 3; } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Dropped.