[PATCH] D35519: Add SEMA checking to attribute 'target'

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 17 16:53:35 PDT 2017


erichkeane created this revision.

Attribute 'target' can take either features or architectures.  This patch accomplishes this in a couple of ways:

1- It adds support to Targets.cpp for "isValidCPUName" and "isValidFeatureName".  HOWEVER, the latter is only implemented for X86.  I'm hoping to delay implementation of those until later (or get help on that).
2- Cleans up the 'target' entry in Attr.td to use a struct instead of a 'Pair', so that more data can be included.  
3- Validates the attribute sufficiently.

Note that we currently do not have multi-versioning support (that is to come in a future patch) and SemaDeclAttr.cpp lacks knowledge of whether this is a multi-version, so this validation doesn't cover the multi-versioning case.


https://reviews.llvm.org/D35519

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/TargetInfo.h
  include/clang/Sema/Sema.h
  lib/Basic/Targets.cpp
  lib/CodeGen/CGCall.cpp
  lib/CodeGen/CodeGenModule.cpp
  lib/Sema/SemaDeclAttr.cpp
  test/Sema/attr-target.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35519.106980.patch
Type: text/x-patch
Size: 23812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170717/9cce51a0/attachment-0001.bin>


More information about the cfe-commits mailing list