[PATCH] D41087: [Preprocessor] Implement __is_target_{arch|vendor|os|environment} function-like builtin macros

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 12:50:10 PST 2017


arphaman created this revision.

This patch implements the `__is_target_arch`, `__is_target_vendor`, `__is_target_os`, and `__is_target_environment` Clang preprocessor extensions that were proposed by @compnerd in Bob's cfe-dev post: http://lists.llvm.org/pipermail/cfe-dev/2017-November/056166.html.

These macros can be used to examine the components of the target triple at compile time. A`__has_builtin(__is_target_???)` preprocessor check can be used to check for their availability.


Repository:
  rC Clang

https://reviews.llvm.org/D41087

Files:
  include/clang/Lex/Preprocessor.h
  lib/Lex/PPMacroExpansion.cpp
  test/Preprocessor/is_target.c
  test/Preprocessor/is_target_os_darwin.c
  test/Preprocessor/is_target_unknown.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41087.126421.patch
Type: text/x-patch
Size: 8089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171211/33a3d7f7/attachment-0001.bin>


More information about the cfe-commits mailing list