[clang] Clang/bug113094 (PR #127439)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 17 05:27:33 PST 2025


================
@@ -8336,12 +8336,11 @@ static bool verifyValidIntegerConstantExpr(Sema &S, const ParsedAttr &Attr,
 /// match one of the standard Neon vector types.
 static void HandleNeonVectorTypeAttr(QualType &CurType, const ParsedAttr &Attr,
                                      Sema &S, VectorKind VecKind) {
-  bool IsTargetCUDAAndHostARM = false;
-  if (S.getLangOpts().CUDAIsDevice) {
-    const TargetInfo *AuxTI = S.getASTContext().getAuxTargetInfo();
-    IsTargetCUDAAndHostARM =
-        AuxTI && (AuxTI->getTriple().isAArch64() || AuxTI->getTriple().isARM());
-  }
+  const TargetInfo *AuxTI = S.getASTContext().getAuxTargetInfo();
+  bool IsArm = AuxTI && (AuxTI->getTriple().isAArch64() || AuxTI->getTriple().isARM());
+
+  bool IsTargetCUDAAndHostARM = IsArm && S.getLangOpts().CUDAIsDevice;
----------------
jhuber6 wrote:

I agree, unfortunately a lot of this handling is spread out all over the place. There's https://github.com/llvm/llvm-project/pull/126956 up which also tries to clean some of this up. However, right now I'd say that would be a larger cleanup out of scope for this bug fix.

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


More information about the cfe-commits mailing list