- Dec 05, 2017
-
-
Shoaib Meenai authored
We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 08, 2017
-
-
Haojian Wu authored
Summary: Prototype of a new rename rule for renaming qualified symbol. Reviewers: arphaman, ioeric, sammccall Reviewed By: arphaman, sammccall Subscribers: jklaehn, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39332 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317672 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 07, 2017
-
-
Eric Liu authored
Summary: This is a refactoring change. NFC Reviewers: arphaman, hokein Reviewed By: arphaman, hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317577 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 25, 2017
-
-
Petr Hosek authored
This allows including clang-refactor in LLVM_DISTRIBUTION_COMPONENTS to build clang-refactor as part of the toolchain distribution. Differential Revision: https://reviews.llvm.org/D39266 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316540 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 24, 2017
-
-
Alex Lorenz authored
This commit adds an initial, skeleton outline of the "extract function" refactoring. The extracted function doesn't capture variables / rewrite code yet, it just basically does a simple copy-paste. The following initiation rules are specified: - extraction can only be done for executable code in a function/method/block. This means that you can't extract a global variable initialize into a function right now. - simple literals and references are not extractable. This commit also adds support for full source ranges to clang-refactor's test mode. Differential Revision: https://reviews.llvm.org/D38982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316465 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 20, 2017
-
-
Haojian Wu authored
Summary: Change clang-refactor default behavior to print the new code after refactoring (instead of editing the source files), which would make it easier to use and debug the refactoring action. Reviewers: arphaman, ioeric Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39092 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316212 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 16, 2017
-
-
Alex Lorenz authored
This commit allows the refactoring library to use its own set of refactoring-specific diagnostics to reports things like initiation errors. Differential Revision: https://reviews.llvm.org/D38772 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315924 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
As suggested by David Blaikie! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315923 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
The fixed commit ensures that ParsedSourceRange works correctly with Windows paths. Original message: This commit actually brings clang-refactor to a usable state as it can now apply the refactoring changes to source files. The -selection option is now also fully supported. Differential Revision: https://reviews.llvm.org/D38402 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315918 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 14, 2017
-
-
Alex Lorenz authored
The ParsedSourceRange class does not work correctly on Windows with the ':' drive separators git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315774 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 13, 2017
-
-
Alex Lorenz authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315755 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
This commit actually brings clang-refactor to a usable state as it can now apply the refactoring changes to source files. The -selection option is now also fully supported. Differential Revision: https://reviews.llvm.org/D38402 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315738 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
The recommit fixes a UB bug that occurred only on a small number of bots. Original message: This commit adds initial support for refactoring options. One can now use optional and required std::string options. This commit also adds a NewNameOption for the local-rename refactoring action to allow rename to work with custom names. Differential Revision: https://reviews.llvm.org/D37856 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315661 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 10, 2017
-
-
Haojian Wu authored
NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315290 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 06, 2017
-
-
Alex Lorenz authored
clang-refactor crashes on some bots after this commit git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315095 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
This commit adds initial support for refactoring options. One can now use optional and required std::string options. This commit also adds a NewNameOption for the local-rename refactoring action to allow rename to work with custom names. Differential Revision: https://reviews.llvm.org/D37856 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315087 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 14, 2017
-
-
Alex Lorenz authored
This commit ensures that CommonOptionsParser works with subcommands. This allows clang-refactor to use the CommonOptionsParser. Differential Revision: https://reviews.llvm.org/D37618 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313260 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
This is an attempt to fix http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage after r313244. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313252 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
This is an attempt to fix http://bb.pgr.jp/builders/clang-i686-linux-RA/ after r313244. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313249 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
local-rename action This commit introduces the clang-refactor tool alongside the local-rename action which uses the existing renaming engine used by clang-rename. The tool doesn't actually perform the source transformations yet, it just provides testing support. This commit also moves only one test from clang-rename over to test/Refactor. I will continue to move the other tests throughout development of clang-refactor. The following options are supported by clang-refactor: -v: use verbose output -selection: The source range that corresponds to the portion of the source that's selected (currently only special command test:<file> is supported). Please note that a follow-up commit will migrate clang-refactor to libTooling's common option parser, so clang-refactor will be able to use the common interface with compilation database and options like -p, -extra-arg, etc. The testing support provided by clang-refactor is described below: When -selection=test:<file> is given, clang-refactor will parse the selection commands from that file. The selection commands are grouped and the specified refactoring action invoked by the tool. Each command in a group is expected to produce an identical result. The precise syntax for the selection commands is described in a comment in TestSupport.h. Differential Revision: https://reviews.llvm.org/D36574 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313244 91177308-0d34-0410-b5e6-96231b3b80d8
-