aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objcopy
AgeCommit message (Collapse)AuthorFilesLines
2025-09-09[DirectX] Add `extract-section` to `llvm-objcopy` and implement it for ↵Finn Plummer2-0/+14
`DXContainer` (#154804) This pr adds the `extract-section` option to `llvm-objcopy` as a common option. It differs from `dump-section` as it will produce a standalone object with just one section, as opposed to just the section contents. For more context as to other options considered, see https://github.com/llvm/llvm-project/pull/153265#issuecomment-3195696003. This difference in behaviour is used for DXC compatibility with `extract-rootsignature` and `/Frs`. This pr then implements this functionality for `DXContainer` objects. This is the second step of https://github.com/llvm/llvm-project/issues/150277 to implement as a compiler action that invokes `llvm-objcopy` for functionality. This also completes the implementation of `extract-rootsignature` as described in https://github.com/llvm/llvm-project/issues/149560.
2025-07-17[llvm-objcopy][libObject] Add RISC-V big-endian support (#146913)Djordje Todorovic1-0/+2
Add support for big-endian RISC-V ELF files: - Add riscv32be/riscv64be target architectures to Triple - Support elf32-bigriscv and elf64-bigriscv output targets in llvm-objcopy - Update ELFObjectFile to handle BE RISC-V format strings and architecture detection - Add BE RISC-V support to RelocationResolver - Add tests for new functionality This is a subset of a bigger RISC-V big-endian support patch, containing only the llvm-objcopy and libObject changes. Other changes will be added later.
2025-05-25[llvm-objcopy] Remove unused includes (NFC) (#141389)Kazu Hirata1-14/+0
These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures.
2025-03-07[llvm-strip] Let llvm-strip continue on encountering an error (#129531)Tejas Vipin1-2/+4
This change means that llvm-strip no longer exits immediately upon encountering an error when modifying a file and will instead continue modifying the other inputs. Fixes #129412
2025-01-23Reapply "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"Igor Kudrin3-0/+61
This fixes "unused-local-typedef" warnings in 9324e6a7a5. This adds an option `--remove-note=[name/]type` to selectively delete notes in ELF files, where `type` is the numeric value of the note type and `name` is the name of the originator. The name can be omitted, in which case all notes of the specified type will be removed. For now, only `SHT_NOTE` sections that are not associated with segments are handled. The implementation can be extended later as needed. RFC: https://discourse.llvm.org/t/rfc-llvm-objcopy-feature-for-editing-notes/83491
2025-01-23Revert "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"Igor Kudrin3-61/+0
This reverts commit 9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a.
2025-01-23[llvm-objcopy][ELF] Add an option to remove notes (#118739)Igor Kudrin3-0/+61
This adds an option `--remove-note=[name/]type` to selectively delete notes in ELF files, where `type` is the numeric value of the note type and `name` is the name of the originator. The name can be omitted, in which case all notes of the specified type will be removed. For now, only `SHT_NOTE` sections that are not associated with segments are handled. The implementation can be extended later as needed. RFC: https://discourse.llvm.org/t/rfc-llvm-objcopy-feature-for-editing-notes/83491
2024-12-11Rework the `Option` library to reduce dynamic relocations (#119198)Chandler Carruth1-24/+35
Apologies for the large change, I looked for ways to break this up and all of the ones I saw added real complexity. This change focuses on the option's prefixed names and the array of prefixes. These are present in every option and the dominant source of dynamic relocations for PIE or PIC users of LLVM and Clang tooling. In some cases, 100s or 1000s of them for the Clang driver which has a huge number of options. This PR addresses this by building a string table and a prefixes table that can be referenced with indices rather than pointers that require dynamic relocations. This removes almost 7k dynmaic relocations from the `clang` binary, roughly 8% of the remaining dynmaic relocations outside of vtables. For busy-boxing use cases where many different option tables are linked into the same binary, the savings add up a bit more. The string table is a straightforward mechanism, but the prefixes required some subtlety. They are encoded in a Pascal-string fashion with a size followed by a sequence of offsets. This works relatively well for the small realistic prefixes arrays in use. Lots of code has to change in order to land this though: both all the option library code has to be updated to use the string table and prefixes table, and all the users of the options library have to be updated to correctly instantiate the objects. Some follow-up patches in the works to provide an abstraction for this style of code, and to start using the same technique for some of the other strings here now that the infrastructure is in place.
2024-11-18[llvm-objcopy] Replace custom -- parsing with DashDashParsingFangrui Song1-9/+3
The custom -- parsing from https://reviews.llvm.org/D102665 can be replaced with the generic feature from https://reviews.llvm.org/D152286 Pull Request: https://github.com/llvm/llvm-project/pull/116565
2024-08-28[llvm] Prefer StringRef::substr to StringRef::slice (NFC) (#106330)Kazu Hirata1-3/+3
S.substr(N) is simpler than S.slice(N, StringRef::npos). Also, substr is probably better recognizable than slice thanks to std::string_view::substr.
2024-07-30[llvm-objcopy] Add --change-section-address (#98664)Eleanor Bonnici2-0/+78
--change-section address and its alias --adjust-section-vma allows modification of section addresses in a relocatable file. This used to be used, for example, in Fiasco microkernel. On a relocatable file this option behaves the same as GNU objcopy, apart from the fact that it does not issue any warnings, for example, when an argument is not used. GNU objcopy does not produce an error when passed an executable file but the usecase for this is not clear, and the behaviour is inconsistent. The idea of GNU objcopy --change-section-address is that the option should change both LMA and VMA in an executable file. Since this patch does not implement executable file support, only VMA is changed.
2024-07-11[llvm-objcopy] Add verification of added .note section formatserge-sans-paille2-0/+13
Also add a --no-verify-note-sections flag to make it possible to add invalid sections if needs be. Pull Request: https://github.com/llvm/llvm-project/pull/90458
2024-07-09[llvm-objcopy][COFF] Add aliases for some --subsystem options (#98036)Victor Campos1-5/+6
GNU objcopy has some --subsystem options that aren't present in LLVM's. They are in fact just aliases to some of the existing options. For the sake of compatibility with the GNU toolchain, this patch adds these aliases to LLVM objcopy. The alias list is not exhaustive as this is an incremental change.
2024-07-08[llvm-objcopy] Add change-section-lma *+/-offset (#95431)Eleanor Bonnici2-0/+44
llvm-objcopy did not support change-section-lma argument. This patch adds support for a use case of change-section-lma, that is shifting load address of all sections by the same offset. This seems to be the only practical use case of change-section-lma, found in other software such as Zephyr RTOS's build system. This is an option that could possibly be supported in some other than ELF formats, however this change only implements it for ELF. When used with other formats an error message is raised. In comparison, the behavior of GNU objcopy is inconsistent. For some ELF files it behaves the same as described above. For others, it copies the file without modifying the p_paddr fields when it would be expected. In some experiments it modifies arbitrary fields in section or program headers. It is unclear what exactly determines this. The executable file generated by yaml2obj in this test is not parsable by GNU objcopy. With Machine set to EM_AARCH64, the file can be parsed and the first test in the test file completes with 0 exit code. However, the result is rather arbitrary. AArch64 GNU objcopy subtracts 0x1000 from p_filesz and p_memsz of the first LOAD section and 0x1000 from p_offset of the second LOAD section. It does not look meaningful.
2024-05-22[llvm-objcopy] Check for missing argument values (#70710)Alexey Karyakin1-0/+6
Report an error if a required value for a command line argument is missing.
2024-05-01[llvm-install-name-tool] Error on non-Mach-O binaries (#90351)Keith Smiley1-0/+12
Previously if you passed an ELF binary it would be silently copied with no changes.
2024-04-15[llvm-objcopy] Add --compress-sectionsFangrui Song2-0/+42
--compress-sections is similar to --compress-debug-sections but applies to arbitrary sections. * `--compress-sections <section>=none`: decompress sections * `--compress-sections <section>=[zlib|zstd]`: compress sections with zlib/zstd Like `--remove-section`, the pattern is by default a glob, but a regex when --regex is specified. For `--remove-section` like options, `!` prevents matches and is not dependent on ordering (see `ELF/wildcard-syntax.test`). Since `--compress-sections a=zlib --compress-sections a=none` naturally allows overriding, having an order-independent `!` would be confusing. Therefore, `!` is disallowed. Sections within a segment are effectively immutable. Report an error for an attempt to (de)compress them. `SHF_ALLOC` sections in a relocatable file can be compressed, but linkers usually reject them. Note: Before this patch, a compressed relocation section is recognized as a `RelocationSectionBase` as well and `removeSections` `!ToRemove(*ToRelSec)` may incorrectly interpret a `CompressedSections` as `RelocationSectionBase`, leading to ubsan failure for the new test. Fix this by setting `OriginalFlags` in CompressedSection::CompressedSection. Link: https://discourse.llvm.org/t/rfc-compress-arbitrary-sections-with-ld-lld-compress-sections/71674 Pull Request: https://github.com/llvm/llvm-project/pull/85036
2024-04-05Revert "[llvm-objcopy] Add --compress-sections"Mitch Phillips2-42/+0
This reverts commit 9e3b64b9f95aadf57568576712902a272fe66503. Reason: Broke the UBSan buildbot. See the comments in the pull request (https://github.com/llvm/llvm-project/pull/85036) for more information.
2024-04-04[llvm-objcopy] Add --compress-sectionsFangrui Song2-0/+42
--compress-sections is similar to --compress-debug-sections but applies to arbitrary sections. * `--compress-sections <section>=none`: decompress sections * `--compress-sections <section>=[zlib|zstd]`: compress sections with zlib/zstd Like `--remove-section`, the pattern is by default a glob, but a regex when --regex is specified. For `--remove-section` like options, `!` prevents matches and is not dependent on ordering (see `ELF/wildcard-syntax.test`). Since `--compress-sections a=zlib --compress-sections a=none` naturally allows overriding, having an order-independent `!` would be confusing. Therefore, `!` is disallowed. Sections within a segment are effectively immutable. Report an error for an attempt to (de)compress them. `SHF_ALLOC` sections in a relocatable file can be compressed, but linkers usually reject them. Link: https://discourse.llvm.org/t/rfc-compress-arbitrary-sections-with-ld-lld-compress-sections/71674 Pull Request: https://github.com/llvm/llvm-project/pull/85036
2024-03-21[llvm-objcopy] Add --skip-symbol and --skip-symbols options (#80873)Ilia Kuklin2-0/+23
Add --skip-symbol and --skip-symbols options that allow to skip symbols when executing other options that can change the symbol's name, binding or visibility, similar to an existing option --keep-symbol that keeps a symbol from being removed by other options.
2024-03-12[llvm-objcopy] Remove unneeded #include. NFCFangrui Song1-0/+1
2024-03-12[llvm-objcopy] Use SmallVector to make some structs smaller. NFCFangrui Song1-1/+1
2024-02-28[llvm-objcopy] Add --set-symbol-visibility and --set-symbols-visibility ↵Ilia Kuklin2-0/+53
options (#80872) Add options --set-symbol-visibility and --set-symbols-visibility to manually change the visibility of symbols. There is already an option to set the visibility of newly added symbols via --add-symbol and --new-symbol-visibility. This option will allow to change the visibility of already existing symbols.
2024-02-27[llvm-objcopy] Improve help messages (#82830)Fangrui Song2-50/+52
https://reviews.llvm.org/D63820 added llvm/docs/CommandGuide/llvm-objcopy.rst with clearer semantics, e.g. ``` Read a list of names from the file <filename> and mark defined symbols with those names as global in the output instead of the help message Read a list of symbols from <filename> and marks them global" (omits "defined") Rename sections called <old> to <new> in the output instead of the help message Rename a section from old to new (multiple sections may be named <old> ``` Sync the help messages to incorporate the CommandGuide improvement. While here, switch to the conventional imperative sentences for a few options. Additionally, mark some options as grp_coff or grp_macho.
2024-02-16[llvm-objcopy] Add SystemZ support (#81841)Ulrich Weigand1-0/+2
This is also necessary for enabling ClangBuiltLinux: https://github.com/ClangBuiltLinux/linux/issues/1530
2024-02-09[llvm-objcopy] Support SREC output format (#75874)quic-areg2-0/+2
Adds a new output target "srec" to write SREC files from ELF inputs. https://en.wikipedia.org/wiki/SREC_(file_format)
2024-02-07[llvm-objcopy] Add --remove-symbol-prefix (#79415)Yi Kong2-0/+9
2024-01-11[llvm-driver] Fix usage of `InitLLVM` on Windows (#76306)Alexandre Ganea1-2/+0
Previously, some tools such as `clang` or `lld` which require strict order for certain command-line options, such as `clang -cc1` or `lld -flavor`, would not longer work on Windows, when these tools were linked as part of `llvm-driver`. This was caused by `InitLLVM` which was part of the `*_main()` function of these tools, which in turn calls `windows::GetCommandLineArguments`. That function completly replaces argc/argv by new UTF-8 contents, so any ajustements to argc/argv made by `llvm-driver` prior to calling these tools was reset. `InitLLVM` is now called by the `llvm-driver`. Any tool that participates in (or is part of) the `llvm-driver` doesn't call `InitLLVM` anymore.
2023-12-14[llvm-objcopy] Add --gap-fill and --pad-to options (#65815)quic-akaryaki2-0/+41
`--gap-fill <value>` fills the gaps between sections with a specified 8-bit value, instead of zero. `--pad-to <address>` pads the output binary up to the specified load address, using the 8-bit value from `--gap-fill` or zero. These options are only supported for ELF input and binary output.
2023-12-11[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)Kazu Hirata1-1/+1
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
2023-12-03[llvm] Stop including vector (NFC)Kazu Hirata1-1/+0
Identified with clangd.
2023-12-03[llvm] Stop including string (NFC)Kazu Hirata1-1/+0
Identified with clangd.
2023-11-30[llvm] Stop including llvm/ADT/StringSet.h (NFC)Kazu Hirata1-1/+0
Identified with clangd.
2023-08-15Reapply "[Option] Add "Visibility" field and clone the OptTable APIs to use it"Justin Bogner1-0/+1
This reverts commit 4e3b89483a6922d3f48670bb1c50a37f342918c6, with fixes for places I'd missed updating in lld and lldb. I've also renamed OptionVisibility::Default to "DefaultVis" to avoid ambiguity since the undecorated name has to be available anywhere Options.inc is included. Original message follows: This splits OptTable's "Flags" field into "Flags" and "Visibility", updates the places where we instantiate Option tables, and adds variants of the OptTable APIs that use Visibility mask instead of Include/Exclude flags. We need to do this to clean up a bunch of complexity in the clang driver's option handling - there's a whole slew of flags like CoreOption, NoDriverOption, and FlangOnlyOption there today to try to handle all of the permutations of flags that the various drivers need, but it really doesn't scale well, as can be seen by things like the somewhat recently introduced CLDXCOption. Instead, we'll provide an additive model for visibility that's separate from the other flags. For things like "HelpHidden", which is used as a "subtractive" modifier for option visibility, we leave that in "Flags" and handle it as a special case. Note that we don't actually update the users of the Include/Exclude APIs here or change the flags that exist in clang at all - that will come in a follow up that refactors clang's Options.td to use the increased flexibility this change allows. Differential Revision: https://reviews.llvm.org/D157149
2023-08-14Revert "[Option] Add "Visibility" field and clone the OptTable APIs to use it"Justin Bogner1-1/+0
this is failing on bots, reverting to investigate. This reverts commit a16104e6da6f36f3d72dbf53d10ba56495a0d65a.
2023-08-14[Option] Add "Visibility" field and clone the OptTable APIs to use itJustin Bogner1-0/+1
This splits OptTable's "Flags" field into "Flags" and "Visibility", updates the places where we instantiate Option tables, and adds variants of the OptTable APIs that use Visibility mask instead of Include/Exclude flags. We need to do this to clean up a bunch of complexity in the clang driver's option handling - there's a whole slew of flags like CoreOption, NoDriverOption, and FlangOnlyOption there today to try to handle all of the permutations of flags that the various drivers need, but it really doesn't scale well, as can be seen by things like the somewhat recently introduced CLDXCOption. Instead, we'll provide an additive model for visibility that's separate from the other flags. For things like "HelpHidden", which is used as a "subtractive" modifier for option visibility, we leave that in "Flags" and handle it as a special case. Note that we don't actually update the users of the Include/Exclude APIs here or change the flags that exist in clang at all - that will come in a follow up that refactors clang's Options.td to use the increased flexibility this change allows. Differential Revision: https://reviews.llvm.org/D157149
2023-08-04[llvm] Extract common `OptTable` bits into macrosJan Svoboda1-52/+13
All command-line tools using `llvm::opt` create an enum of option IDs and a table of `OptTable::Info` object. Most of the tools use the same ID (`OPT_##ID`), kind (`Option::KIND##Class`), group ID (`OPT_##GROUP`) and alias ID (`OPT_##ALIAS`). This patch extracts that common code into canonical macros. This results in fewer changes when tweaking the `OPTION` macros emitted by the TableGen backend. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D157028
2023-07-25[llvm-objcopy] --set-section-flags: allow "large" to add SHF_X86_64_LARGEThomas Köppe2-3/+4
Currently, objcopy cannot set the new flag SHF_X86_64_LARGE. This change introduces the named flag "large" which translates to that section flag. An "invalid argument" error is produced if a user attempts to set the flag on an architecture other than X86_64. Reviewed By: jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D153262
2023-07-14[llvm-objcopy] Remove stray periods from usage textThomas Köppe1-18/+18
The convention for TableGen help messages is to omit the period. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D155242
2023-06-26[llvm-objcopy] Add LoongArch supportWANG Xuerui1-0/+4
Apart from general feature parity, this is also necessary for enabling ClangBuiltLinux that defaults to using LLVM tools. While at it, add a missing comment for the Hexagon definition directly above, so it doesn't get confused with the SPARC definitions. Reviewed By: SixWeining, MaskRay, jhenderson Differential Revision: https://reviews.llvm.org/D153609
2023-06-25[llvm] Add missing StringExtras.h includesElliot Goodrich1-0/+1
In preparation for removing the `#include "llvm/ADT/StringExtras.h"` from the header to source file of `llvm/Support/Error.h`, first add in all the missing includes that were previously included transitively through this header.
2023-02-10[llvm-driver] Pass extra arguments to toolsAlex Brachet1-1/+2
Differential Revision: https://reviews.llvm.org/D137799
2023-02-10[NFC][TargetParser] Replace uses of llvm/Support/Host.hArchibald Elliott1-1/+1
The forwarding header is left in place because of its use in `polly/lib/External/isl/interface/extract_interface.cc`, but I have added a GCC warning about the fact it is deprecated, because it is used in `isl` from where it is included by Polly.
2023-01-12[OptTable] Precompute OptTable prefixes union table through tablegenserge-sans-paille1-8/+9
This avoid rediscovering this table when reading each options, providing a sensible 2% speedup when processing and empty file, and a measurable speedup on typical workloads, see: This is optional, the legacy, on-the-fly, approach can still be used through the GenericOptTable class, while the new one is used through PrecomputedOptTable. https://llvm-compile-time-tracker.com/compare.php?from=4da6cb3202817ee2897d6b690e4af950459caea4&to=19a492b704e8f5c1dea120b9c0d3859bd78796be&stat=instructions:u Differential Revision: https://reviews.llvm.org/D140800
2023-01-05Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ partserge-sans-paille2-4/+4
Use deduction guides instead of helper functions. The only non-automatic changes have been: 1. ArrayRef(some_uint8_pointer, 0) needs to be changed into ArrayRef(some_uint8_pointer, (size_t)0) to avoid an ambiguous call with ArrayRef((uint8_t*), (uint8_t*)) 2. CVSymbol sym(makeArrayRef(symStorage)); needed to be rewritten as CVSymbol sym{ArrayRef(symStorage)}; otherwise the compiler is confused and thinks we have a (bad) function prototype. There was a few similar situation across the codebase. 3. ADL doesn't seem to work the same for deduction-guides and functions, so at some point the llvm namespace must be explicitly stated. 4. The "reference mode" of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that). Per reviewers' comment, some useless makeArrayRef have been removed in the process. This is a follow-up to https://reviews.llvm.org/D140896 that introduced the deduction guides. Differential Revision: https://reviews.llvm.org/D140955
2022-12-27[clang] Use a StringRef instead of a raw char pointer to store builtin and ↵serge-sans-paille1-26/+42
call information This avoids recomputing string length that is already known at compile time. It has a slight impact on preprocessing / compile time, see https://llvm-compile-time-tracker.com/compare.php?from=3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u This a recommit of e953ae5bbc313fd0cc980ce021d487e5b5199ea4 and the subsequent fixes caa713559bd38f337d7d35de35686775e8fb5175 and 06b90e2e9c991e211fecc97948e533320a825470. The above patchset caused some version of GCC to take eons to compile clang/lib/Basic/Targets/AArch64.cpp, as spotted in aa171833ab0017d9732e82b8682c9848ab25ff9e. The fix is to make BuiltinInfo tables a compilation unit static variable, instead of a private static variable. Differential Revision: https://reviews.llvm.org/D139881
2022-12-25Revert "[clang] Use a StringRef instead of a raw char pointer to store ↵Vitaly Buka1-42/+26
builtin and call information" Revert "Fix lldb option handling since e953ae5bbc313fd0cc980ce021d487e5b5199ea4 (part 2)" Revert "Fix lldb option handling since e953ae5bbc313fd0cc980ce021d487e5b5199ea4" GCC build hangs on this bot https://lab.llvm.org/buildbot/#/builders/37/builds/19104 compiling CMakeFiles/obj.clangBasic.dir/Targets/AArch64.cpp.d The bot uses GNU 11.3.0, but I can reproduce locally with gcc (Debian 12.2.0-3) 12.2.0. This reverts commit caa713559bd38f337d7d35de35686775e8fb5175. This reverts commit 06b90e2e9c991e211fecc97948e533320a825470. This reverts commit e953ae5bbc313fd0cc980ce021d487e5b5199ea4.
2022-12-24[clang] Use a StringRef instead of a raw char pointer to store builtin and ↵serge-sans-paille1-26/+42
call information This avoids recomputing string length that is already known at compile time. It has a slight impact on preprocessing / compile time, see https://llvm-compile-time-tracker.com/compare.php?from=3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u This is a recommit of 719d98dfa841c522d8d452f0685e503538415a53 that into account a GGC issue (probably https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92181) when dealing with intiailizer_list and constant expressions. Workaround this by avoiding initializer list, at the expense of a temporary plain old array. Differential Revision: https://reviews.llvm.org/D139881
2022-12-23Revert "[clang] Use a StringRef instead of a raw char pointer to store ↵serge-sans-paille1-40/+30
builtin and call information" There are still remaining issues with GCC 12, see for instance https://lab.llvm.org/buildbot/#/builders/93/builds/12669 This reverts commit 5ce4e92264102de21760c94db9166afe8f71fcf6.
2022-12-23[clang] Use a StringRef instead of a raw char pointer to store builtin and ↵serge-sans-paille1-30/+40
call information This avoids recomputing string length that is already known at compile time. It has a slight impact on preprocessing / compile time, see https://llvm-compile-time-tracker.com/compare.php?from=3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u This is a recommit of 719d98dfa841c522d8d452f0685e503538415a53 with a change to llvm/utils/TableGen/OptParserEmitter.cpp to cope with GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108158 Differential Revision: https://reviews.llvm.org/D139881