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

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 16 08:37:59 PST 2018


erichkeane 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
+
----------------
aaron.ballman wrote:
> Can you drop the svn props from this file?
Absolutely, I'll do that on commit.


================
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}}
----------------
aaron.ballman wrote:
> 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.
There is not... I actually put in the second because I thought that the 1st (ignoring unsupported...) was pretty ambiguous.  I'll rev this patch seeing if I can simply make the former more clear.


https://reviews.llvm.org/D43359





More information about the cfe-commits mailing list