[all-commits] [llvm/llvm-project] fb4e46: [libc++] Simplify a few macros in __config

Louis Dionne via All-commits all-commits at lists.llvm.org
Mon Jun 7 09:46:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb4e4646188cf43a1e96a0aba6b6d24d8604257c
      https://github.com/llvm/llvm-project/commit/fb4e4646188cf43a1e96a0aba6b6d24d8604257c
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2021-06-07 (Mon, 07 Jun 2021)

  Changed paths:
    M libcxx/include/__config

  Log Message:
  -----------
  [libc++] Simplify a few macros in __config

Several macros were guarded with a check along the lines of:

 #ifndef MACRO
 #  define MACRO ...
 #endif

However, some of these macros are never intended to be defined by users,
so it's pointless to make this check (i.e. the first #ifndef is always
true). This commit removes those checks.

The motivation for doing this cleanup is to remove the impression that
arbitrary configurations macros can be defined by users when including
libc++ headers, which doesn't work reliably and leads to macro spaghetti.
If one needs to be able to override a knob in the __config, that's fine,
but the proper way to do that is to document the macro as being a public
facing knob in the documentation, and most likely to migrate that macro
to __config_site (depending on the nature of the macro).

Differential Revision: https://reviews.llvm.org/D103705




More information about the All-commits mailing list