Duncan P. N. Exon Smith
0065198166
clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC
...
Update clang-tools-extra, clang/tools, clang/unittests to migrate from
`SourceManager::getBuffer`, which returns an always dereferenceable
`MemoryBuffer*`, to `getBufferOrNone` or `getBufferOrFake`, both of
which return a `MemoryBufferRef`, depending on whether the call site was
checking for validity of the buffer. No functionality change intended.
Differential Revision: https://reviews.llvm.org/D89416
2020-10-15 00:35:16 -04:00
Chris Lattner
39c9c12b76
[clang-tools-extra] reimplement PreprocessorTracker in terms of StringSet.
...
Summary:
PreprocessorTracker is the last user of the old StringPool class, which
isn't super loved and isn't a great improvement over a plan StringSet.
Once this goes in we can remove StringPool entirely.
This is as discussed on cfe-dev.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78273
2020-04-16 12:57:43 -07:00
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
Kazuaki Ishizaki
b7ecf1c1c3
NFC: Fix trivial typos in comments
2020-01-04 10:28:41 -05: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
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
Julie Hockett
546943f9f1
Reland "[tools] Updating PPCallbacks::InclusionDirective calls"
...
This commit relands r331905.
r331904 added SrcMgr::CharacteristicKind to the InclusionDirective
callback, this revision updates instances of it in clang-tools-extra.
llvm-svn: 332023
2018-05-10 19:13:14 +00:00
Julie Hockett
4a43843532
Revert "[tools] Updating PPCallbacks::InclusionDirective calls"
...
This reverts commit r331905, since it's dependent on reverted r331905.
llvm-svn: 331931
2018-05-09 22:25:43 +00:00
Julie Hockett
4e548fe06f
[tools] Updating PPCallbacks::InclusionDirective calls
...
[revision] added SrcMgr::CharacteristicKind to the InclusionDirective
callback, this revision updates instances of it in clang-tools-extra.
Differential Revision: https://reviews.llvm.org/D46615
llvm-svn: 331905
2018-05-09 18:27:37 +00:00
Faisal Vali
a8e84625d8
[NFC] Sync function call with changes to interface made in r314593.
...
llvm-svn: 314595
2017-09-30 14:36:00 +00:00
Faisal Vali
cb8e01acd0
[NFC] Update function call names as changed in MacroInfo that should refer to Parameters (as opposed to Arguments).
...
This syncs them up with clang commit r308190
Thanks!
llvm-svn: 308191
2017-07-17 17:20:57 +00:00
Piotr Padlewski
08124b110a
modernize-use-auto NFC fixes
...
llvm-svn: 289656
2016-12-14 15:29:23 +00:00
Matthias Braun
48c8426fa2
Fix build problem by lower SmallSet<N> to a reasonable value
...
llvm-svn: 259424
2016-02-01 22:18:58 +00:00
David Blaikie
e04a3da093
Revert "Apply modernize-use-default to clang-tools-extra."
...
Breaks the build in GCC 4.7.2 (see
http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3 for example)
This reverts commit r250824.
llvm-svn: 250862
2015-10-20 21:45:52 +00:00
Angel Garcia Gomez
3ca34bc870
Apply modernize-use-default to clang-tools-extra.
...
Summary: Replace empty bodies of default constructors and destructors with '= default'.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13889
llvm-svn: 250824
2015-10-20 12:56:27 +00:00
Daniel Marjamaki
89ec723468
Refactor MacroInfo so range for loops can be used to iterate its tokens.
...
Differential Revision: http://reviews.llvm.org/D9079
llvm-svn: 236976
2015-05-11 08:26:25 +00:00
John Thompson
fcf3f47d7a
Fixed infinite recursion bug.
...
llvm-svn: 236624
2015-05-06 18:39:15 +00:00
Richard Smith
33de8566f0
Update to match clang r236404.
...
llvm-svn: 236405
2015-05-04 03:15:55 +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
b70ecf6eef
Fixed canonical path function.
...
llvm-svn: 230665
2015-02-26 19:31:10 +00:00
John Thompson
b87fd7db7c
Temporary hack to avoid false errors. Real fix comming.
...
llvm-svn: 229690
2015-02-18 16:12:26 +00:00
John Thompson
9ea81b0041
Fix broken logic for include in block check.
...
llvm-svn: 229187
2015-02-13 23:32:08 +00:00
John Thompson
f1828ef3c6
Fixed incorrect header inclusion tracking resulting in false error reports.
...
llvm-svn: 228929
2015-02-12 15:26:17 +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
9724431c77
Centralize canonical path conversion.
...
llvm-svn: 228845
2015-02-11 16:45:50 +00:00
David Blaikie
34318816e8
Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept.
...
llvm-svn: 222336
2014-11-19 07:49:54 +00:00
Craig Topper
775862a277
Unique_ptrify PPCallbacks ownership. Goes with clang r217474.
...
llvm-svn: 217475
2014-09-10 05:07:57 +00:00
David Blaikie
92fc741998
Unbreak the build after r211244.
...
These operator overloads were unneeded (once the const correctness in
PooledStringPtr was corrected) and inefficient (since the strings are
pooled the pointers can just be compared for equality instead of doing
strcmp).
llvm-svn: 211245
2014-06-19 00:43:19 +00:00
Craig Topper
f61be9c971
[C++11] Use 'nullptr'.
...
llvm-svn: 210447
2014-06-09 02:03:06 +00:00
Chandler Carruth
85e6e87171
Run llvm/utils/sort_includes.py over the Clang tools code. This doesn't
...
always produce as pretty of results as it does in LLVM and Clang, but
I don't mind and the value of having a single canonical ordering is very
high IMO.
Let me know if you spot really serious problems here.
llvm-svn: 198703
2014-01-07 20:05:01 +00:00
John Thompson
87f9fef5a5
Changed ConditionValue argument to PPCallbacks If and Elif callbacks to be a 3-state enum.
...
llvm-svn: 196648
2013-12-07 08:41:15 +00:00
John Thompson
a2b66875d3
Added colon to make proper error message prefix.
...
llvm-svn: 191092
2013-09-20 14:44:20 +00:00
John Thompson
740839260b
Check for #include in extern and namespace blocks.
...
llvm-svn: 190950
2013-09-18 18:19:43 +00:00
John Thompson
cc2e291dac
Ran clang-format for a base-line.
...
llvm-svn: 189836
2013-09-03 18:44:11 +00:00
John Thompson
c8d710cc82
Avoid errors on header guards using #if defined(NAME).
...
llvm-svn: 188306
2013-08-13 18:11:36 +00:00
John Thompson
91555bde88
Fix false error message for function-style macro instance used as arguments in other function-style macros instances, and add test for it.
...
llvm-svn: 188036
2013-08-09 00:22:20 +00:00
John Thompson
4ed963a0ba
Fixed incorrect header guard/nested header mechanism.
...
llvm-svn: 187898
2013-08-07 18:49:47 +00:00
John Thompson
48df096c3f
Fixed uninitialized member, plus recommit of 187736.
...
llvm-svn: 187757
2013-08-05 23:55:14 +00:00
Arnold Schwaighofer
30448e607e
Reverting r187736. It broke some public bots:
...
http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/10248
http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/3327
llvm-svn: 187746
2013-08-05 22:03:41 +00:00
John Thompson
ea8e668516
Fixed incorrect include file exit detection. Added work-around to avoid error on header guard in nested include. Fixed a couple of coding standard issues on variable names.
...
llvm-svn: 187736
2013-08-05 19:15:50 +00:00
John Thompson
7c6e79f395
Fixed comment issues (non-ASCII chars, typos) per review, expanded some comments.
...
llvm-svn: 187370
2013-07-29 19:07:00 +00:00
Benjamin Kramer
f25768103a
modularize: Remove default case from fully covered switch.
...
llvm-svn: 187306
2013-07-27 15:57:46 +00:00
John Thompson
94faa4d0d4
Fixed case change that caused the test failure. Incorporarated Sean's review changes, consisting only of renaming and comment changes.
...
llvm-svn: 187277
2013-07-26 23:56:42 +00:00
Rafael Espindola
17b15cfbe3
Revert "Added new feature for checking macro and preprocessor conditional consistency."
...
This reverts commit r187228. It broke some bots:
http://bb.pgr.jp/builders/cmake-clang-i686-mingw32
llvm-svn: 187235
2013-07-26 19:23:33 +00:00
John Thompson
1e0101461e
Added new feature for checking macro and preprocessor conditional consistency.
...
llvm-svn: 187228
2013-07-26 18:16:22 +00:00