Commit Graph

225 Commits

Author SHA1 Message Date
Fangrui Song cae3b831f4 [llvm-nm] Switch command line parsing from llvm::cl to OptTable
Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

Users should generally observe no difference as long as they only use intended
option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=0` cannot be used. Omit the option or use `--no-demangle` instead.
* `--help-list` is removed. This is a `cl::` specific option.

Note:

* `-t` diagnostic gets improved.
* This patch avoids cl::opt collision if we decide to support multiplexing for binary utilities
* One-dash long options are still supported.
* The `-s` collision (`-s segment section` for Mach-O) is unfortunate. `-s` means `--print-armap` in GNU nm.
* This patch removes the last `cl::multi_val` use case from the `llvm/lib/Support/CommandLine.cpp` library

`-M` (`--print-armap`), `-U` (`--defined-only`), and `-W` (`--no-weak`)
are now deprecated. They could conflict with future GNU nm options.
(--print-armap has an existing alias -s, so GNU will unlikely add a new one.
--no-weak (not in GNU nm) is rarely used anyway.)

`--just-symbol-name` is now deprecated in favor of
`--format=just-symbols` and `-j`.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105330
2021-07-07 13:34:33 -07:00
Benjamin Kramer 775cac4cca [Bazel] Fix build for 98f078324f 2021-07-05 22:40:18 +02:00
Benjamin Kramer b3f5d0639e [Bazel] Fix build for 35d4593e6b 2021-07-05 22:40:18 +02:00
Geoffrey Martin-Noble 7c5d654f64 [Bazel] Fix build for c0a6318d96
This adds explicit deps to satisfy layering_check

Differential Revision: https://reviews.llvm.org/D105356
2021-07-02 09:22:33 -07:00
Rob Suderman 06ac83fcac [mlir][tosa] Update Bazel files for TOSA pass changes
There were some missing bazel dependencies for the Tosa dialect.
Added these deps.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D105326
2021-07-01 17:45:00 -07:00
Geoffrey Martin-Noble bef9464c51 [Bazel] Fixes for 266a7414d8
Adds LinalgOps dep needed for
https://github.com/llvm/llvm-project/commit/266a7414d8f26

Differential Revision: https://reviews.llvm.org/D105294
2021-07-01 09:40:07 -07:00
Geoffrey Martin-Noble d08f8960d0 [Bazel] add missing load to submodule example
I missed this in https://reviews.llvm.org/D105245

Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D105252
2021-06-30 19:35:27 -07:00
Geoffrey Martin-Noble 4aa1c141bd [Bazel] Rework LLVM target selection
This patch introduces a custom rule for expanding the LLVM target
enumeration .def files. This provides a slightly cleaner API for these
rules, but is mostly to permit selects to be used when determining which
LLVM targets to build. Right now the target list is generated at Bazel
configure time, but this will allows us to add functionality to also
control which targets are built based on config settings.

Tested: Ran `bazel test --config=rbe ... @llvm-project//...`

Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D104969
2021-06-30 16:53:00 -07:00
Geoffrey Martin-Noble 9cc1ddd393 [Bazel] Update README with examples
Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D105245
2021-06-30 16:50:23 -07:00
Stella Laurenzo 485cc55edf [mlir] Generare .cpp.inc files for dialects.
* Previously, we were only generating .h.inc files. We foresee the need to also generate implementations and this is a step towards that.
* Discussed in https://llvm.discourse.group/t/generating-cpp-inc-files-for-dialects/3732/2
* Deviates from the discussion above by generating a default constructor in the .cpp.inc file (and adding a tablegen bit that disables this in case if this is user provided).
* Generating the destructor started as a way to flush out the missing includes (produces a link error), but it is a strict improvement on its own that is worth doing (i.e. by emitting key methods in the .cpp file, we root vtables in one translation unit, which is a non-controversial improvement).

Differential Revision: https://reviews.llvm.org/D105070
2021-06-29 20:10:30 +00:00
Geoffrey Martin-Noble 09ac97ce35 [Bazel] Update for 0813700de1
Updates Bazel BUILD files for changes in
https://github.com/llvm/llvm-project/commit/0813700de1

Differential Revision: https://reviews.llvm.org/D104990
2021-06-27 08:33:03 -07:00
Aart Bik 557b101ce7 [mlir][sparse] add print methods to Merger (for debugging)
Reviewed By: gussmith23

Differential Revision: https://reviews.llvm.org/D104939
2021-06-25 15:10:06 -07:00
Geoffrey Martin-Noble f0dd6faaec Update Bazel build for 744146f60b
Updates Bazel build files to match
https://github.com/llvm/llvm-project/commit/744146f60b

