Commit Graph

99 Commits

Author SHA1 Message Date
Kazuaki Ishizaki dd5571d51a [clang-tools-extra] NFC: Fix trivial typo in documents and comments
Differential Revision: https://reviews.llvm.org/D77458
2020-04-05 15:28:40 +09:00
Benjamin Kramer 4065e92195 Upgrade some instances of std::sort to llvm::sort. NFC. 2020-03-28 19:23:29 +01:00
Benjamin Kramer adcd026838 Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-28 23:25:25 +01:00
Kazuaki Ishizaki b7ecf1c1c3 NFC: Fix trivial typos in comments 2020-01-04 10:28:41 -05:00
Ehud Katz c63f1b160e [DeclCXX] Remove unknown external linkage specifications
Partial revert of r372681 "Support for DWARF-5 C++ language tags".

The change introduced new external linkage languages ("C++11" and
"C++14") which not supported in C++.

It also changed the definition of the existing enum to use the DWARF
constants. The problem is that "LinkageSpecDeclBits.Language" (the field
that reserves this enum) is actually defined as 3 bits length
(bitfield), which cannot contain the new DWARF constants. Defining the
enum as integer literals is more appropriate for maintaining valid
values.

Differential Revision: https://reviews.llvm.org/D69935
2019-11-21 15:23:05 +02:00
Mikael Holmen e07376a320 [modularize] Fix compilation warning after r372681
In r372681 lang_cxx_11 and lang_cxx_14 were added to LanguageIDs
but they were not handled in the switch in VisitLinkageSpecDecl in
Modularize.cpp so at clang 8 complained with

