Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Re-branch stable from swift-5.1-branch #2

Merged
merged 687 commits into from Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
687 commits
Select commit Hold shift + click to select a range
c7e755b
[clangd] When replying, log the method name and latency.
sam-mccall Oct 24, 2018
c0ba182
[clangd] Do not query index for new name completions.
kadircet Oct 24, 2018
7849336
[clang-tidy] Add the abseil-duration-factory-float check
JonasToth Oct 24, 2018
708dcc9
Fix MSVC "truncation from 'double' to 'float'" warnings. NFCI.
RKSimon Oct 24, 2018
76b4861
[clant-tidy] abseil: Add clangTooling to CMakeLists.txt
aheejin Oct 24, 2018
c6fa81d
[clang-query] Re-word command help
steveire Oct 24, 2018
07a590c
[clang-query] Add 'detailed-ast' output as an alias for 'dump'
steveire Oct 24, 2018
00131bd
[clang-query] Refactor Output settings to booleans
steveire Oct 24, 2018
c084439
Fix test to work on Windows.
dyung Oct 25, 2018
266e46e
[clangd] Don't invalidate LSP-set compile commands when closing a file.
sam-mccall Oct 25, 2018
5525549
[clangd] Fix -compile-commands-dir flag, broken in r345031
sam-mccall Oct 25, 2018
ace65d0
[clangd] Remove unused CDB function. NFC
sam-mccall Oct 25, 2018
ba5611a
[clangd] Clean up LSP structs around configuration. NFC, no protocol …
sam-mccall Oct 25, 2018
3a48eb2
[clangd] workspace/symbol should be async, it reads from the index.
sam-mccall Oct 25, 2018
3065f23
[clang-tidy] Revert my readability-uppercase-literal-suffix check.
LebedevRI Oct 25, 2018
5b6cb97
[clang-tidy] Re-commit: Add new 'readability-uppercase-literal-suffix…
LebedevRI Oct 26, 2018
9ce7d24
[clang-doc] Switch to default to all-TUs executor
Oct 26, 2018
ff8ea9d
[AST] Refactor PredefinedExpr
riccibruno Oct 27, 2018
1eaa452
[clang-query] Add non-exclusive output API
steveire Oct 29, 2018
feb7bee
[clangd] Use thread pool for background indexing.
kadircet Oct 30, 2018
900e9f7
[clang-tidy] cppcoreguidelines-macro-usage: print macro names
LebedevRI Oct 30, 2018
12613d1
NFC: Remove the ObjC1/ObjC2 distinction from clang (and related proje…
epilk Oct 30, 2018
6759879
[clangd] fix non linux build
devnexen Oct 31, 2018
d2b6aff
[clang-tidy] Remove false decoupling in ClangTidyContext. NFC
sam-mccall Oct 31, 2018
7319efb
Delete dependency on config.h
kadircet Oct 31, 2018
5e3a603
[clang-tidy] new check 'readability-isolate-declaration'
JonasToth Oct 31, 2018
1088142
[clang-tools-extra] fix broken link in release notes
JonasToth Oct 31, 2018
cac2dbd
[clang-tidy] add -fexceptions to failing unit-test, unbreak buildbot
JonasToth Oct 31, 2018
764c358
[clang-tidy] add missing '--' in RUN-line, unbreak buildbot
JonasToth Oct 31, 2018
a1e6c81
Implement the readability-const-return-type check.
AaronBallman Oct 31, 2018
dcfce65
Removing a reliance on system headers from this test; NFC.
AaronBallman Oct 31, 2018
b943573
Fix the issue that not recognizing single acronym with prefix as ObjC…
ynzhang0509 Nov 1, 2018
5f4fc4a
Fix clang -Wimplicit-fallthrough warnings across llvm, NFC
rnk Nov 1, 2018
ce3f2f3
Fix -Wimplicit-fallthrough warning in LLVM_ENABLE_ASSERTIONS=Off builds
MaskRay Nov 2, 2018
40f715c
[clangd] Fix clang -Wimplicit-fallthrough
MaskRay Nov 2, 2018
b73aa89
[clangd] Really fix clang -Wimplicit-fallthrough
MaskRay Nov 2, 2018
ac8e6e2
[clang-tidy] Get ClangTidyContext out of the business of storing diag…
sam-mccall Nov 2, 2018
a1536e8
[clangd] Only log ignored diagnostics with -log=verbose.
sam-mccall Nov 2, 2018
60b7c87
[clangd] Remove didOpen extraFlags extension.
sam-mccall Nov 2, 2018
f6dc8c7
[clangd] Make in-memory CDB always available as an overlay, refactor.
sam-mccall Nov 2, 2018
c77c2eb
Reapply Logging: make os_log buffer size an integer constant expression.
TNorthover Nov 2, 2018
13455cb
[clangd] Add fallbackFlags initialization extension.
sam-mccall Nov 2, 2018
b8f4c53
[clang-tidy] .reset(new X) -> make_unique<X>() in a comment. NFC
alexfh Nov 2, 2018
872b360
[clang-tidy] Fixed code sample in a comment. NFC
alexfh Nov 2, 2018
f5a1984
[fix][clang-tidy] fix for r345961 that introduced a test failure on W…
JonasToth Nov 2, 2018
e936bbd
[clangd] don't buffer the input-mirror stream, it's used to diagnose …
sam-mccall Nov 2, 2018
f88282a
[clang-tidy] doc removew hitespace in front of code-block-line
JonasToth Nov 5, 2018
391f75d
[clang-tidy] fix example code-blocks indendation
JonasToth Nov 5, 2018
acb9a8d
[clang-tidy] run() doesn't update the SourceManager.
sam-mccall Nov 6, 2018
15eea4e
[clangd] auto-index stores symbols per-file instead of per-TU.
Nov 6, 2018
c6b29be
[clangd] Get rid of QueryScopes.empty() == AnyScope special case.
Nov 6, 2018
651e297
[clangd] Deduplicate query scopes.
Nov 6, 2018
89e045e
[clangd] [NFC] Fix clang-tidy warnings.
kadircet Nov 7, 2018
7799ba8
[clangd] Fix mainfile filtering for diagnostics: don't emit diagnosti…
sam-mccall Nov 7, 2018
0528d46
[clangd] Drop namespace references in the index.
hokein Nov 7, 2018
de7076e
[clang-tidy] fix test after r346414
sam-mccall Nov 8, 2018
69f3a50
[clang-tidy] Untangle layering in ClangTidyDiagnosticConsumer somewha…
sam-mccall Nov 8, 2018
a021bd5
Ignore implicit things like ConstantExpr.
isanbard Nov 9, 2018
06905a0
Remove unused c'tor.
isanbard Nov 9, 2018
8b6f9d1
[clangd] Make TestTU build with preamble, and fix the fallout.
sam-mccall Nov 9, 2018
1eee845
[clangd] Don't treat top-level decls as "local" if they are from the …
sam-mccall Nov 9, 2018
6399c1f
[clangd] Fix clang-tidy warnings.
kadircet Nov 9, 2018
5121b41
[clang-tidy] fix PR39583 - ignoring ParenCast for string-literals in …
JonasToth Nov 9, 2018
562095b
[clangd] Make ClangdFuzzer compile again.
d0k Nov 11, 2018
2edd282
[clangd] Fix compile on very old glibc
sam-mccall Nov 12, 2018
96b9e69
[clangd] Remember to serialize AnyScope in FuzzyFindRequest json.
Nov 12, 2018
6930dbb
Add a test checking clang-tidy can find libc++ on Mac
ilya-biryukov Nov 12, 2018
7fd2ae7
[clang-tidy] new check: bugprone-too-small-loop-variable
JonasToth Nov 12, 2018
ecb4f9d
[clangd] Allow symbols from AnyScope in dexp.
hokein Nov 12, 2018
31e54dc
[clangd] Don't show all refs results if -name is ambiguous in dexp.
hokein Nov 12, 2018
28724b7
[clang-tidy] fix ARM tests, because int and long have same width
JonasToth Nov 12, 2018
9852f72
Revert "Add a test checking clang-tidy can find libc++ on Mac"
JonasToth Nov 12, 2018
3ece862
[clang-tidy] Avoid C arrays check
LebedevRI Nov 14, 2018
0d933c8
[clangd] Improve code completion for ObjC methods
sam-mccall Nov 14, 2018
6ea261b
[clangd] Replace StringRef in SymbolLocation with a char pointer.
hokein Nov 14, 2018
8379563
Adding myself as the code owner for clang-query as discussed in https…
AaronBallman Nov 14, 2018
4561151
[clangd] Delete unused includes.
kadircet Nov 14, 2018
0ba473c
[Support] Teach YAMLIO about polymorphic types
scott-linder Nov 14, 2018
6dd1f24
Introduce shard storage to auto-index.
kadircet Nov 15, 2018
0a37e9c
clang-format
kadircet Nov 15, 2018
19a39b1
Address comments
kadircet Nov 15, 2018
b43c4d1
Address comments.
kadircet Nov 15, 2018
2702f97
Revert "Address comments."
kadircet Nov 15, 2018
c9f1529
Revert "Address comments"
kadircet Nov 15, 2018
3512ad4
Revert "clang-format"
kadircet Nov 15, 2018
f50e8a0
Revert "Introduce shard storage to auto-index."
kadircet Nov 15, 2018
99900c3
[clangd] Fix no results returned for global symbols in dexp
hokein Nov 15, 2018
2109f22
[clangd] global-symbol-builder => clangd-indexer
hokein Nov 15, 2018
3be64bc
[clang-tidy] Update checks to play nicely with limited traversal scop…
sam-mccall Nov 15, 2018
2d155fb
Remove myself as owner of clang-query.
pcc Nov 15, 2018
502afb1
[clang-tidy] Fix reference to -[NSError init] in AvoidNSErrorInitCheck.h
stephanemoore Nov 15, 2018
f3a7986
[clangd] Initial clang-tidy diagnostics support.
sam-mccall Nov 16, 2018
b8b23e0
Introduce shard storage to auto-index.
kadircet Nov 16, 2018
d8bbe49
[clangd] Fix a compiler warning and test crashes caused in rL347038.
hokein Nov 16, 2018
f610391
[clangd] Truncate SymbolID to 8 bytes.
hokein Nov 16, 2018
3f81e3b
[clang-tidy] Expanded a test NFC
alexfh Nov 16, 2018
97e425e
[clangd] Fix crash hovering on non-decltype trailing return
MarkZ3 Nov 17, 2018
b51f706
[clang-tidy/checks] Implement a clang-tidy check to verify Google Obj…
stephanemoore Nov 17, 2018
516cd96
Add the abseil-duration-factory-scale check.
AaronBallman Nov 18, 2018
1f1901e
[clangd] Store source file hash in IndexFile{In,Out}
kadircet Nov 19, 2018
a5de3a4
Use digest size instead of hardcoding it.
kadircet Nov 19, 2018
06a8a46
Address comments.
kadircet Nov 19, 2018
235655b
[clangd] Allow observation of changes to global CDBs.
sam-mccall Nov 20, 2018
35796d2
[clangd] Replay preamble #includes to clang-tidy checks.
sam-mccall Nov 20, 2018
75c03f0
[clang-tidy] Don't generate incorrect fixes for class constructed fro…
hokein Nov 20, 2018
70b4e54
Update EvaluateAsInt to the new syntax.
isanbard Nov 20, 2018
06845a8
[clang-tidy] Add a test for proper handling of locations in scratch s…
alexfh Nov 21, 2018
6986dc5
Revert 347366, its prerequisite 347364 got reverted.
nico Nov 21, 2018
a672918
Update call to EvaluateAsInt() to the new syntax.
isanbard Nov 21, 2018
8808550
Move the llvm lit test dependencies to clang-tools-extra.
hokein Nov 22, 2018
227e72b
[clangd] Respect task cancellation in TUScheduler.
sam-mccall Nov 22, 2018
52ff0b3
[clangd] Fix use-after-scope in unit test
d0k Nov 22, 2018
aca8011
[clangd] Cleanup: use index file instead of header in workspace symbo…
Nov 22, 2018
94caf6c
[clangd] Cleanup: stop passing around list of supported URI schemes.
Nov 22, 2018
2b6279d
[clangd] Cleanup: make diagnostics callbacks from TUScheduler non-racy
ilya-biryukov Nov 22, 2018
8ad71af
[clang-tidy] Ignore template instantiations in modernize-use-using
alexfh Nov 22, 2018
7db8ab4
[clangd] Cleanup error consumption code. NFC
ilya-biryukov Nov 22, 2018
1b21ed6
[clangd] Cleanup: make the diags callback global in TUScheduler
ilya-biryukov Nov 22, 2018
743bbc3
[clang-tidy] Ignore matches in template instantiations (cert-dcl21-cpp)
alexfh Nov 23, 2018
67ee5bc
Remove the optional dependency from libclang to clang-tidy/include-fixer
d0k Nov 23, 2018
cc3f692
[clangd] Add support for hierarchical documentSymbol
ilya-biryukov Nov 23, 2018
d9fc156
[clangd] Add 'Switch header/source' command in clangd-vscode
MarkZ3 Nov 24, 2018
2e0ee61
A bit of AST matcher cleanup, NFC.
alexfh Nov 25, 2018
56c4856
[clang-tidy] Don't generate incorrect fixes for class with deleted co…
hokein Nov 26, 2018
875e5f3
[clangd] Auto-index watches global CDB for changes.
sam-mccall Nov 26, 2018
ddc759a
[clangd] Cleanup after landing documentSymbol. NFC
ilya-biryukov Nov 26, 2018
f7f28d0
[clang-tidy] PrintStackTraceOnErrorSignal
alexfh Nov 26, 2018
c8a05bf
[clangd] Use testPath in the test.
hokein Nov 26, 2018
40aec7c
[clangd] Tune down scope boost for global scope
Nov 26, 2018
67ce8a1
[clang-tidy] No warning for auto new expression in smart check
hokein Nov 26, 2018
4947a0b
[clangd] Fix missing include from r347538 - fix windows buildbots
sam-mccall Nov 26, 2018
26a6310
[clangd] Initial implementation of expected types
ilya-biryukov Nov 26, 2018
b410337
[clangd] Collect and store expected types in the index
ilya-biryukov Nov 26, 2018
561af5f
[clangd] Add type boosting in code completion
ilya-biryukov Nov 26, 2018
61f0772
[clangd] Fix use-after-free with expected types in indexing
ilya-biryukov Nov 26, 2018
6e7fec8
[clangd] Fix compilation of IndexBenchmark
ilya-biryukov Nov 26, 2018
eeaf266
[clangd] Enable auto-index behind a flag.
sam-mccall Nov 26, 2018
895bd3c
[clang-tidy] Improving narrowing conversions
gchatelet Nov 26, 2018
b777cd8
[clangd] Do not drop diagnostics from macros
ilya-biryukov Nov 26, 2018
2c9f2cd
[clangd] NFC: Prefer `isa<>` to `dyn_cast<>` to do the checking.
movie-travel-code Nov 27, 2018
cb0512a
[clang-tidy] Minor fixes in a test
alexfh Nov 27, 2018
27011d1
[clang-tidy] Avoid inconsistent notes in readability-container-size-e…
alexfh Nov 27, 2018
4d8e8a2
[clangd] Prevent thread starvation in tests on loaded systems.
sam-mccall Nov 27, 2018
d8d21fd
Revert r347419 "Update call to EvaluateAsInt() to the new syntax."
zmodem Nov 27, 2018
c2c8539
[clangd] Put direct headers into srcs section.
kadircet Nov 27, 2018
9411f3d
[clang-tidy] Ignore bool -> single bit bitfield conversion in readabi…
pepsiman Nov 27, 2018
1ad5822
[clangd][NFC] Move SymbolID to a separate file
jkorous-apple Nov 27, 2018
acc2d67
[clangd] textDocument/SymbolInfo extension
jkorous-apple Nov 27, 2018
a0caa64
[clangd] Bump vscode-clangd v0.0.7
hokein Nov 28, 2018
aa27115
[clangd] Fix backward-compatibility - follow-up to textDocument/Symbo…
jkorous-apple Nov 28, 2018
124fa5d
[clangd] Canonicalize file path in URIForFile.
Nov 28, 2018
0ea634c
Fix a false-positive with cert-err58-cpp.
AaronBallman Nov 28, 2018
5c1c111
[clangd] Build and test IndexBenchmark in check-clangd
hokein Nov 28, 2018
1e6d36e
[clangd] Less penalty for cross-namespace completions.
Nov 28, 2018
3017acd
[clangd] Fix test broken in r347754.
Nov 28, 2018
987af0a
Re-commit r347419 "Update call to EvaluateAsInt() to the new syntax."
zmodem Nov 28, 2018
8a773d6
[clang-tidy] Added a test -export-fixes with relative paths.
ilya-biryukov Nov 28, 2018
7af5d8c
Fix false positive with lambda assignments in cert-err58-cpp.
AaronBallman Nov 28, 2018
8edf2fd
Revert "[clang-tools-extra] r347753 - [clangd] Build and test IndexBe…
ormris Nov 28, 2018
da2344e
Ensure that test clang-tidy/export-relpath.cpp works with Windows pat…
ormris Nov 28, 2018
c549c7c
[Documentation] Try to fix build failure in cppcoreguidelines-narrowi…
EugeneZelenko Nov 29, 2018
4e05736
Adding a FIXME test to document an area for improvement with the cert…
AaronBallman Nov 29, 2018
2546d8f
[clangd] Fix junk output in clangd vscode plugin
hokein Nov 30, 2018
d3aaa51
[clangd] Bump vscode-clangd v0.0.8
hokein Nov 30, 2018
15b5064
[clangd] Drop injected class name when class scope is not explicitly …
Nov 30, 2018
e9cefe5
[clangd] Penalize destructor and overloaded operators in code complet…
Nov 30, 2018
d9b42e4
[clangd] Populate include graph during static indexing action.
kadircet Nov 30, 2018
ad99c29
[clangd] Recommit the "AnyScope" changes in requests.json by rCTE3477…
MaskRay Dec 1, 2018
4131999
[clangd] Get rid of AST matchers in CodeComplete, NFC
hokein Dec 3, 2018
49dabcb
[clangd] Fix a stale comment, NFC.
hokein Dec 3, 2018
85903ea
[clangd] Avoid memory-mapping files on Windows
ilya-biryukov Dec 3, 2018
b4d91b9
[clang-tidy] Add the abseil-duration-comparison check
JonasToth Dec 3, 2018
b47d447
Revert "[clang-tidy] Add the abseil-duration-comparison check"
JonasToth Dec 3, 2018
e8a34b7
[clang-tidy] Recommit: Add the abseil-duration-comparison check
JonasToth Dec 3, 2018
a246e3c
[clang-tidy] Fix unordered_map failure with specializing std::hash<> …
JonasToth Dec 3, 2018
86a5536
Fix compilation failure on Windows.
Dec 3, 2018
22b09bd
[Documentation] Fix formatting and wrap up to 80 characters in Clang-…
EugeneZelenko Dec 3, 2018
76e273a
[clangd] Partition include graph on auto-index.
kadircet Dec 4, 2018
ea8047b
Fix "array must be initialized with a brace-enclosed initializer" bui…
RKSimon Dec 4, 2018
9feccd3
[Documentation] Make options section in Clang-tidy readability-upperc…
EugeneZelenko Dec 4, 2018
39b3c12
[clang-tidy] Ignore namespaced and C++ member functions in google-obj…
stephanemoore Dec 4, 2018
af56177
[clang-query] Continue if compilation command not found for some files
Dec 5, 2018
3cdc417
[clang-tidy/checks] Update objc-property-declaration check to allow a…
stephanemoore Dec 5, 2018
641ea49
Fix a false positive in misplaced-widening-cast
JonasToth Dec 5, 2018
6561b51
[clang-tidy] new check: bugprone-branch-clone
JonasToth Dec 5, 2018
b4f1bf5
Revert "[clang-tidy] new check: bugprone-branch-clone"
JonasToth Dec 5, 2018
f83c0fb
Fix compilation error when using clang 3.6.0
mikaelholmen Dec 5, 2018
0994503
[clangd] Dont provide locations for non-existent files.
kadircet Dec 5, 2018
239d821
Move detection of libc++ include dirs to Driver on MacOS
ilya-biryukov Dec 5, 2018
21e389c
[clangd] Fix a typo in TUSchedulerTests
hokein Dec 6, 2018
87792d0
[clangd] C++ API for emitting file status.
hokein Dec 6, 2018
aa28490
[clangd] Update the test code
hokein Dec 6, 2018
23aa1f1
[clangd] Remove the test that sometimes deadlocks
ilya-biryukov Dec 6, 2018
7d024cb
[clang-tidy] Remove duplicated getText implementation, NFC
hokein Dec 7, 2018
f6a55bb
[clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'
EricWF Dec 7, 2018
3a9ded1
[Documentation] Alphabetical order in new checks list.
EugeneZelenko Dec 8, 2018
48f63c6
[clang-tidy] insert release notes for new checkers alphabetically
JonasToth Dec 10, 2018
24b0e4b
[clang-tidy] NFC Consolidate test absl::Time implementation
JonasToth Dec 11, 2018
6aaac2b
Use the standard Duration factory matcher
JonasToth Dec 11, 2018
8aa1347
Add explicit dependency on clangSerialization after rC348911
MaskRay Dec 12, 2018
08f8d5f
[clangd] Move the utility function to anonymous namespace, NFC.
hokein Dec 13, 2018
b4e642d
[clangd] Avoid emitting Queued status when we are able to acquire the…
hokein Dec 13, 2018
0a478cf
[clangd] Refine the way of checking a declaration is referenced by th…
hokein Dec 13, 2018
64eaa96
[clang-tidy] Share the forced linking code between clang-tidy tool an…
Dec 13, 2018
7b6c293
[clangd] Enable cross-namespace completions by default in clangd
Dec 13, 2018
f1ffba4
[clang-tidy] Add the abseil-duration-subtraction check
Dec 13, 2018
4305a66
Revert "[clang-tidy] Share the forced linking code between clang-tidy…
dyung Dec 14, 2018
7c239aa
[clang-tidy] Improve google-objc-function-naming diagnostics 📙
stephanemoore Dec 14, 2018
f938bef
[clang-tidy] Share the forced linking code between clang-tidy tool an…
Dec 14, 2018
e9bc78a
[clang-tidy] Remove extra config.h includes
Dec 14, 2018
05df5fd
[clangd] Fix an assertion failure in background index.
hokein Dec 14, 2018
4646207
[clangd] Fix memory leak in ClangdTests.
hokein Dec 14, 2018
3d616e6
[clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.
hokein Dec 14, 2018
925f752
clang-include-fixer.el: support remote files
phst Dec 14, 2018
9337f43
[dexp] Change FuzzyFind to also print scope of symbols
kadircet Dec 14, 2018
cb4ad67
Fix a lit test failure after MallocChecker changes
Szelethus Dec 16, 2018
d2d42ed
Revert rCTE349288 'Fix a lit test failure after MallocChecker changes'
Szelethus Dec 17, 2018
de9aee8
[clangd] Only reduce priority of a thread for indexing.
kadircet Dec 17, 2018
436a2b5
[clangd] Change diskbackedstorage to be atomic
kadircet Dec 17, 2018
5fd9cab
[clangd] BackgroundIndex rebuilds symbol index periodically.
Dec 18, 2018
db53734
[clangd] Try to fix buildbot failure after r349496
Dec 18, 2018
8dd66f6
[clangd] Unify path canonicalizations in the codebase
kadircet Dec 19, 2018
5be6872
[clang-tidy] use "const SourceManager&" parameter, NFC.
hokein Dec 19, 2018
c7df958
[clangd] Fix a syntax error on the test.
hokein Dec 19, 2018
1812d85
[clang-tidy] Diagnose abseil-duration-comparison on macro arguments
Dec 19, 2018
1790729
[clangd] Don't miss the expected type in merge.
hokein Dec 20, 2018
b038329
[clang-tidy] Use translationUnitDecl() instead of a custom matcher.
alexfh Dec 20, 2018
83f2668
[clangd] Expose FileStatus to LSP.
hokein Dec 20, 2018
81168f0
[clangd] Try to workaround test failure by increasing the timeouts
ilya-biryukov Dec 20, 2018
476c372
Fix warning about unused variable [NFC]
bjope Dec 21, 2018
7e0e3b6
[clangd] Cleanup syntax errors in the test, NFC.
hokein Dec 21, 2018
716a505
[clang-tidy] Add export-fixes flag to clang-tidy-diff
Dec 21, 2018
6de6d14
[clang-tidy] Be more liberal about literal zeroes in abseil checks
Dec 21, 2018
e6cf90b
[clangd] Delete trailing ; NFC
MaskRay Dec 23, 2018
6ec2e23
[clangd] Delete stray semicolon. NFC
MaskRay Dec 24, 2018
2b26798
[clang-tidy] add IgnoreMacros option to readability-uppercase-literal…
vmiklos Dec 24, 2018
93a546b
[clang-tidy] Export the abseil duration inverse lookup function, NFC
Dec 28, 2018
0a33493
[clangd] Show FileStatus in vscode-clangd.
hokein Jan 2, 2019
682acfc
[Documentation] Alphabetical order in Clang-tidy checks changes list.
EugeneZelenko Jan 2, 2019
74a4acf
[clangd] clang-format everything. NFC
ilya-biryukov Jan 3, 2019
a059ba7
[clangd] Check preceding char when completion triggers on ':' or '>'
ilya-biryukov Jan 3, 2019
e2eae94
[clangd] Always try to build absolute path
kadircet Jan 3, 2019
a205b13
[clangd] Bump vscode-clangd v0.0.9
hokein Jan 3, 2019
f4ed9de
[clangd] Move helpers from global namespace into anonymous namespace,…
hokein Jan 3, 2019
74aa5bb
[clangd] Fix detecting atomics in stand-alone builds
mgorny Jan 3, 2019
87060f8
Fix the CMake build for clang-apply-replacements
hyp Feb 8, 2019
3a1ab8b
Fix a lit test failure after D54438
Szelethus Jan 26, 2019
09ae963
Fix clang-tidy test after r350714. NFC
ilya-biryukov Jan 9, 2019
41d80a9
[clang-tidy] Mention language version in test explicitly.
vsapsai Feb 14, 2019
938c752
Re-branch stable from swift-5.1-branch
shahmishal Feb 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions CMakeLists.txt
@@ -1,10 +1,8 @@
add_subdirectory(clang-apply-replacements)
add_subdirectory(clang-reorder-fields)
add_subdirectory(modularize)
if(CLANG_ENABLE_STATIC_ANALYZER)
add_subdirectory(clang-tidy)
add_subdirectory(clang-tidy-vs)
endif()

add_subdirectory(change-namespace)
add_subdirectory(clang-doc)
Expand Down
4 changes: 2 additions & 2 deletions CODE_OWNERS.TXT
Expand Up @@ -8,8 +8,8 @@ beautification by scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
(S).

N: Peter Collingbourne
E: peter@pcc.me.uk
N: Aaron Ballman
E: aaron@aaronballman.com
D: clang-query

N: Manuel Klimek
Expand Down
1 change: 1 addition & 0 deletions change-namespace/CMakeLists.txt
Expand Up @@ -12,6 +12,7 @@ add_clang_library(clangChangeNamespace
clangFormat
clangFrontend
clangLex
clangSerialization
clangTooling
clangToolingCore
)
Expand Down
86 changes: 57 additions & 29 deletions change-namespace/ChangeNamespace.cpp
Expand Up @@ -7,8 +7,10 @@
//
//===----------------------------------------------------------------------===//
#include "ChangeNamespace.h"
#include "clang/AST/ASTContext.h"
#include "clang/Format/Format.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"

using namespace clang::ast_matchers;
Expand Down Expand Up @@ -46,7 +48,7 @@ SourceLocation startLocationForType(TypeLoc TLoc) {
return NestedNameSpecifier.getBeginLoc();
TLoc = TLoc.getNextTypeLoc();
}
return TLoc.getLocStart();
return TLoc.getBeginLoc();
}

SourceLocation endLocationForType(TypeLoc TLoc) {
Expand Down Expand Up @@ -275,31 +277,56 @@ bool isNestedDeclContext(const DeclContext *D, const DeclContext *Context) {
// Returns true if \p D is visible at \p Loc with DeclContext \p DeclCtx.
bool isDeclVisibleAtLocation(const SourceManager &SM, const Decl *D,
const DeclContext *DeclCtx, SourceLocation Loc) {
SourceLocation DeclLoc = SM.getSpellingLoc(D->getLocStart());
SourceLocation DeclLoc = SM.getSpellingLoc(D->getBeginLoc());
Loc = SM.getSpellingLoc(Loc);
return SM.isBeforeInTranslationUnit(DeclLoc, Loc) &&
(SM.getFileID(DeclLoc) == SM.getFileID(Loc) &&
isNestedDeclContext(DeclCtx, D->getDeclContext()));
}

// Given a qualified symbol name, returns true if the symbol will be
// incorrectly qualified without leading "::".
bool conflictInNamespace(llvm::StringRef QualifiedSymbol,
// incorrectly qualified without leading "::". For example, a symbol
// "nx::ny::Foo" in namespace "na::nx::ny" without leading "::"; a symbol
// "util::X" in namespace "na" can potentially conflict with "na::util" (if this
// exists).
bool conflictInNamespace(const ASTContext &AST, llvm::StringRef QualifiedSymbol,
llvm::StringRef Namespace) {
auto SymbolSplitted = splitSymbolName(QualifiedSymbol.trim(":"));
assert(!SymbolSplitted.empty());
SymbolSplitted.pop_back(); // We are only interested in namespaces.

if (SymbolSplitted.size() > 1 && !Namespace.empty()) {
if (SymbolSplitted.size() >= 1 && !Namespace.empty()) {
auto SymbolTopNs = SymbolSplitted.front();
auto NsSplitted = splitSymbolName(Namespace.trim(":"));
assert(!NsSplitted.empty());
// We do not check the outermost namespace since it would not be a conflict
// if it equals to the symbol's outermost namespace and the symbol name
// would have been shortened.

auto LookupDecl = [&AST](const Decl &Scope,
llvm::StringRef Name) -> const NamedDecl * {
const auto *DC = llvm::dyn_cast<DeclContext>(&Scope);
if (!DC)
return nullptr;
auto LookupRes = DC->lookup(DeclarationName(&AST.Idents.get(Name)));
if (LookupRes.empty())
return nullptr;
return LookupRes.front();
};
// We do not check the outermost namespace since it would not be a
// conflict if it equals to the symbol's outermost namespace and the
// symbol name would have been shortened.
const NamedDecl *Scope =
LookupDecl(*AST.getTranslationUnitDecl(), NsSplitted.front());
for (auto I = NsSplitted.begin() + 1, E = NsSplitted.end(); I != E; ++I) {
if (*I == SymbolSplitted.front())
if (*I == SymbolTopNs) // Handles "::ny" in "::nx::ny" case.
return true;
// Handles "::util" and "::nx::util" conflicts.
if (Scope) {
if (LookupDecl(*Scope, SymbolTopNs))
return true;
Scope = LookupDecl(*Scope, *I);
}
}
if (Scope && LookupDecl(*Scope, SymbolTopNs))
return true;
}
return false;
}
Expand Down Expand Up @@ -423,8 +450,8 @@ void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
typeLoc(IsInMovedNs,
loc(qualType(hasDeclaration(DeclMatcher.bind("from_decl")))),
unless(anyOf(hasParent(typeLoc(loc(qualType(
allOf(hasDeclaration(DeclMatcher),
unless(templateSpecializationType())))))),
hasDeclaration(DeclMatcher),
unless(templateSpecializationType()))))),
hasParent(nestedNameSpecifierLoc()),
hasAncestor(isImplicit()),
hasAncestor(UsingShadowDeclInClass),
Expand Down Expand Up @@ -478,13 +505,12 @@ void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
hasAncestor(namespaceDecl(isAnonymous())),
hasAncestor(cxxRecordDecl()))),
hasParent(namespaceDecl()));
Finder->addMatcher(
expr(allOf(hasAncestor(decl().bind("dc")), IsInMovedNs,
unless(hasAncestor(isImplicit())),
anyOf(callExpr(callee(FuncMatcher)).bind("call"),
declRefExpr(to(FuncMatcher.bind("func_decl")))
.bind("func_ref")))),
this);
Finder->addMatcher(expr(hasAncestor(decl().bind("dc")), IsInMovedNs,
unless(hasAncestor(isImplicit())),
anyOf(callExpr(callee(FuncMatcher)).bind("call"),
declRefExpr(to(FuncMatcher.bind("func_decl")))
.bind("func_ref"))),
this);

auto GlobalVarMatcher = varDecl(
hasGlobalStorage(), hasParent(namespaceDecl()),
Expand Down Expand Up @@ -634,7 +660,7 @@ static SourceLocation getLocAfterNamespaceLBrace(const NamespaceDecl *NsDecl,
const SourceManager &SM,
const LangOptions &LangOpts) {
std::unique_ptr<Lexer> Lex =
getLexerStartingFromLoc(NsDecl->getLocStart(), SM, LangOpts);
getLexerStartingFromLoc(NsDecl->getBeginLoc(), SM, LangOpts);
assert(Lex.get() &&
"Failed to create lexer from the beginning of namespace.");
if (!Lex.get())
Expand Down Expand Up @@ -709,8 +735,8 @@ void ChangeNamespaceTool::moveOldNamespace(
void ChangeNamespaceTool::moveClassForwardDeclaration(
const ast_matchers::MatchFinder::MatchResult &Result,
const NamedDecl *FwdDecl) {
SourceLocation Start = FwdDecl->getLocStart();
SourceLocation End = FwdDecl->getLocEnd();
SourceLocation Start = FwdDecl->getBeginLoc();
SourceLocation End = FwdDecl->getEndLoc();
const SourceManager &SM = *Result.SourceManager;
SourceLocation AfterSemi = Lexer::findLocationAfterToken(
End, tok::semi, SM, Result.Context->getLangOpts(),
Expand Down Expand Up @@ -844,15 +870,16 @@ void ChangeNamespaceTool::replaceQualifiedSymbolInDeclContext(
}
}
}
bool Conflict = conflictInNamespace(DeclCtx->getParentASTContext(),
ReplaceName, NewNamespace);
// If the new nested name in the new namespace is the same as it was in the
// old namespace, we don't create replacement.
if (NestedName == ReplaceName ||
// old namespace, we don't create replacement unless there can be ambiguity.
if ((NestedName == ReplaceName && !Conflict) ||
(NestedName.startswith("::") && NestedName.drop_front(2) == ReplaceName))
return;
// If the reference need to be fully-qualified, add a leading "::" unless
// NewNamespace is the global namespace.
if (ReplaceName == FromDeclName && !NewNamespace.empty() &&
conflictInNamespace(ReplaceName, NewNamespace))
if (ReplaceName == FromDeclName && !NewNamespace.empty() && Conflict)
ReplaceName = "::" + ReplaceName;
addReplacementOrDie(Start, End, ReplaceName, *Result.SourceManager,
&FileToReplacements);
Expand All @@ -879,7 +906,7 @@ void ChangeNamespaceTool::fixTypeLoc(
if (!llvm::StringRef(D->getQualifiedNameAsString())
.startswith(OldNamespace + "::"))
return false;
auto ExpansionLoc = Result.SourceManager->getExpansionLoc(D->getLocStart());
auto ExpansionLoc = Result.SourceManager->getExpansionLoc(D->getBeginLoc());
if (ExpansionLoc.isInvalid())
return false;
llvm::StringRef Filename = Result.SourceManager->getFilename(ExpansionLoc);
Expand Down Expand Up @@ -910,8 +937,8 @@ void ChangeNamespaceTool::fixTypeLoc(
void ChangeNamespaceTool::fixUsingShadowDecl(
const ast_matchers::MatchFinder::MatchResult &Result,
const UsingDecl *UsingDeclaration) {
SourceLocation Start = UsingDeclaration->getLocStart();
SourceLocation End = UsingDeclaration->getLocEnd();
SourceLocation Start = UsingDeclaration->getBeginLoc();
SourceLocation End = UsingDeclaration->getEndLoc();
if (Start.isInvalid() || End.isInvalid())
return;

Expand Down Expand Up @@ -989,7 +1016,8 @@ void ChangeNamespaceTool::onEndOfTranslationUnit() {
// Add replacements referring to the changed code to existing replacements,
// which refers to the original code.
Replaces = Replaces.merge(NewReplacements);
auto Style = format::getStyle("file", FilePath, FallbackStyle);
auto Style =
format::getStyle(format::DefaultFormatStyle, FilePath, FallbackStyle);
if (!Style) {
llvm::errs() << llvm::toString(Style.takeError()) << "\n";
continue;
Expand Down
1 change: 1 addition & 0 deletions change-namespace/tool/CMakeLists.txt
Expand Up @@ -16,6 +16,7 @@ target_link_libraries(clang-change-namespace
clangFormat
clangFrontend
clangRewrite
clangSerialization
clangTooling
clangToolingCore
)
Expand Down
4 changes: 2 additions & 2 deletions clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
Expand Up @@ -97,8 +97,8 @@ int main(int argc, char **argv) {
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts.get());

// Determine a formatting style from options.
auto FormatStyleOrError =
format::getStyle(FormatStyleOpt, FormatStyleConfig, "LLVM");
auto FormatStyleOrError = format::getStyle(FormatStyleOpt, FormatStyleConfig,
format::DefaultFallbackStyle);
if (!FormatStyleOrError) {
llvm::errs() << llvm::toString(FormatStyleOrError.takeError()) << "\n";
return 1;
Expand Down