[clang] [AMDGPU] Do not emit arch dependent macros with unspecified cpu (PR #79660)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 26 14:35:17 PST 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 55c6d9103444aaf70bf680c3768c14e8649bf580 63d0328f9b17b833762ad599ee97381158958f3b -- clang/lib/Basic/Targets/AMDGPU.cpp clang/test/Preprocessor/predefined-arch-macros.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp b/clang/lib/Basic/Targets/AMDGPU.cpp
index 1fe09c1ce6..dcdbc1ebe2 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -277,8 +277,8 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
   if (GPUKind == llvm::AMDGPU::GK_NONE)
     return;
 
-  StringRef CanonName = isAMDGCN(getTriple()) ?
-    getArchNameAMDGCN(GPUKind) : getArchNameR600(GPUKind);
+  StringRef CanonName = isAMDGCN(getTriple()) ? getArchNameAMDGCN(GPUKind)
+                                              : getArchNameR600(GPUKind);
   Builder.defineMacro(Twine("__") + Twine(CanonName) + Twine("__"));
   // Emit macros for gfx family e.g. gfx906 -> __GFX9__, gfx1030 -> __GFX10___
   if (isAMDGCN(getTriple())) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/79660


More information about the cfe-commits mailing list