The output directories for CMake's Xcode project generator are
specific to the configuration, and so looking in
CMAKE_LIBRARY_OUTPUT_DIRECTORY isn't going to work. Fortunately, CMake
already provides generator expressions to find the output of a given
target.
I call this "barely" building because the built framework isn't going
to respect the configuration; that is, I can't have both Debug and
RelWithDebInfo variants of ClangdXPC.framework at the same time like I
can with normal library or executable targets. To do that we'd have to
put the framework in a configuration-specific output directory or use
CMake's native support for frameworks instead.
https://reviews.llvm.org/D68846
llvm-svn: 374494
Summary:
The Transformer library has been growing inside of
lib/Tooling/Refactoring. However, it's not really related to anything else in
that directory. This revision moves all Transformer-related files into their own
include & lib directories. A followup revision will (temporarily) add
forwarding headers to help any users migrate their code to the new location.
Reviewers: gribozavr
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68637
llvm-svn: 374271
Summary:
After rL374163, replycallbacks might have a cancellable context, which
will try to access RequestCancellers on destruction. See
http://45.33.8.238/mac/1245/step_7.txt for a sample failure.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits, thakis
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68702
llvm-svn: 374168
In MS compatibility mode, "extern inline void g()" is not a redundant
declaration for "inline void g()", because of redeclForcesDefMSVC()
(see PR19264, r205485).
To fix, run the test with -fms-compatiblity forced on and off
and explicit check for the differing behavior for extern inline.
Final bit of PR43593.
Differential Revision: https://reviews.llvm.org/D68640
llvm-svn: 374103
Summary:
This fixes cases like:
foo.h
class Undocumented{}
bar.h
// break an include cycle. we should refactor this!
class Undocumented;
Where the comment doesn't describe the class.
Note that a forward decl that is *visible to the definition* will still have
its doc comment used, by SymbolCollector: Merge isn't involved here.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68467
llvm-svn: 373892
Use clang_target_link_libraries() in order to support linking against
libclang-cpp instead of static libraries.
Differential Revision: https://reviews.llvm.org/D68448
llvm-svn: 373786
Summary:
This fixes a regression that led to size() not being available in clangd
when completing 'deque().^' and using libc++.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68335
llvm-svn: 373710
Replace add_clang_executable() calls with add_clang_tool() that takes
care of creating correct, distribution-friendly install target. While
at it, remove redundant install calls.
This change also causes clang-move and pp-trace to be installed.
Differential Revision: https://reviews.llvm.org/D68423
llvm-svn: 373694
This checks finds all primitive type local variables (integers, doubles, pointers) that are declared without an initial value. Includes fixit functionality to initialize said variables with a default value. This is zero for most types and NaN for floating point types. The use of NaNs is copied from the D programming language.
Patch by Jussi Pakkanen.
llvm-svn: 373489
Summary:
This patch disable extraction of the body of the enclosing function.
`void f() [[{}]]`
Extracting this CompoundStmt would leave the enclosing function without
a body.
Reviewers: sammccall, kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68245
llvm-svn: 373472
Summary:
We weren't always checking if children are RootStmts in ExtractFunction.
For `void f([[int a]]);`, the ParmVarDecl appeared as a RootStmt since
we didn't perform the check and ended up being casted to a (null) Stmt.
Reviewers: sammccall, kadircet
Subscribers: kristof.beyls, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68182
llvm-svn: 373471
Summary:
This would reduce the false positive when the static index is in an
unavailable state, e.g. background index is not finished.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68325
llvm-svn: 373444
Summary:
Previously they would be marked as partially-selected based on the early claim,
and never updated as no more tokens were claimed.
This affects simple VarDecls like "int x".
Reviewers: SureYeaah
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66872
llvm-svn: 373442
Summary:
Editors only know about file URIs, make sure we do not use any custom
schemes while sending edits.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68324
llvm-svn: 373435
The patch committed was not the accepted version but the
previous one. This commit fixes this issue.
Differential Revision: https://reviews.llvm.org/D64736
llvm-svn: 373428
Summary:
OSSpinLock* are Apple/Darwin functions, but were previously located with ObjC checks as those were most closely tied to Apple platforms before.
Now that there's a specific Darwin module, relocating the check there.
This change was prepared by running rename_check.py.
Contributed By: mwyman
Reviewers: stephanemoore, dmaclach
Reviewed By: stephanemoore
Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang, #llvm
Differential Revision: https://reviews.llvm.org/D68148
llvm-svn: 373392
Summary:
This will fix some bugs where navigation doesn't work on cases like
`std::cout <^< "hello"`.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67695
llvm-svn: 373323
Summary:
If the file heuristic fails, we try to use the index&AST to do the
header/source inference.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68211
llvm-svn: 373320
Summary: When creating the module, must have copy-pasted from the misc module, and forgotten to update the name/description of the module in the registry.
Reviewers: stephanemoore, benhamilton, gribozavr
Reviewed By: gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang, #clang-tools-extra, #llvm
Differential Revision: https://reviews.llvm.org/D68251
llvm-svn: 373304
Summary:
This patch implements another version header-source switch by incorporating the
AST and index, it will be used:
- to improve the current header-source switch feature (layer with the
existing file heuristic);
- by the incoming define-outline code action;
Reviewers: kadircet
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67907
llvm-svn: 373197
Instead, put all checks in a cmake variable and reference this.
Also, make clangd use the the ClangTidyForceLinker.h header instead
of duplicating the list of modules -- the duplicate copy was missing
the new "darwin" checker added in r373065.
Differential Revision: https://reviews.llvm.org/D68132
llvm-svn: 373082
Summary:
Creates a new darwin ClangTidy module and adds the darwin-dispatch-once-nonstatic check that warns about dispatch_once_t variables not in static or global storage. This catches a missing static for local variables in e.g. singleton initialization behavior, and also warns on storing dispatch_once_t values in Objective-C instance variables. C/C++ struct/class instances may potentially live in static/global storage, and are ignored for this check.
The osx.API static analysis checker can find the non-static storage use of dispatch_once_t; I thought it useful to also catch this issue in clang-tidy when possible.
This is a re-land of https://reviews.llvm.org/D67567
Reviewers: thakis, gribozavr, stephanemoore
Subscribers: Eugene.Zelenko, mgorny, xazax.hun, jkorous, arphaman, kadircet, usaxena95
Tags: #clang-tools-extra, #clang, #llvm
Differential Revision: https://reviews.llvm.org/D68109
llvm-svn: 373065
Summary:
Creates a new darwin ClangTidy module and adds the darwin-dispatch-once-nonstatic check that warns about dispatch_once_t variables not in static or global storage. This catches a missing static for local variables in e.g. singleton initialization behavior, and also warns on storing dispatch_once_t values in Objective-C instance variables. C/C++ struct/class instances may potentially live in static/global storage, and are ignored for this check.
The osx.API static analysis checker can find the non-static storage use of dispatch_once_t; I thought it useful to also catch this issue in clang-tidy when possible.
Contributed By: mwyman
Reviewers: benhamilton, hokein, stephanemoore, aaron.ballman, gribozavr
Reviewed By: stephanemoore, gribozavr
Subscribers: jkorous, arphaman, kadircet, usaxena95, NoQ, xazax.hun, lebedev.ri, mgorny, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D67567
llvm-svn: 373028
Summary:
We have turned on the flag manually and used it for a while, and don't see any
major issues, let's enable it by default.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68077
llvm-svn: 372969
Summary:
To be used by define-inline code action to determine whether the
function/method body will still be valid in another context.
Traverses clang-ast to find all decl nodes under the function decl and stores
the non-local ones.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67748
llvm-svn: 372948