[PATCH] D44753: [Preprocessor] Rename __is_{target -> host}_* function-like builtin macros

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 21 17:42:13 PDT 2018


compnerd added a comment.

I may be a bit biased but I agree with @bob.wilson and @steven_wu.  The current names are better from the user’s perspective.  GCC’s build is a very bad example as it has runtime components built as part of it (libgcc).  When building any code, even in a Canadian cross-compile, the target will always be what you are running on.  The preprocessor macros are part of the code that you are building for a given target.  The association with the command line option makes it more obvious what it is going to use to determine the value.  Having a pithy name should also be considered a design goal.  Recreating new terminology only muddles the problem.

Even if you are compiling a compiler, there is nothing special.  It is a standard user space program that will run on a specific target.  Even if you treat it as a perspective of the program, if you bootstrap on Linux, the bootstrapping compiler’s Target will be Linux even if the final compiler has a target of Windows.  The compiler is answering from the perspective of the program :)


Repository:
  rC Clang

https://reviews.llvm.org/D44753





More information about the cfe-commits mailing list