/data/repo/master/clang-tools-extra/modularize/Modularize.cpp:583:13: error: enumeration values 'lang_cxx_11' and 'lang_cxx_14' not handled in switch [-Werror,-Wswitch]
    switch (D->getLanguage()) {
            ^
1 error generated.

With this patch we now treat lang_cxx, lang_cxx_11 and lang_cxx_14 the
same way in the switch in VisitLinkageSpecDecl.

llvm-svn: 372714
2019-09-24 09:44:55 +00:00
Ilya Biryukov 433927595d [Driver] Use shared singleton instance of DriverOptTable
Summary:
This significantly reduces the time required to run clangd tests, by
~10%.

Should also have an effect on other tests that run command-line parsing
multiple times inside a single invocation.

Reviewers: gribozavr, sammccall

Reviewed By: sammccall

Subscribers: kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 370908
2019-09-04 14:26:28 +00:00
Dmitri Gribenko 907452107d Changed FrontendActionFactory::create to return a std::unique_ptr
Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 370379
2019-08-29 16:38:36 +00:00
Jonas Devlieghere 1c705d9c53 [clang-tools-extra] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

Differential revision: https://reviews.llvm.org/D66259

llvm-svn: 368944
2019-08-14 23:52:23 +00:00
Fangrui Song 36fbd0da5f Simplify with llvm::is_contained. NFC
llvm-svn: 365993
2019-07-13 07:23:12 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Alexander Kornienko 301faac18b clang-tidy, modularize: return non-zero exit code on errors
When no inputs given, the tools should not only produce the help message, but
also return a non-zero exit code. Fixed tests accordingly.

llvm-svn: 328199
2018-03-22 14:18:20 +00:00
Roman Lebedev 12b40745ab Revert "[Tooling] [1/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>"
This reverts commit rL326202

This broke gcc4.8 builds, compiler just segfaults:
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/14909
http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/22673

llvm-svn: 326203
2018-02-27 15:54:41 +00:00
Roman Lebedev 6b56a11961 [Tooling] [1/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>
Summary:
I'm not sure whether there are any principal reasons why it returns raw owning pointer,
or it is just a old code that was not updated post-C++11.

I'm not too sure what testing i should do, because `check-all` is not error clean here for some reason,
but it does not //appear// asif those failures are related to these changes.

This is Clang-tools-extra part.
Clang part is D43779.

Reviewers: klimek, bkramer, alexfh, pcc

Reviewed By: alexfh

Subscribers: ioeric, jkorous-apple, cfe-commits

Tags: #clang, #clang-tools-extra

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

llvm-svn: 326202
2018-02-27 15:19:28 +00:00
Rafael Espindola d63b2f3996 Update for PrintHelpMessage not calling exit.
llvm-svn: 312769
2017-09-08 00:33:39 +00:00
Piotr Padlewski 08124b110a modernize-use-auto NFC fixes
llvm-svn: 289656
2016-12-14 15:29:23 +00:00
Martin Bohme e9a265a267 Adapt to TraverseLambdaCapture interface change from D23204
Summary:
Depends on D23204.

This is intended to be submitted immediately after D23204 lands.

Reviewers: jdennett, alexfh

Subscribers: cfe-commits

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

llvm-svn: 278934
2016-08-17 15:00:22 +00:00
Alexander Kornienko 0caf6dadce Accommodate interface change in r252134.
llvm-svn: 252138
2015-11-05 02:30:21 +00:00
NAKAMURA Takumi fdaefe533b Prune CRLF.
llvm-svn: 247541
2015-09-14 11:13:39 +00:00
John Thompson 4018c62428 Added mechanism to modularize for doing a compilation precheck
to determine files that have comnpilation or dependency problems.
A new -display-file-lists option use this to display lists of good files
(no compile errors), problem files, and a combined list with
problem files preceded by a '#'.  The problem files list can be
used in the module map generation assistant mode to exclude
problem files.  The combined files list can be used during module
map development.  See added docs.

llvm-svn: 241880
2015-07-10 00:37:25 +00:00
John Thompson 91656d2db6 Fixed erroneous comments.
llvm-svn: 241726
2015-07-08 21:05:57 +00:00
John Thompson ddd7dea4b1 Fixed erroneous comment.
llvm-svn: 241724
2015-07-08 20:57:32 +00:00
Yaron Keren 40178c352e Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but now fails the bots.
llvm-svn: 241335
2015-07-03 09:30:33 +00:00
Yaron Keren 452670165c Replace some const std::string & with llvm::StringRef or std::string
and std::move to avoid implicit std::string construction.

Patch by Eugene Kosov.

llvm-svn: 241330
2015-07-03 09:16:20 +00:00
David Blaikie 1f02f962f5 Update for LLVM API change to return by InputArgList directly (rather than by pointer) from ParseArgs
llvm-svn: 240348
2015-06-22 22:06:58 +00:00
David Blaikie faa9280bdc Update for ParseARgs ArrayRef-ification
llvm-svn: 240239
2015-06-21 06:58:19 +00:00
John Thompson 96f5551b03 Fixed modularize to warn about missing headers referenced in a module map.
llvm-svn: 239122
2015-06-04 23:35:19 +00:00
John Thompson cf777e9f05 Fixed option comment. '=' is required.
llvm-svn: 238997
2015-06-04 01:10:19 +00:00
John Thompson f9f62b116f Changed option processing to implicitly use -x c++ if no other -x option specified. Added implicit -w option to disable compilation warnings, in particular to avoid warning on pragma once.
llvm-svn: 236625
2015-05-06 18:43:01 +00:00
Richard Smith 76e66607a3 Fix clang-tools-extra build after clang r235614.
llvm-svn: 235642
2015-04-23 20:38:48 +00:00
Alexander Kornienko 87638f6345 Use 'override/final' instead of 'virtual' for overridden methods
Summary:
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
      -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix

  svn diff | clang-format-diff -i

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D8927

llvm-svn: 234681
2015-04-11 07:59:33 +00:00
Benjamin Kramer e71037123b Make helpers static. clang-tools edition.
Also purge dead code found by it. NFC.

llvm-svn: 232948
2015-03-23 12:49:15 +00:00
John Thompson 8eb8d93672 Added module map coverage support, extracted from module-map-checker.
llvm-svn: 229869
2015-02-19 16:47:27 +00:00
John Thompson 9cb7964641 Added support for extracting headers from module maps as a source for the header list.
llvm-svn: 229692
2015-02-18 16:14:32 +00:00
John Thompson eaa4c73d62 Updated file comment on modularize usage, as it was out-of-date.
llvm-svn: 229677
2015-02-18 15:11:12 +00:00
John Thompson 3dcb3934c6 Add canonical path conversion function and use it so paths are consistent.
llvm-svn: 229540
2015-02-17 20:43:47 +00:00
John Thompson d845baecb4 Moved header list loading to new class. This is staging for adding module map loading and checking support.
llvm-svn: 229108
2015-02-13 14:29:22 +00:00
NAKAMURA Takumi 24fbdf124b Modularize.cpp: Simplify. Vector may be aware of ranged-for.
llvm-svn: 228993
2015-02-13 00:28:32 +00:00
NAKAMURA Takumi c8930de79e Modularize.cpp: Prune CRLFs.
llvm-svn: 228992
2015-02-13 00:28:26 +00:00
John Thompson 469bbc002a Added support for multiple header list files, as a precursor for when we need to load multiple module maps.
llvm-svn: 228935
2015-02-12 16:22:09 +00:00
John Thompson ecd3b04cd7 Added -block-check-header-list-only option. This is a work-around for private includes that purposefully get included inside blocks.
llvm-svn: 228846
2015-02-11 16:58:36 +00:00
John Thompson 5d9862f071 Renamed module.map to module.modulemap (modularize).
llvm-svn: 228693
2015-02-10 14:45:30 +00:00
Alexander Kornienko d365731dd0 Make ArgumentsAdjuster an std::function (clang-tools-extra part of D6505).
Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6506

llvm-svn: 223249
2014-12-03 17:53:03 +00:00
David Blaikie 680c4c898c Recommit 213308: unique_ptr-ify ownership of ASTConsumers (reverted in r213324)
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.

llvm-svn: 215324
2014-08-10 19:56:59 +00:00
Benjamin Kramer 6e9142474d Plug memory leaks.
Most of the changes are mechanic std::unique_ptr insertions. All leaks were
detected by LeakSanitizer.

llvm-svn: 213851
2014-07-24 10:23:33 +00:00
David Blaikie 5bae2c87d5 Revert "unique_ptr-ify ownership of ASTConsumers"
This reverts commit r213308.

Reverting to have some on-list discussion/confirmation about the ongoing
direction of smart pointer usage in the LLVM project.

llvm-svn: 213324
2014-07-17 22:33:56 +00:00
David Blaikie b9574aceae unique_ptr-ify ownership of ASTConsumers
llvm-svn: 213308
2014-07-17 20:40:47 +00:00
Rafael Espindola 43f0aa6caf Update for llvm api change.
llvm-svn: 212406
2014-07-06 17:43:19 +00:00
Rafael Espindola c7f0d23f56 Prefix error_code with std.
llvm-svn: 210840
2014-06-12 22:08:48 +00:00
Rafael Espindola 002840cf66 Quick build fix.
llvm-svn: 210838
2014-06-12 22:01:48 +00:00