[PATCH] D43359: Clean up 'target' attribute diagnostics

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 16 05:52:31 PST 2018


aaron.ballman added inline comments.


================
Comment at: test/Sema/attr-target-ast.c:1
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -ast-dump %s | FileCheck %s
+
----------------
Can you drop the svn props from this file?


================
Comment at: test/Sema/attr-target.c:9-10
 int __attribute__((target("fpmath=387"))) walrus() { return 4; } //expected-warning {{ignoring unsupported 'fpmath=' in the target attribute string}}
+// expected-warning at +1 {{'target' attribute ignored}}
 int __attribute__((target("avx,sse4.2,arch=hiss"))) meow() {  return 4; }//expected-warning {{ignoring unsupported architecture 'hiss' in the target attribute string}}
+// expected-warning at +1 {{'target' attribute ignored}}
----------------
Is there ever a case where you *won't* get the "ignoring unsupported" without also getting the "'target' attribute ignored" warning as well? It seems a bit chatty to give two diagnostics for each mistake, and it makes one of those diagnostics seem incorrect -- in this case, one diagnostic says "ignoring unsupported architecture 'hiss'", implying the others are not ignored, but then the second diagnostic says the whole attribute is ignored.


https://reviews.llvm.org/D43359





More information about the cfe-commits mailing list