Differential Revision: https://reviews.llvm.org/D104885
2021-06-24 16:38:16 -07:00
Geoffrey Martin-Noble 1ca4cf9b24 Update Bazel build for 929189a499
Updates Bazel build files to match
https://github.com/llvm/llvm-project/commit/929189a499

Differential Revision: https://reviews.llvm.org/D104864
2021-06-24 09:43:47 -07:00
Geoffrey Martin-Noble b58dfd87da Update Bazel BUILD files up to be9a87fe9b
Differential Revision: https://reviews.llvm.org/D104791
2021-06-23 09:27:26 -07:00
Geoffrey Martin-Noble 4aeb2e60df Introduce a Bazel build configuration
This patch introduces configuration for a Bazel BUILD in a side
directory in the monorepo.

This is following the approval of
https://github.com/llvm/llvm-www/blob/main/proposals/LP0002-BazelBuildConfiguration.md

As detailed in the README, the Bazel BUILD is not supported
by the community in general, and is maintained only by interested
parties. It follows the requirements of the LLVM peripheral tier:
https://llvm.org/docs/SupportPolicy.html#peripheral-tier.

This is largely copied from https://github.com/google/llvm-bazel,
with a few filepath tweaks and the addition of the README.

Reviewed By: echristo, keith, dblaikie, kuhar

Differential Revision: https://reviews.llvm.org/D90352
2021-06-22 12:47:43 -07:00
David Spickett 810d4a6ff6 [utils] Don't print username in arcanist clang format message
I didn't realise this message was also posted to the phabricator review.

Just say "the user's local path". "local" is the important part,
the username is not important.
2021-05-14 14:33:00 +00:00
David Spickett 0326d4667a [Utils] Use whoami to get username for arcanist warning message
959eec1fdd changed the message
to show the local username with "$user" but this is not always set.

Some systems will have USER/USERNAME/LOGNAME, so just use "whoami"
instead.
2021-05-13 11:11:43 +01:00
Shivam Gupta 959eec1fdd
[NFC] Give better diagnose on clang-format not found error
Contributors often confused by whether this is a server or local issue.
2021-05-04 09:22:06 +05:30
Richard Smith c25da4b04a Fix arc lint's clang-format rule: only format the file we were asked to format.
This avoids diffs being applied in the work tree to files that are
supposed to be excluded (clang tests), allows arc to properly provide
interactive feedback for the formatting fixes, and reduces the number of
files that we format, in a change affecting N files, from N^2 to N.
2020-10-11 14:24:23 -07:00
Scott Linder ad08ecbd16 Use in-tree clang-format-diff.py as Arcanist linter
Summary:
The only guarantee there seems to be in the clang-format packaging is
that an executable called `clang-format` is in the PATH. Use the
in-tree `clang-format-diff.py` to avoid assuming anything else.

Also remove dead code for SVN repo and switch to `git diff-index` which
is the git plumbing equivalent of `git diff` in this case.

Reviewers: starsid, mehdi_amini, vitalybuka, fhahn, kadircet

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77428
2020-04-06 12:02:20 -04:00
Kadir Cetinkaya 3e1b8db309
Revert "Use git-clang-format as Arcanist linter"
This reverts commit 31b6e182f2.

As it was breaking `arc diff` workflow for multiple people.
2020-04-03 15:35:41 +02:00
Vitaly Buka 1aee1ae532 Use --style file instead of --style LLVM
LLVM includes .clang-format files which must be respected.
2020-04-03 01:37:56 -07:00
Siddhartha Bagaria 31b6e182f2 Use git-clang-format as Arcanist linter
D49116 was using clang-format-diff because at the time of its writing,
it needed to handle the subversion repo as well.

Differential Revision: https://reviews.llvm.org/D77363
2020-04-03 04:53:33 +00:00
Siddhartha Bagaria 3c371491a2 Setup clang-format as an Arcanist linter
Summary:
This uses clang-format-diff as a linter for Arcanist.

`arc lint` flow, also run as part of `arc diff` unless skipped with
`--nolint`, will now run the linter shell script on the changed files,
and prompt the user to accept the suggested changes.

Message when clang-format-diff is not installed:
{F6654094}

Example of the noise during code review when clang-format-diff is not installed:
https://reviews.llvm.org/differential/changeset/?ref=1115809

Prompt when clang-format-diff is installed and suggests edits:
{F6650223}

Reviewers: probinson, scott.linder

Reviewed By: scott.linder

Subscribers: scott.linder, MyDeveloperDay, JonasToth, danilaml, JDevlieghere, dberris, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D49116
2020-03-30 15:02:33 -04:00