root icon indicating copy to clipboard operation
root copied to clipboard

[cling] Add TableGen-based generator for command line arguments

Open devajithvs opened this issue 1 year ago • 23 comments

Upstream moved away from manually declaring *def and *inc files. These are now auto-generated with tablegen. This patch does the same for cling, making it easier to rebase and maintain.

This Pull request:

Changes or fixes:

Checklist:

  • [x] tested changes locally
  • [ ] updated the docs (if necessary)

This PR fixes #

devajithvs avatar Feb 08 '24 10:02 devajithvs

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 08 '24 10:02 phsft-bot

Tablegen'd file for reference:

dvalapar@emmanouil:~/work/root (dev.cling-tablegen)$ llvm-tblgen-16 -I /home/dvalapar/work/root/interpreter/llvm-project/llvm/include /home/dvalapar/work/root/interpreter/cling/include/cling/Interpreter/ClingOptions.td -gen
-opt-parser-defs 
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|*                                                                            *|
|* Option Parsing Definitions                                                 *|
|*                                                                            *|
|* Automatically generated file, do not edit!                                 *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

/////////
// Prefixes

#ifdef PREFIX
#define COMMA ,
PREFIX(prefix_0, {llvm::StringLiteral("")})
PREFIX(prefix_3, {llvm::StringLiteral("-") COMMA llvm::StringLiteral("")})
PREFIX(prefix_2, {llvm::StringLiteral("-") COMMA llvm::StringLiteral("--") COMMA llvm::StringLiteral("")})
PREFIX(prefix_1, {llvm::StringLiteral("--") COMMA llvm::StringLiteral("")})
#undef COMMA
#endif // PREFIX

/////////
// Prefix Union

#ifdef PREFIX_UNION
#define COMMA ,
PREFIX_UNION({
llvm::StringLiteral("-") COMMA llvm::StringLiteral("--") COMMA llvm::StringLiteral("")})
#undef COMMA
#endif // PREFIX_UNION

/////////
// ValuesCode

#ifdef OPTTABLE_VALUES_CODE
#endif
/////////
// Groups

#ifdef OPTION

//////////
// Options

OPTION(prefix_0, llvm::StringLiteral("<input>"), INPUT, Input, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
OPTION(prefix_0, llvm::StringLiteral("<unknown>"), UNKNOWN, Unknown, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
OPTION(prefix_1, llvm::StringLiteral("debug-only="), _debugFlags_EQ, Joined, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
OPTION(prefix_1, llvm::StringLiteral("debug-only"), _debugFlags, Flag, INVALID, INVALID, nullptr, 0, 0, nullptr, nullptr, nullptr)
OPTION(prefix_1, llvm::StringLiteral("errorout"), _errorout, Flag, INVALID, INVALID, nullptr, 0, 0,
       "Do not recover from input errors", nullptr, nullptr)
OPTION(prefix_2, llvm::StringLiteral("help"), help, Flag, INVALID, INVALID, nullptr, 0, 0,
       "Print this help text", nullptr, nullptr)
OPTION(prefix_3, llvm::StringLiteral("L"), L, JoinedOrSeparate, INVALID, INVALID, nullptr, 0, 0,
       "Add directory to library search path", "<directory>", nullptr)
OPTION(prefix_3, llvm::StringLiteral("l"), l, JoinedOrSeparate, INVALID, INVALID, nullptr, 0, 0,
       "Load a library before prompt", "<library>", nullptr)
OPTION(prefix_1, llvm::StringLiteral("metastr="), _metastr_EQ, Joined, INVALID, INVALID, nullptr, 0, 0,
       "Set the meta command tag, default '.'", nullptr, nullptr)
OPTION(prefix_1, llvm::StringLiteral("metastr"), _metastr, Separate, INVALID, INVALID, nullptr, 0, 0,
       "Set the meta command tag, default '.'", nullptr, nullptr)
OPTION(prefix_1, llvm::StringLiteral("nologo"), _nologo, Flag, INVALID, INVALID, nullptr, 0, 0,
       "Do not show startup-banner", nullptr, nullptr)
OPTION(prefix_2, llvm::StringLiteral("noruntime"), noruntime, Flag, INVALID, INVALID, nullptr, 0, 0,
       "Disable runtime support (no null checking, no value printing)", nullptr, nullptr)
OPTION(prefix_1, llvm::StringLiteral("ptrcheck"), _ptrcheck, Flag, INVALID, INVALID, nullptr, 0, 0,
       "Enable injection of pointer validity checks", nullptr, nullptr)
OPTION(prefix_2, llvm::StringLiteral("version"), version, Flag, INVALID, INVALID, nullptr, 0, 0,
       "Print the compiler version", nullptr, nullptr)
OPTION(prefix_3, llvm::StringLiteral("v"), v, Flag, INVALID, INVALID, nullptr, 0, 0,
       "Enable verbose output", nullptr, nullptr)
#endif // OPTION

#ifdef SIMPLE_ENUM_VALUE_TABLE

struct SimpleEnumValue {
  const char *Name;
  unsigned Value;
};

struct SimpleEnumValueTable {
  const SimpleEnumValue *Table;
  unsigned Size;
};
static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
#endif // SIMPLE_ENUM_VALUE_TABLE

devajithvs avatar Feb 08 '24 10:02 devajithvs

Build failed on windows10/default. Running on null:C:\build\workspace\root-pullrequests-build See console output.

phsft-bot avatar Feb 08 '24 11:02 phsft-bot

Test Results

    12 files      12 suites   2d 6h 27m 17s :stopwatch:  2 562 tests  2 559 :white_check_mark: 0 :zzz: 3 :x: 28 822 runs  28 819 :white_check_mark: 0 :zzz: 3 :x:

For more details on these failures, see this check.

Results for commit daa486f0.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Feb 08 '24 11:02 github-actions[bot]

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 09 '24 13:02 phsft-bot

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 09 '24 13:02 phsft-bot

Try to change these lines. on Windows, the binaries are in the $<CONFIG>/bin directory, $<CONFIG> being only known at build time

Thanks @bellenot

devajithvs avatar Feb 09 '24 13:02 devajithvs

Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 09 '24 14:02 phsft-bot

The roottest-root-roofitstats-RooDataSet_ASCII_out_WILL_FAIL failures on Windows are known and will be fixed soon (a PR is there already)

bellenot avatar Feb 09 '24 15:02 bellenot

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 12 '24 12:02 phsft-bot

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 19 '24 09:02 phsft-bot

Build failed on ROOT-ubuntu2204/nortcxxmod. Running on root-ubuntu-2204-2.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 19 '24 10:02 phsft-bot

Build failed on windows10/default. Running on null:C:\build\workspace\root-pullrequests-build See console output.

phsft-bot avatar Feb 19 '24 10:02 phsft-bot

Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 19 '24 11:02 phsft-bot

Build failed on ROOT-performance-centos8-multicore/soversion. Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 19 '24 11:02 phsft-bot

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 19 '24 16:02 phsft-bot

Build failed on ROOT-ubuntu2204/nortcxxmod. Running on root-ubuntu-2204-3.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 19 '24 16:02 phsft-bot

Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 19 '24 18:02 phsft-bot

Build failed on ROOT-performance-centos8-multicore/soversion. Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 19 '24 21:02 phsft-bot

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 20 '24 08:02 phsft-bot

Build failed on ROOT-ubuntu2204/nortcxxmod. Running on root-ubuntu-2204-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 20 '24 08:02 phsft-bot

Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 20 '24 08:02 phsft-bot

Build failed on ROOT-performance-centos8-multicore/soversion. Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 20 '24 09:02 phsft-bot