[all-commits] [llvm/llvm-project] 374862: [clang][cli] Use variadic macros for parsing/gener...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Thu Jan 28 01:35:28 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 374862d71c1a2f63557a27f1555b37ff0f75117e
      https://github.com/llvm/llvm-project/commit/374862d71c1a2f63557a27f1555b37ff0f75117e
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M clang/lib/Frontend/CompilerInvocation.cpp

  Log Message:
  -----------
  [clang][cli] Use variadic macros for parsing/generating

This patch makes all macros forwarding to `PARSE_OPTION_WITH_MARSHALLING` and `GENERATE_OPTION_WITH_MARSHALLING` variadic.

Sice we will be splitting up all CompilerInvocation parts, this will allow us to avoid a lot of boilerplate code.

The local macros prefix forwarded arguments with local variables required by the main macros. The `{THIS,NO}_PREFIX` macros make it possible for forwarding macros in member functions (`parseSimpleArgs`, `generateCC1CommandLine`) to prefix keypaths with `this->`. (Some build bots seem to require that.)

Reviewed By: dexonsmith

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




More information about the All-commits mailing list