[all-commits] [llvm/llvm-project] 40c261: [clang][cli] Generate and round-trip language options

Jan Svoboda via All-commits all-commits at lists.llvm.org
Tue Feb 9 01:19:18 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40c261c41c4ceb0dff802d6a83f7ae65af936af8
      https://github.com/llvm/llvm-project/commit/40c261c41c4ceb0dff802d6a83f7ae65af936af8
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-02-09 (Tue, 09 Feb 2021)

  Changed paths:
    M clang/include/clang/Basic/Sanitizers.h
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Frontend/CompilerInvocation.h
    M clang/lib/Basic/Sanitizers.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/unittests/Basic/CMakeLists.txt
    A clang/unittests/Basic/SanitizersTest.cpp

  Log Message:
  -----------
  [clang][cli] Generate and round-trip language options

This patch implements generation of remaining language options and tests it by performing parse-generate-parse round trip (on by default for assert builds, off otherwise).

This patch also correctly reports failures in `parseSanitizerKinds`, which is necessary for emitting diagnostics when an invalid sanitizer is passed to `-fsanitize=` during round-trip.

This patch also removes TableGen marshalling classes from two options:
* `fsanitize_blacklist` When parsing: it's first initialized via the generated code, but then also changed by manually written code, which is confusing.
* `fopenmp` When parsing: it's first initialized via generated code, but then conditionally changed by manually written code. This is also confusing. Moreover, we need to do some extra checks when generating it, which would be really cumbersome in TableGen. (Specifically, not emitting it when `-fopenmp-simd` was present.)

Reviewed By: dexonsmith

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




More information about the All-commits mailing list