[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 25 05:16:26 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 13078cbc3eeb0ae91c370ce0f604f7165b26e0c8 65bfc47298131d6fb5dfeed722dc3f2d9d85eadd -- clang/test/CodeGen/aarch64-mixed-target-attributes.c clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/lib/Sema/SemaDecl.cpp clang/test/CodeGen/attr-target-clones-aarch64.c clang/test/CodeGenCXX/attr-target-clones-aarch64.cpp clang/test/Sema/attr-target-clones-aarch64.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index b1f2749c40..9a286e0b26 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -11471,8 +11471,7 @@ static bool PreviousDeclsHaveMultiVersionAttribute(const FunctionDecl *FD) {
return false;
}
-static
-void patchDefaultTargetVersion(FunctionDecl *From, FunctionDecl *To) {
+static void patchDefaultTargetVersion(FunctionDecl *From, FunctionDecl *To) {
if (!From->getASTContext().getTargetInfo().getTriple().isAArch64())
return;
@@ -11480,8 +11479,8 @@ void patchDefaultTargetVersion(FunctionDecl *From, FunctionDecl *To) {
MultiVersionKind MVKindTo = To->getMultiVersionKind();
if (MVKindTo == MultiVersionKind::None &&
- (MVKindFrom == MultiVersionKind::TargetVersion ||
- MVKindFrom == MultiVersionKind::TargetClones)) {
+ (MVKindFrom == MultiVersionKind::TargetVersion ||
+ MVKindFrom == MultiVersionKind::TargetClones)) {
To->setIsMultiVersion();
To->addAttr(TargetVersionAttr::CreateImplicit(
To->getASTContext(), "default", To->getSourceRange()));
@@ -11599,8 +11598,7 @@ static bool CheckTargetCausesMultiVersioning(Sema &S, FunctionDecl *OldFD,
return false;
}
-static bool MultiVersionTypesCompatible(FunctionDecl *Old,
- FunctionDecl *New) {
+static bool MultiVersionTypesCompatible(FunctionDecl *Old, FunctionDecl *New) {
MultiVersionKind OldKind = Old->getMultiVersionKind();
MultiVersionKind NewKind = New->getMultiVersionKind();
``````````
</details>
https://github.com/llvm/llvm-project/pull/86493
More information about the cfe-commits
mailing list