[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare objc class-table dump options in TableGen (NFC)
Move the options of `language objc class-table dump` to a new
AppleObjCRuntimeOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformCaching options in TableGen (NFC)
Move the --local-cache-dir option of OptionGroupPlatformCaching to
TargetOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformRSync options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of OptionGroupPlatformRSync there.
Assisted-by: Claude
[lldb] Declare OptionGroupValueObjectDisplay options in TableGen
The --dynamic-type option takes its values from g_dynamic_value_types,
but it declared no argument type, so `help` printed "-d <none>" and
the option was not described as an enumeration.
Add eArgTypeDynamicValueType and move the value table to the argument
table, where EnumArg<"DynamicValueType"> can find it, and declare the
options of the group in InterpreterOptions.td. GetDynamicValueTypes()
had no other users and is removed; target.prefer-dynamic-value keeps
using the table directly.
`help dynamic-value-type` now lists the valid values, the usage lines
of the commands that accept -d show <dynamic-value-type> instead of
<none>, and list the options of the group in def name order.
Assisted-by: Claude
[lldb] Declare OptionGroupWatchpoint options in TableGen
Move the options of OptionGroupWatchpoint to InterpreterOptions.td.
The watch type enumeration moves to the argument table, where
EnumArg<"WatchType"> looks it up. As a result, `help watch-type` now
lists the valid values.
The usage lines of `watchpoint set variable` and `watchpoint set
expression` list the options in def name order.
Assisted-by: Claude
[lldb] Declare OptionGroupVariable options in TableGen (NFC)
Move the options of OptionGroupVariable to InterpreterOptions.td.
GetDefinitions() omits the four frame-only options by dropping the
leading definitions. TableGen emits options sorted by def name, so the
frame-only defs are named to sort first and a static_assert checks
that they do.
--regex takes no argument but was declared with
eArgTypeRegularExpression. The argument type is only consulted for
options that take an argument, so dropping it changes nothing.
Assisted-by: Claude
[lldb] Declare OptionGroupFormat options in TableGen
Move the options of OptionGroupFormat to InterpreterOptions.td.
GetDefinitions() hides --size and --count by slicing the definitions,
which relies on their order. TableGen emits them sorted by def name
(count, format, gdb-format, size), so name the positions, check them
with a static_assert and adjust the slices. SetOptionValue() now looks
the option up through GetDefinitions(), because the visible options
are no longer a prefix of the table.
Usage lines now list --count before --format.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatform options in TableGen
Move the options of OptionGroupPlatform to InterpreterOptions.td.
TableGen emits options sorted by def name rather than in declaration
order. GetDefinitions() omits --platform by dropping the first
definition, so the def is named to sort first and a static_assert
checks that it does. The sorting changes the order of --build,
--sysroot and --version in the usage lines of `platform select` and
`target create`.
Assisted-by: Claude
[lldb] Declare OptionGroupMemoryTag options in TableGen
Move the --show-tags option of OptionGroupMemoryTag to
InterpreterOptions.td. The two variants of the option differ only in
the description, so both are declared and the constructor picks one.
--show-tags used the multi-character constant 'tags' as its key; it
now uses '\x02', so `help memory read` and `help memory find` list it
before the options that have a short name instead of last.
Assisted-by: Claude
[lldb] Declare OptionGroupOutputFile options in TableGen
Move the options of OptionGroupOutputFile to InterpreterOptions.td.
--append-outfile has no short option and used the multi-character
constant 'apnd' as its key, which TableGen cannot express. It now uses
'\x01' like other options without a short name. Help lists options
sorted by key, so `help memory read` shows --append-outfile first
instead of last; test_help_detailed_information_spacing no longer
assumes which option comes first.
Assisted-by: Claude
[lldb] Declare OptionGroupArchitecture options in TableGen (NFC)
Add InterpreterOptions.td for the options of the option groups in
lldbInterpreter, which are shared between multiple commands, and move
the --arch option of OptionGroupArchitecture there.
Assisted-by: Claude
[lldb] Fix escaping in generated command option descriptions
`printEscapedString` converts non-printable characters to a backslash
followed by two hex digits, which C++ compiler reads as octal escape
sequence. A double quote comes out as \22 (0x12) and a newline as \0A,
i.e. a NUL byte followed by 'A', truncating the string.
Use `raw_ostream::write_escaped` instead.
[TableGen] Break ties in sorts to make some emitter output deterministic (#246614)
This changes the content of some generated files, but it is NFC in
terms of compiler behaviour: only the order of equivalent entries in
the generated tables changes.
Three sorts in the TableGen backends compare elements that can be equal,
so the order of the output depends on how the sort implementation
orders equal elements. With LLVM_ENABLE_EXPENSIVE_CHECKS, where
llvm::sort shuffles its input first, the output differs from run to
run:
- SubtargetEmitter sorts subtarget features by FieldName in two places.
Features that share a FieldName were emitted in an arbitrary order in
the GET_SUBTARGETINFO_MACRO table and in the inline feature lists.
The inline feature lists initialize a FeatureBitset, so their order
does not matter. The only targets with boolean features that share a
FieldName are CSKY and NVPTX, and neither of them uses
GET_SUBTARGETINFO_MACRO.
[20 lines not shown]
[clang][dataflow] Replace -dataflow-log with CLANG_DATAFLOW_LOG (#246736)
-dataflow-log only parses in tools that call cl::ParseCommandLineOptions
(clang-tidy, the unittests) and is the last static initializer in
clangAnalysisFlowSensitive. Read CLANG_DATAFLOW_LOG instead: `-` writes
a textual log to stderr, and a directory receives HTML logs.
[clang][CodeGen] Declare command line options in TableGen (#246735)
Rename -enable-single-byte-coverage and -enable-value-profiling to
-single-byte-coverage and -value-profiling, keeping the old spellings as
aliases.
[clang-format] Fix nested call indentation in block indent mode (#242376)
## Summary
For a line break directly after an opening bracket, `clang-format`
indents the contents one level relative to the enclosing indentation,
and the closing bracket uses that same indentation as its base
(`getNewLineColumn()`'s `BreakBeforeCloseBracket*` handling). In block
indentation mode -- i.e. when `AlignAfterOpenBracket` is `true` and
`BreakAfterOpenBracketFunction` is set, which is what
`AlignAfterOpenBracket: BlockIndent` maps to -- a nested call that is
part of a member access chain instead derived the contents indentation
from `StartOfFunctionCall`, which can hold a column-aligned position.
The contents were then indented to that column while the closing bracket
stayed at the block indent, so a single expression followed two
different rules:
```cpp
static_cast<std::uint64_t>(std::chrono::duration_cast<std::chrono::milliseconds>(
[92 lines not shown]
[AMDGPU][AsmParser] Support nocompr as a normal named-bit modifier
b9b7b31e2368 made nocompr be parsed and then dropped without
adding an operand by setting AlwaysIgnoreNegative to be 1.
This is not needed, because compr/nocompr can be a normal
named-bit operand, rearranging the exp operands depending on its
value rather than existence.
The IgnoreNegative parameter in parseNamedBit() stays, because
other modifiers still use it.
[LAA] Precommit tests for non-overlapping loop-invariant accesses (NFC) (#245055)
Tests for pairs of loop-invariant accesses. LAA reports an unknown
dependence for all of them. The fix in #245056 finds no dependence for
the eight disjoint pairs. `@overlap`, `@overlap_lower_second`,
`@overlap_scalable`, `@overlap_scalable_vscale`, `@vscale_no_range` and
`@unknown_distance` may overlap and must stay unknown.
Assisted-by: Claude Code
[VectorUtils] Refine live-ins handling in computeMinimumValueSizes
Prior to this patch, instructions outside of the analyzed blocks
were visited as part of the traversal. As the result, their
function-wide demanded bits were mixed into the analyzed class
making their out-of-the-loop users broaden demanded bits.
For this reason, we were making different decisions depending
on whether a live-in is an argument (didn't participate in the
traversal) or an instruction (did participate):
https://llvm.godbolt.org/z/5haMTGrY3
This change handles live-ins separately by adding demanded
bits only for their concrete in-loop users and excluding
them from non-traversed user checks.
[SystemZ][Clang] Mark clang failures for z/OS for TLS lit tests (#238354)
Mark the TLS related tests as a unsupported on z/OS (mostly by #if-ing
out the code). In addition, the current versions of z/OS have limited
support for TLS.
The support for TLS on z/OS 3.1/3.2 is limited to compile time
expressions for initialization. Eventually ctors/dtors and runtime
expressions for initializers will be supported. Until then update the
tests so the non-TLS parts are run.