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

John Ericson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 22 10:29:52 PDT 2018


Ericson2314 added a comment.

OK I'll happily admit that Autoconf's choices of names is terrible, and that, yes, the names can be defined from two differing perspectives. And, I actually do believe the GCC build system is far inferior, too. But on other points I think we're all talking past each other.

I know `__will_be_built_for_*` is incredibly verbose and admitted as much; I was just trying to begin finding common ground by using different terminology with less baggage. Heck, `__is_*` works for me too, and nothing's more pithy than that. If you all wish to stick to preexisting terms and thus one of "build" "host" and "target", I'll switch back to arguing why I believe "target" is wrong.

I've claimed that `target` is //never// used in preprocessor macros to mean the platform where the being-built code is compiled for / platform where it will run. I've also linked various examples of code showing `target` used in the way I describe. In fact, here is another from LLVM itself: https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Config/llvm-config.h.cmake#L23-L33. I quote:

  /* Target triple LLVM will generate code for by default */
  #cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"

  /* Host triple LLVM will be executed on */
  #cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"

perfect use of these terms in pre-processor macros as far as I am concerned: from the perspective of the program being built (LLVM) and not the compiler building it.

Do you all have a counter-example of a CPP macro containing `target` with your meaning?


Repository:
  rC Clang

https://reviews.llvm.org/D44753





More information about the cfe-commits mailing list