llvm.org GIT mirror llvm / d0bc1fe
[gn build] Add build files for bugpoint-passes and LLVMHello plugins These two plugins are loaded into a host process that contains all LLVM symbols, so they don't link against anything. This required minor readjustments to the tablegen() setup of IR. Needed for check-llvm. Differential Revision: https://reviews.llvm.org/D56204 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350234 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 9 months ago
5 changed file(s) with 70 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
4545 deps += [
4646 "//clang/tools/clang-check",
4747 "//clang/tools/clang-func-mapping",
48 ]
49 }
50 if (host_os != "win") {
51 # loadable_modules don't work on Windows.
52 # FIXME: In the CMake build, ENABLE_SHARED makes them work somehow
53 # (but they're off by default there too).
54 deps += [
55 "//llvm/lib/Transforms/Hello",
56 "//llvm/tools/bugpoint-passes",
4857 ]
4958 }
5059 testonly = true
0 import("//llvm/utils/TableGen/tablegen.gni")
11
22 tablegen("IntrinsicEnums") {
3 visibility = [ "//llvm/lib/IR" ]
3 visibility = [ ":public_tablegen" ]
44 args = [ "-gen-intrinsic-enums" ]
55 td_file = "Intrinsics.td"
66 }
1212 }
1313
1414 tablegen("Attributes") {
15 visibility = [ "//llvm/lib/IR" ]
15 visibility = [ ":public_tablegen" ]
1616 args = [ "-gen-attrs" ]
1717 }
18
19 # Groups all tablegen() calls that create .inc files that are included in
20 # IR's public headers. //llvm/lib/Target has this as a public_dep, so targets
21 # dependign on //llvm/lib/IR don't need to depend on this. This exists
22 # solely for targets that use IR's public headers but don't link against IR.
23 group("public_tablegen") {
24 public_deps = [
25 # IR's public headers include Attributes.inc.
26 ":Attributes",
27
28 # IR's public headers include IntrinsicEnums.inc.
29 ":IntrinsicEnums",
30 ]
31 }
99 public_deps = [
1010 # Must be public_dep because IR's public headers include llvm-config.h.
1111 "//llvm/include/llvm/Config:llvm-config",
12
13 # Must be public_dep because IR's public headers include Attributes.inc.
14 "//llvm/include/llvm/IR:Attributes",
15
16 # Must be public_dep because IR's public headers include IntrinsicEnums.inc.
17 "//llvm/include/llvm/IR:IntrinsicEnums",
12 "//llvm/include/llvm/IR:public_tablegen",
1813 ]
1914 deps = [
2015 ":AttributesCompatFunc",
0 assert(host_os != "win", "loadable modules not supported on win")
1
2 loadable_module("Hello") {
3 output_name = "LLVMHello"
4 deps = [
5 # LLVMHello doesn't want to link in any LLVM code, it just
6 # needs its headers.
7 "//llvm/include/llvm/IR:public_tablegen",
8 ]
9 sources = [
10 "Hello.cpp",
11 ]
12
13 if (host_os == "linux") {
14 # The GN build currently doesn't globally pass -fPIC, but that's
15 # needed for building .so files on Linux. Just pass it manually
16 # for loadable_modules for now.
17 cflags = [ "-fPIC" ]
18 }
19
20 # FIXME: Use Hello.exports to remove all exports.
21 }
0 assert(host_os != "win", "loadable modules not supported on win")
1
2 loadable_module("bugpoint-passes") {
3 output_name = "BugpointPasses"
4 deps = [
5 # BugpointPasses doesn't want to link in any LLVM code, it just
6 # needs its headers.
7 "//llvm/include/llvm/IR:public_tablegen",
8 ]
9 sources = [
10 "TestPasses.cpp",
11 ]
12
13 if (host_os == "linux") {
14 # The GN build currently doesn't globally pass -fPIC, but that's
15 # needed for building .so files on Linux. Just pass it manually
16 # for loadable_modules for now.
17 cflags = [ "-fPIC" ]
18 }
19
20 # FIXME: Use bugpoint.exports to remove all exports.
21 }