[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)
Andrzej WarzyĆski via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 16 09:11:35 PDT 2024
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/95708
>From d75a05030447e8bcb1dd0b575ff5e7aa5c89f0bb Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Sun, 16 Jun 2024 13:58:41 +0100
Subject: [PATCH 1/3] [llvm] Remove the Legacy PM Hello example
The Legacy PM was deprecated for the optimization pipeline in LLVM 14
[1] (the support was removed altogether in the following release). This
patch removes the original Hello example that was introduced to
illustrate the Legacy PM. The Hello example no longer works and hence is
deleted. The corresponding documentation is also removed.
Note, Hello example for new PM is located in
* llvm/lib/Transforms/Utils/HelloWorld.cpp
and documented in
* WritingAnLLVMNewPMPass.rst.
[1] https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html#changes-to-the-llvm-ir
---
llvm/lib/Transforms/CMakeLists.txt | 1 -
llvm/lib/Transforms/Hello/CMakeLists.txt | 20 --------
llvm/lib/Transforms/Hello/Hello.cpp | 64 ------------------------
llvm/lib/Transforms/Hello/Hello.exports | 0
4 files changed, 85 deletions(-)
delete mode 100644 llvm/lib/Transforms/Hello/CMakeLists.txt
delete mode 100644 llvm/lib/Transforms/Hello/Hello.cpp
delete mode 100644 llvm/lib/Transforms/Hello/Hello.exports
diff --git a/llvm/lib/Transforms/CMakeLists.txt b/llvm/lib/Transforms/CMakeLists.txt
index 84a7e34147d08..7046f2f4b1d2c 100644
--- a/llvm/lib/Transforms/CMakeLists.txt
+++ b/llvm/lib/Transforms/CMakeLists.txt
@@ -5,7 +5,6 @@ add_subdirectory(InstCombine)
add_subdirectory(Scalar)
add_subdirectory(IPO)
add_subdirectory(Vectorize)
-add_subdirectory(Hello)
add_subdirectory(ObjCARC)
add_subdirectory(Coroutines)
add_subdirectory(CFGuard)
diff --git a/llvm/lib/Transforms/Hello/CMakeLists.txt b/llvm/lib/Transforms/Hello/CMakeLists.txt
deleted file mode 100644
index 9510c31f633fe..0000000000000
--- a/llvm/lib/Transforms/Hello/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# If we don't need RTTI or EH, there's no reason to export anything
-# from the hello plugin.
-if( NOT LLVM_REQUIRES_RTTI )
- if( NOT LLVM_REQUIRES_EH )
- set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Hello.exports)
- endif()
-endif()
-
-if(WIN32 OR CYGWIN OR ZOS)
- set(LLVM_LINK_COMPONENTS Core Support)
-endif()
-
-add_llvm_library( LLVMHello MODULE BUILDTREE_ONLY
- Hello.cpp
-
- DEPENDS
- intrinsics_gen
- PLUGIN_TOOL
- opt
- )
diff --git a/llvm/lib/Transforms/Hello/Hello.cpp b/llvm/lib/Transforms/Hello/Hello.cpp
deleted file mode 100644
index b0adb5401f891..0000000000000
--- a/llvm/lib/Transforms/Hello/Hello.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//===- Hello.cpp - Example code from "Writing an LLVM Pass" ---------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements two versions of the LLVM "Hello World" pass described
-// in docs/WritingAnLLVMPass.html
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/Statistic.h"
-#include "llvm/IR/Function.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace llvm;
-
-#define DEBUG_TYPE "hello"
-
-STATISTIC(HelloCounter, "Counts number of functions greeted");
-
-namespace {
- // Hello - The first implementation, without getAnalysisUsage.
- struct Hello : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- Hello() : FunctionPass(ID) {}
-
- bool runOnFunction(Function &F) override {
- ++HelloCounter;
- errs() << "Hello: ";
- errs().write_escaped(F.getName()) << '\n';
- return false;
- }
- };
-}
-
-char Hello::ID = 0;
-static RegisterPass<Hello> X("hello", "Hello World Pass");
-
-namespace {
- // Hello2 - The second implementation with getAnalysisUsage implemented.
- struct Hello2 : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- Hello2() : FunctionPass(ID) {}
-
- bool runOnFunction(Function &F) override {
- ++HelloCounter;
- errs() << "Hello: ";
- errs().write_escaped(F.getName()) << '\n';
- return false;
- }
-
- // We don't modify the program, so we preserve all analyses.
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesAll();
- }
- };
-}
-
-char Hello2::ID = 0;
-static RegisterPass<Hello2>
-Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
diff --git a/llvm/lib/Transforms/Hello/Hello.exports b/llvm/lib/Transforms/Hello/Hello.exports
deleted file mode 100644
index e69de29bb2d1d..0000000000000
>From bed0a86befc6f6b88a28a0eec53499e02b8bddad Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Sun, 16 Jun 2024 17:10:37 +0100
Subject: [PATCH 2/3] fixup! [llvm] Remove the Legacy PM Hello example
Add missing changes in LLVM
---
llvm/docs/WritingAnLLVMPass.rst | 422 +++-----------------------------
llvm/test/CMakeLists.txt | 1 -
2 files changed, 28 insertions(+), 395 deletions(-)
diff --git a/llvm/docs/WritingAnLLVMPass.rst b/llvm/docs/WritingAnLLVMPass.rst
index a3602e7fbc31f..2b5809827f757 100644
--- a/llvm/docs/WritingAnLLVMPass.rst
+++ b/llvm/docs/WritingAnLLVMPass.rst
@@ -37,290 +37,14 @@ passes. One of the main features of the LLVM Pass Framework is that it
schedules passes to run in an efficient way based on the constraints that your
pass meets (which are indicated by which class they derive from).
-We start by showing you how to construct a pass, everything from setting up the
-code, to compiling, loading, and executing it. After the basics are down, more
-advanced features are discussed.
-
-Quick Start --- Writing hello world
-===================================
-
-Here we describe how to write the "hello world" of passes. The "Hello" pass is
-designed to simply print out the name of non-external functions that exist in
-the program being compiled. It does not modify the program at all, it just
-inspects it. The source code and files for this pass are available in the LLVM
-source tree in the ``lib/Transforms/Hello`` directory.
-
-.. _writing-an-llvm-pass-makefile:
-
-Setting up the build environment
---------------------------------
-
-First, configure and build LLVM. Next, you need to create a new directory
-somewhere in the LLVM source base. For this example, we'll assume that you
-made ``lib/Transforms/Hello``. Finally, you must set up a build script
-that will compile the source code for the new pass. To do this,
-copy the following into ``CMakeLists.txt``:
-
-.. code-block:: cmake
-
- add_llvm_library( LLVMHello MODULE
- Hello.cpp
-
- PLUGIN_TOOL
- opt
- )
-
-and the following line into ``lib/Transforms/CMakeLists.txt``:
-
-.. code-block:: cmake
-
- add_subdirectory(Hello)
-
-(Note that there is already a directory named ``Hello`` with a sample "Hello"
-pass; you may play with it -- in which case you don't need to modify any
-``CMakeLists.txt`` files -- or, if you want to create everything from scratch,
-use another name.)
-
-This build script specifies that ``Hello.cpp`` file in the current directory
-is to be compiled and linked into a shared object ``$(LEVEL)/lib/LLVMHello.so`` that
-can be dynamically loaded by the :program:`opt` tool via its :option:`-load`
-option. If your operating system uses a suffix other than ``.so`` (such as
-Windows or macOS), the appropriate extension will be used.
-
-Now that we have the build scripts set up, we just need to write the code for
-the pass itself.
-
-.. _writing-an-llvm-pass-basiccode:
-
-Basic code required
--------------------
-
-Now that we have a way to compile our new pass, we just have to write it.
-Start out with:
-
-.. code-block:: c++
-
- #include "llvm/Pass.h"
- #include "llvm/IR/Function.h"
- #include "llvm/Support/raw_ostream.h"
-
-Which are needed because we are writing a `Pass
-<https://llvm.org/doxygen/classllvm_1_1Pass.html>`_, we are operating on
-`Function <https://llvm.org/doxygen/classllvm_1_1Function.html>`_\ s, and we will
-be doing some printing.
-
-Next we have:
-
-.. code-block:: c++
-
- using namespace llvm;
-
-... which is required because the functions from the include files live in the
-llvm namespace.
-
-Next we have:
-
-.. code-block:: c++
-
- namespace {
-
-... which starts out an anonymous namespace. Anonymous namespaces are to C++
-what the "``static``" keyword is to C (at global scope). It makes the things
-declared inside of the anonymous namespace visible only to the current file.
-If you're not familiar with them, consult a decent C++ book for more
-information.
-
-Next, we declare our pass itself:
-
-.. code-block:: c++
-
- struct Hello : public FunctionPass {
-
-This declares a "``Hello``" class that is a subclass of :ref:`FunctionPass
-<writing-an-llvm-pass-FunctionPass>`. The different builtin pass subclasses
-are described in detail :ref:`later <writing-an-llvm-pass-pass-classes>`, but
-for now, know that ``FunctionPass`` operates on a function at a time.
-
-.. code-block:: c++
-
- static char ID;
- Hello() : FunctionPass(ID) {}
-
-This declares pass identifier used by LLVM to identify pass. This allows LLVM
-to avoid using expensive C++ runtime information.
-
-.. code-block:: c++
-
- bool runOnFunction(Function &F) override {
- errs() << "Hello: ";
- errs().write_escaped(F.getName()) << '\n';
- return false;
- }
- }; // end of struct Hello
- } // end of anonymous namespace
-
-We declare a :ref:`runOnFunction <writing-an-llvm-pass-runOnFunction>` method,
-which overrides an abstract virtual method inherited from :ref:`FunctionPass
-<writing-an-llvm-pass-FunctionPass>`. This is where we are supposed to do our
-thing, so we just print out our message with the name of each function.
-
-.. code-block:: c++
-
- char Hello::ID = 0;
-
-We initialize pass ID here. LLVM uses ID's address to identify a pass, so
-initialization value is not important.
-
-.. code-block:: c++
-
- static RegisterPass<Hello> X("hello", "Hello World Pass",
- false /* Only looks at CFG */,
- false /* Analysis Pass */);
-
-Lastly, we :ref:`register our class <writing-an-llvm-pass-registration>`
-``Hello``, giving it a command line argument "``hello``", and a name "Hello
-World Pass". The last two arguments describe its behavior: if a pass walks CFG
-without modifying it then the third argument is set to ``true``; if a pass is
-an analysis pass, for example dominator tree pass, then ``true`` is supplied as
-the fourth argument.
-
-As a whole, the ``.cpp`` file looks like:
-
-.. code-block:: c++
-
- #include "llvm/Pass.h"
- #include "llvm/IR/Function.h"
- #include "llvm/Support/raw_ostream.h"
-
- #include "llvm/IR/LegacyPassManager.h"
-
- using namespace llvm;
-
- namespace {
- struct Hello : public FunctionPass {
- static char ID;
- Hello() : FunctionPass(ID) {}
-
- bool runOnFunction(Function &F) override {
- errs() << "Hello: ";
- errs().write_escaped(F.getName()) << '\n';
- return false;
- }
- }; // end of struct Hello
- } // end of anonymous namespace
-
- char Hello::ID = 0;
- static RegisterPass<Hello> X("hello", "Hello World Pass",
- false /* Only looks at CFG */,
- false /* Analysis Pass */);
-
-Now that it's all together, compile the file with a simple "``gmake``" command
-from the top level of your build directory and you should get a new file
-"``lib/LLVMHello.so``". Note that everything in this file is
-contained in an anonymous namespace --- this reflects the fact that passes
-are self contained units that do not need external interfaces (although they
-can have them) to be useful.
-
-Running a pass with ``opt``
----------------------------
-
-.. warning::
- This document deals with the legacy pass manager. The :program:`opt` tool no
- longer supports running legacy passes (except for certain hardcoded backend
- passes and when using bugpoint). So the examples below for loading and
- running legacy passes using :program:`opt` are deprecated and no longer
- guaranteed to work.
-
-Now that you have a brand new shiny shared object file, we can use the
-:program:`opt` command to run an LLVM program through your pass. Because you
-registered your pass with ``RegisterPass``, you will be able to use the
-:program:`opt` tool to access it, once loaded.
-
-To test it, follow the example at the end of the :doc:`GettingStarted` to
-compile "Hello World" to LLVM. We can now run the bitcode file (hello.bc) for
-the program through our transformation like this (or course, any bitcode file
-will work):
-
-.. code-block:: console
-
- $ opt -load lib/LLVMHello.so -hello < hello.bc > /dev/null
- Hello: __main
- Hello: puts
- Hello: main
-
-The :option:`-load` option specifies that :program:`opt` should load your pass
-as a shared object, which makes "``-hello``" a valid command line argument
-(which is one reason you need to :ref:`register your pass
-<writing-an-llvm-pass-registration>`). Because the Hello pass does not modify
-the program in any interesting way, we just throw away the result of
-:program:`opt` (sending it to ``/dev/null``).
-
-To see what happened to the other string you registered, try running
-:program:`opt` with the :option:`-help` option:
-
-.. code-block:: console
-
- $ opt -load lib/LLVMHello.so -help
- OVERVIEW: llvm .bc -> .bc modular optimizer and analysis printer
-
- USAGE: opt [subcommand] [options] <input bitcode file>
-
- OPTIONS:
- Optimizations available:
- ...
- -guard-widening - Widen guards
- -gvn - Global Value Numbering
- -gvn-hoist - Early GVN Hoisting of Expressions
- -hello - Hello World Pass
- -indvars - Induction Variable Simplification
- -inferattrs - Infer set function attributes
- ...
-
-The pass name gets added as the information string for your pass, giving some
-documentation to users of :program:`opt`. Now that you have a working pass,
-you would go ahead and make it do the cool transformations you want. Once you
-get it all working and tested, it may become useful to find out how fast your
-pass is. The :ref:`PassManager <writing-an-llvm-pass-passmanager>` provides a
-nice command line option (:option:`-time-passes`) that allows you to get
-information about the execution time of your pass along with the other passes
-you queue up. For example:
-
-.. code-block:: console
-
- $ opt -load lib/LLVMHello.so -hello -time-passes < hello.bc > /dev/null
- Hello: __main
- Hello: puts
- Hello: main
- ===-------------------------------------------------------------------------===
- ... Pass execution timing report ...
- ===-------------------------------------------------------------------------===
- Total Execution Time: 0.0007 seconds (0.0005 wall clock)
-
- ---User Time--- --User+System-- ---Wall Time--- --- Name ---
- 0.0004 ( 55.3%) 0.0004 ( 55.3%) 0.0004 ( 75.7%) Bitcode Writer
- 0.0003 ( 44.7%) 0.0003 ( 44.7%) 0.0001 ( 13.6%) Hello World Pass
- 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0001 ( 10.7%) Module Verifier
- 0.0007 (100.0%) 0.0007 (100.0%) 0.0005 (100.0%) Total
-
-As you can see, our implementation above is pretty fast. The additional
-passes listed are automatically inserted by the :program:`opt` tool to verify
-that the LLVM emitted by your pass is still valid and well formed LLVM, which
-hasn't been broken somehow.
-
-Now that you have seen the basics of the mechanics behind passes, we can talk
-about some more details of how they work and how to use them.
-
.. _writing-an-llvm-pass-pass-classes:
Pass classes and requirements
=============================
One of the first things that you should do when designing a new pass is to
-decide what class you should subclass for your pass. The :ref:`Hello World
-<writing-an-llvm-pass-basiccode>` example uses the :ref:`FunctionPass
-<writing-an-llvm-pass-FunctionPass>` class for its implementation, but we did
-not discuss why or when this should occur. Here we talk about the classes
-available, from the most general to the most specific.
+decide what class you should subclass for your pass. Here we talk about the
+classes available, from the most general to the most specific.
When choosing a superclass for your ``Pass``, you should choose the **most
specific** class possible, while still being able to meet the requirements
@@ -471,11 +195,10 @@ To be explicit, ``FunctionPass`` subclasses are not allowed to:
#. Maintain state across invocations of :ref:`runOnFunction
<writing-an-llvm-pass-runOnFunction>` (including global data).
-Implementing a ``FunctionPass`` is usually straightforward (See the :ref:`Hello
-World <writing-an-llvm-pass-basiccode>` pass for example).
-``FunctionPass``\ es may override three virtual methods to do their work. All
-of these methods should return ``true`` if they modified the program, or
-``false`` if they didn't.
+Implementing a ``FunctionPass`` is usually straightforward. ``FunctionPass``\
+es may override three virtual methods to do their work. All of these methods
+should return ``true`` if they modified the program, or ``false`` if they
+didn't.
.. _writing-an-llvm-pass-doInitialization-mod:
@@ -691,17 +414,11 @@ may not modify the LLVM ``Function`` or its contents from a
Pass registration
-----------------
-In the :ref:`Hello World <writing-an-llvm-pass-basiccode>` example pass we
-illustrated how pass registration works, and discussed some of the reasons that
-it is used and what it does. Here we discuss how and why passes are
-registered.
-
-As we saw above, passes are registered with the ``RegisterPass`` template. The
-template parameter is the name of the pass that is to be used on the command
-line to specify that the pass should be added to a program (for example, with
-:program:`opt` or :program:`bugpoint`). The first argument is the name of the
-pass, which is to be used for the :option:`-help` output of programs, as well
-as for debug output generated by the `--debug-pass` option.
+Passes are registered with the ``RegisterPass`` template. The template
+parameter is the name of the pass that is to be used on the command line to
+specify that the pass should be added to a program. The first argument is the
+name of the pass, which is to be used for the :option:`-help` output of
+programs, as well as for debug output generated by the `--debug-pass` option.
If you want your pass to be easily dumpable, you should implement the virtual
print method:
@@ -1040,113 +757,30 @@ The ``PassManager`` class exposes a ``--debug-pass`` command line options that
is useful for debugging pass execution, seeing how things work, and diagnosing
when you should be preserving more analyses than you currently are. (To get
information about all of the variants of the ``--debug-pass`` option, just type
-"``opt -help-hidden``").
-
-By using the --debug-pass=Structure option, for example, we can see how our
-:ref:`Hello World <writing-an-llvm-pass-basiccode>` pass interacts with other
-passes. Lets try it out with the gvn and licm passes:
-
-.. code-block:: console
-
- $ opt -load lib/LLVMHello.so -gvn -licm --debug-pass=Structure < hello.bc > /dev/null
- ModulePass Manager
- FunctionPass Manager
- Dominator Tree Construction
- Basic Alias Analysis (stateless AA impl)
- Function Alias Analysis Results
- Memory Dependence Analysis
- Global Value Numbering
- Natural Loop Information
- Canonicalize natural loops
- Loop-Closed SSA Form Pass
- Basic Alias Analysis (stateless AA impl)
- Function Alias Analysis Results
- Scalar Evolution Analysis
- Loop Pass Manager
- Loop Invariant Code Motion
- Module Verifier
- Bitcode Writer
-
-This output shows us when passes are constructed.
-Here we see that GVN uses dominator tree information to do its job. The LICM pass
-uses natural loop information, which uses dominator tree as well.
-
-After the LICM pass, the module verifier runs (which is automatically added by
-the :program:`opt` tool), which uses the dominator tree to check that the
-resultant LLVM code is well formed. Note that the dominator tree is computed
-once, and shared by three passes.
-
-Lets see how this changes when we run the :ref:`Hello World
-<writing-an-llvm-pass-basiccode>` pass in between the two passes:
-
-.. code-block:: console
-
- $ opt -load lib/LLVMHello.so -gvn -hello -licm --debug-pass=Structure < hello.bc > /dev/null
- ModulePass Manager
- FunctionPass Manager
- Dominator Tree Construction
- Basic Alias Analysis (stateless AA impl)
- Function Alias Analysis Results
- Memory Dependence Analysis
- Global Value Numbering
- Hello World Pass
- Dominator Tree Construction
- Natural Loop Information
- Canonicalize natural loops
- Loop-Closed SSA Form Pass
- Basic Alias Analysis (stateless AA impl)
- Function Alias Analysis Results
- Scalar Evolution Analysis
- Loop Pass Manager
- Loop Invariant Code Motion
- Module Verifier
- Bitcode Writer
- Hello: __main
- Hello: puts
- Hello: main
-
-Here we see that the :ref:`Hello World <writing-an-llvm-pass-basiccode>` pass
-has killed the Dominator Tree pass, even though it doesn't modify the code at
-all! To fix this, we need to add the following :ref:`getAnalysisUsage
-<writing-an-llvm-pass-getAnalysisUsage>` method to our pass:
-
-.. code-block:: c++
-
- // We don't modify the program, so we preserve all analyses
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesAll();
- }
+"``llc -help-hidden``").
-Now when we run our pass, we get this output:
+By using the --debug-pass=Structure option, for example, we can see inspect the
+default optimization pipelines, e.g. (the output has been trimmed):
.. code-block:: console
- $ opt -load lib/LLVMHello.so -gvn -hello -licm --debug-pass=Structure < hello.bc > /dev/null
- Pass Arguments: -gvn -hello -licm
+ $ llc -mtriple=arm64-- -O3 -debug-pass=Structure file.ll > /dev/null
+ (...)
ModulePass Manager
+ Pre-ISel Intrinsic Lowering
+ FunctionPass Manager
+ Expand large div/rem
+ Expand large fp convert
+ Expand Atomic instructions
+ SVE intrinsics optimizations
FunctionPass Manager
Dominator Tree Construction
- Basic Alias Analysis (stateless AA impl)
- Function Alias Analysis Results
- Memory Dependence Analysis
- Global Value Numbering
- Hello World Pass
- Natural Loop Information
- Canonicalize natural loops
- Loop-Closed SSA Form Pass
- Basic Alias Analysis (stateless AA impl)
- Function Alias Analysis Results
- Scalar Evolution Analysis
- Loop Pass Manager
- Loop Invariant Code Motion
- Module Verifier
- Bitcode Writer
- Hello: __main
- Hello: puts
- Hello: main
-
-Which shows that we don't accidentally invalidate dominator information
-anymore, and therefore do not have to compute it twice.
+ FunctionPass Manager
+ Simplify the CFG
+ Dominator Tree Construction
+ Natural Loop Information
+ Canonicalize natural loops
+ (...)
.. _writing-an-llvm-pass-releaseMemory:
diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt
index 2f466c258f677..6b7f2b58e603e 100644
--- a/llvm/test/CMakeLists.txt
+++ b/llvm/test/CMakeLists.txt
@@ -59,7 +59,6 @@ configure_lit_site_cfg(
set(LLVM_TEST_DEPENDS
BugpointPasses
FileCheck
- LLVMHello
LLVMWindowsDriver
UnitTests
bugpoint
>From be455c370c82bca503835b67ae80a9eb6914f229 Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Sun, 16 Jun 2024 17:11:07 +0100
Subject: [PATCH 3/3] fixup! fixup! [llvm] Remove the Legacy PM Hello example
Add changes in clang-tools-extra
---
clang-tools-extra/test/CMakeLists.txt | 11 +----------
.../test/clang-tidy/CTTestTidyModule.cpp | 2 +-
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt
index 50546f62259ca..0953ff2531e1a 100644
--- a/clang-tools-extra/test/CMakeLists.txt
+++ b/clang-tools-extra/test/CMakeLists.txt
@@ -74,17 +74,8 @@ if (NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB)
PLUGIN_TOOL clang-tidy)
endif()
-if(CLANG_BUILT_STANDALONE)
- # LLVMHello library is needed below
- if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello
- AND NOT TARGET LLVMHello)
- add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello
- lib/Transforms/Hello)
- endif()
-endif()
-
if(TARGET CTTestTidyModule)
- list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
+ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)
target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
set(LLVM_LINK_COMPONENTS
diff --git a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp
index c66a94f458cf5..19ea46d9b3ded 100644
--- a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp
+++ b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp
@@ -1,5 +1,5 @@
// REQUIRES: plugins
-// RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext -load %llvmshlibdir/LLVMHello%pluginext | FileCheck --check-prefix=CHECK-LIST %s
+// RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext | FileCheck --check-prefix=CHECK-LIST %s
// CHECK-LIST: Enabled checks:
// CHECK-LIST-NEXT: mytest1
// CHECK-LIST-NEXT: mytest2
More information about the cfe-commits
mailing list