From 524fdc13a97c82084f1043e98c258cfafa45a097 Mon Sep 17 00:00:00 2001 From: Jake Ehrlich Date: Tue, 2 Jul 2019 18:04:24 +0000 Subject: [PATCH] Reland "[llvm] Add initial scaffolding" This is a reland of b71d2d99965e7f283cb153f96a9f9b2bb2d3197d Original change's description: > [llvm] Add initial scaffolding > > This change adds the gclient and GN changes needed to build > an executable using LLVM in the Dart tree as well as a basic > testing framework based on llvm-lit. > > Change-Id: I9009a98ff95043cc3754966f31697ba7f1712310 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106434 > Commit-Queue: Jake Ehrlich > Reviewed-by: Alexander Thomas > Reviewed-by: Vyacheslav Egorov Change-Id: Ib3cd3299ed463133616c666285f9a58fa387b5bd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107829 Reviewed-by: Vyacheslav Egorov Commit-Queue: Jake Ehrlich --- .gitignore | 6 + BUILD.gn | 19 + DEPS | 23 + runtime/bin/BUILD.gn | 5 + runtime/llvm_codegen/bit/BUILD.gn | 31 + runtime/llvm_codegen/bit/bit.h | 76 + runtime/llvm_codegen/bit/main.cc | 122 ++ runtime/llvm_codegen/bit/test.cc | 71 + runtime/llvm_codegen/codegen/BUILD.gn | 14 + runtime/llvm_codegen/codegen/main.cc | 42 + runtime/llvm_codegen/test/BUILD.gn | 10 + runtime/llvm_codegen/test/bit/BUILD.gn | 9 + .../test/bit/Inputs/basic_input.test | 1 + .../llvm_codegen/test/bit/Inputs/percent.test | 1 + runtime/llvm_codegen/test/bit/basic.test | 8 + runtime/llvm_codegen/test/bit_test.gni | 40 + runtime/llvm_codegen/test/codegen/BUILD.gn | 9 + runtime/llvm_codegen/test/codegen/basic.ll | 6 + third_party/llvm/BUILD.gn | 1576 +++++++++++++++++ 19 files changed, 2069 insertions(+) create mode 100644 runtime/llvm_codegen/bit/BUILD.gn create mode 100644 runtime/llvm_codegen/bit/bit.h create mode 100644 runtime/llvm_codegen/bit/main.cc create mode 100644 runtime/llvm_codegen/bit/test.cc create mode 100644 runtime/llvm_codegen/codegen/BUILD.gn create mode 100644 runtime/llvm_codegen/codegen/main.cc create mode 100644 runtime/llvm_codegen/test/BUILD.gn create mode 100644 runtime/llvm_codegen/test/bit/BUILD.gn create mode 100644 runtime/llvm_codegen/test/bit/Inputs/basic_input.test create mode 100644 runtime/llvm_codegen/test/bit/Inputs/percent.test create mode 100644 runtime/llvm_codegen/test/bit/basic.test create mode 100644 runtime/llvm_codegen/test/bit_test.gni create mode 100644 runtime/llvm_codegen/test/codegen/BUILD.gn create mode 100644 runtime/llvm_codegen/test/codegen/basic.ll create mode 100644 third_party/llvm/BUILD.gn diff --git a/.gitignore b/.gitignore index 0216f06f892..95fde66c990 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,11 @@ /*.vcxproj.user *.stamp +# LLVM prebuilts +/third_party/llvm/include +/third_party/llvm/lib +/third_party/llvm/.versions + # Gyp generated files *.xcodeproj *.intermediate @@ -96,3 +101,4 @@ editor/util/testing/mac/Samples.suite/Results /outline.dill /generated/ /crash_logs/ +/build/config/gclient_args.gni diff --git a/BUILD.gn b/BUILD.gn index 6d899eecadf..59c831e29fd 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -2,6 +2,7 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +import("build/config/gclient_args.gni") import("build/dart/dart_host_sdk_toolchain.gni") targetting_fuchsia = target_os == "fuchsia" @@ -15,6 +16,11 @@ group("default") { deps = [ ":runtime", ] + if (checkout_llvm) { + deps += [ + ":llvm_codegen" + ] + } } group("most") { @@ -116,6 +122,19 @@ group("analysis_server") { ] } +group("check_llvm") { + deps = [ + "runtime/llvm_codegen/test", + ] +} + +group("llvm_codegen") { + deps = [ + "runtime/llvm_codegen/codegen", + "runtime/llvm_codegen/bit", + ] +} + # This is the target that is built on the dart2js build bots. # It must depend on anything that is required by the dart2js # test suites. diff --git a/DEPS b/DEPS index f38a4bf9537..b66e06ad715 100644 --- a/DEPS +++ b/DEPS @@ -146,8 +146,20 @@ vars = { "crashpad_rev": "bf327d8ceb6a669607b0dbab5a83a275d03f99ed", "minichromium_rev": "8d641e30a8b12088649606b912c2bc4947419ccc", "googletest_rev": "f854f1d27488996dc8a6db3c9453f80b02585e12", + + # An LLVM backend needs LLVM binaries and headers. To avoid build time + # increases we can use prebuilts. We don't want to download this on every + # CQ/CI bot nor do we want the average Dart developer to incur that cost. + # So by default we will not download prebuilts. + "checkout_llvm": False, + "llvm_revision": "fe8bd96ebd6c490ea0b5c1fb342db2d7c393a109" } +gclient_gn_args_file = Var("dart_root") + '/build/config/gclient_args.gni' +gclient_gn_args = [ + 'checkout_llvm' +] + deps = { # Stuff needed for GN build. Var("dart_root") + "/buildtools/clang_format/script": @@ -404,6 +416,17 @@ deps = { ], "dep_type": "cipd", }, + + Var("dart_root") + "/third_party/llvm": { + "packages": [ + { + "package": "fuchsia/lib/llvm/${{platform}}", + "version": "git_revision:" + Var("llvm_revision"), + }, + ], + "condition": "checkout_llvm", + "dep_type": "cipd", + }, } deps_os = { diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn index f8631d74267..ea91d6dc0f1 100644 --- a/runtime/bin/BUILD.gn +++ b/runtime/bin/BUILD.gn @@ -2,6 +2,8 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. + +import("../../build/config/gclient_args.gni") import("../../build/dart/dart_action.gni") import("../runtime_args.gni") import("../vm/compiler/compiler_sources.gni") @@ -923,6 +925,9 @@ executable("run_vm_tests") { "..:libdart_nosnapshot_with_precompiler", "//third_party/zlib", ] + if (checkout_llvm) { + deps += [ "//runtime/llvm_codegen/bit:test" ] + } include_dirs = [ "..", "$target_gen_dir", diff --git a/runtime/llvm_codegen/bit/BUILD.gn b/runtime/llvm_codegen/bit/BUILD.gn new file mode 100644 index 00000000000..cb6494ea2ff --- /dev/null +++ b/runtime/llvm_codegen/bit/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +executable("bit") { + sources = [ + "main.cc", + ] + root_dir = rebase_path(root_out_dir) + defines = [ "LIT_BINARY_DIR=\"$root_dir\"" ] + deps = [ + "//third_party/llvm:LLVMSupport", + ] + data_deps = [ + "//runtime/llvm_codegen/codegen", + ] +} + +source_set("test") { + sources = [ + "test.cc", + ] + + deps = [ + "//third_party/llvm:LLVMSupport", + ] + + include_dirs = [ "//runtime" ] + + defines = [ "TESTING" ] +} diff --git a/runtime/llvm_codegen/bit/bit.h b/runtime/llvm_codegen/bit/bit.h new file mode 100644 index 00000000000..19eb5f854e7 --- /dev/null +++ b/runtime/llvm_codegen/bit/bit.h @@ -0,0 +1,76 @@ +// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +#include +#include + +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/LineIterator.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Path.h" +#include "llvm/Support/Regex.h" +#include "llvm/Support/WithColor.h" + +namespace { + +using namespace llvm; + +struct Config { + StringRef filename; + StringRef out_dir; +}; + +StringMap GetSubstitutions(const Config& config) { + // Compute all of our strings needed for substitutions. + StringRef test_dir = sys::path::parent_path(config.filename); + StringRef basename = sys::path::filename(config.filename); + SmallString<128> tmp_file; + sys::path::append(tmp_file, sys::path::Style::native, config.out_dir, + basename + ".tmp"); + SmallString<128> codegen; + sys::path::append(codegen, sys::path::Style::native, LIT_BINARY_DIR, + "codegen"); + SmallString<128> bit; + sys::path::append(bit, sys::path::Style::native, LIT_BINARY_DIR, "bit"); + + // Set up our substitutions. + StringMap subs; + subs["s"] = config.filename.str(); + subs["p"] = test_dir.str(); + subs["P"] = test_dir.str(); + subs["t"] = tmp_file.str().str(); + subs["codegen"] = codegen.str().str(); + subs["bit"] = bit.str().str(); + return subs; +} + +std::string PerformSubstitutions(const StringMap& subs, + StringRef string) { + std::string out = string.str(); + for (const auto& sub : subs) { + std::string key = (Twine("%") + sub.getKeyData()).str(); + size_t pos = 0; + while ((pos = out.find(key, pos)) != std::string::npos) { + if (pos != 0 && out[pos - 1] == '%') { + pos += key.size(); + continue; + } + out.replace(pos, key.size(), sub.getValue()); + pos += sub.second.size(); + } + } + return out; +} + +Optional GetCommand(StringRef line) { + static Regex run_line("^;[ ]*RUN:[ ]*(.*)$"); + SmallVector cmd; + if (!run_line.match(line, &cmd)) return Optional{}; + assert(cmd.size() == 2); + return cmd[1].str(); +} + +} // namespace diff --git a/runtime/llvm_codegen/bit/main.cc b/runtime/llvm_codegen/bit/main.cc new file mode 100644 index 00000000000..17a58540f8c --- /dev/null +++ b/runtime/llvm_codegen/bit/main.cc @@ -0,0 +1,122 @@ +// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +#include +#include +#include + +#include "bit.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/InitLLVM.h" +#include "llvm/Support/LineIterator.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Path.h" +#include "llvm/Support/Process.h" +#include "llvm/Support/Program.h" +#include "llvm/Support/Regex.h" +#include "llvm/Support/VirtualFileSystem.h" +#include "llvm/Support/WithColor.h" + +using namespace llvm; + +namespace { + +StringRef tool_name; + +LLVM_ATTRIBUTE_NORETURN void Fail(Twine message) { + WithColor::error(errs(), tool_name) << message << ".\n"; + errs().flush(); + exit(1); +} + +LLVM_ATTRIBUTE_NORETURN void Fail(Error e) { + assert(E); + std::string buf; + raw_string_ostream os(buf); + logAllUnhandledErrors(std::move(e), os); + os.flush(); + WithColor::error(errs(), tool_name) << buf; + exit(1); +} + +LLVM_ATTRIBUTE_NORETURN void ReportError(StringRef file, std::error_code ec) { + assert(ec); + Fail(createFileError(file, ec)); +} + +std::string ReadFile(FILE* file) { + std::string output; + constexpr size_t buf_size = 256; + char buf[buf_size]; + size_t size; + while ((size = fread(buf, buf_size, sizeof(buf[0]), file))) + output.append(buf, buf + buf_size); + return output; +} + +bool IsPosixFullyPortablePath(StringRef path) { + const char* extra = "._-/"; + for (auto c : path) + if (!isalnum(c) && !strchr(extra, c)) return false; + return true; +} + +} // namespace + +int main(int argc, char** argv) { + InitLLVM X(argc, argv); + + // Make sure we have both arguments. + tool_name = argv[0]; + if (argc != 3) Fail("expected exactly 2 arguments"); + + // Makes sure that stdin/stdout are setup correctly. + if (sys::Process::FixupStandardFileDescriptors()) + Fail("std in/out fixup failed"); + + // Set our config. + Config config; + config.filename = argv[1]; + config.out_dir = argv[2]; + + // Make sure we have valid filepaths. + if (!IsPosixFullyPortablePath(config.filename)) + Fail("'" + config.filename + "' is not a posix fully portable filename"); + if (!IsPosixFullyPortablePath(config.out_dir)) + Fail("'" + config.out_dir + "' is not a posix fully portable filename"); + + // Compute substitutions. + auto subs = GetSubstitutions(config); + + // The lines we execute are allowed to assume that %p will exist. + sys::fs::create_directory(subs["p"]); + + // Open the file for reading. + auto buf_or = vfs::getRealFileSystem()->getBufferForFile(config.filename); + if (!buf_or) ReportError(config.filename, buf_or.getError()); + auto buf = std::move(*buf_or); + + // Now iterate over the lines in the file. + line_iterator it{*buf}; + int count = 0; + for (StringRef line = *it; !it.is_at_end(); line = *++it) { + auto cmd = GetCommand(line); + if (!cmd) continue; + ++count; + auto subbed = PerformSubstitutions(subs, *cmd); + FILE* file = popen(subbed.c_str(), "r"); + std::string output = ReadFile(file); + if (pclose(file) != 0) { + errs() << output << "\n"; + Fail("Failure on line " + Twine(it.line_number()) + "\n\t" + subbed + ""); + } + } + if (count == 0) { + Fail("No commands to run"); + } + outs() << "Commands run: " << count << "\n"; + return 0; +} diff --git a/runtime/llvm_codegen/bit/test.cc b/runtime/llvm_codegen/bit/test.cc new file mode 100644 index 00000000000..7b800ffd128 --- /dev/null +++ b/runtime/llvm_codegen/bit/test.cc @@ -0,0 +1,71 @@ +// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +#include +#include + +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/LineIterator.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Path.h" +#include "llvm/Support/Regex.h" +#include "llvm/Support/WithColor.h" +#include "platform/assert.h" +#include "vm/unit_test.h" + +#define LIT_BINARY_DIR "/path/to/bins" +#include "bit.h" + +UNIT_TEST_CASE(BasicGetSubstitutions) { + Config config; + config.filename = "/foo/bar/baz.ll"; + config.out_dir = "/test/out/dir"; + + StringMap expected; + expected["s"] = "/foo/bar/baz.ll"; + expected["p"] = "/foo/bar"; + expected["P"] = "/test/out/dir"; + expected["t"] = "/test/out/dir/baz.ll.tmp"; + expected["codegen"] = "/path/to/bins/codegen"; + expected["bit"] = "/path/to/bins/bit"; + + StringMap actual = GetSubstitutions(config); + + EXPECT_EQ(actual.size(), expected.size()); + for (const auto& p : actual) + EXPECT_EQ(p.getValue(), expected[p.getKey()]); +} + +UNIT_TEST_CASE(BasicPerformSubstitutions) { + StringMap subs; + subs["foo"] = "/foo/path"; + subs["bar"] = "/bar/path"; + subs["baz"] = "/baz/path"; + std::vector> cases = { + {"%foo", "/foo/path"}, + {"%bar", "/bar/path"}, + {"%baz", "/baz/path"}, + {"this has %foo, and %bar, and %baz2", + "this has /foo/path, and /bar/path, and /baz/path2"}, + {"we don't want %this to expand", "we don't want %this to expand"}, + {"%", "%"}}; + for (const auto& test : cases) { + auto out = PerformSubstitutions(subs, test.first); + EXPECT_EQ(out, test.second); + } +} + +UNIT_TEST_CASE(BasicGetCommand) { + EXPECT(!GetCommand("; this is some test")); + EXPECT(!GetCommand("2 + 2")); + EXPECT(!GetCommand("echo $VAR > %bit")); + + EXPECT(GetCommand(";RUN: blarg") == Optional{"blarg"}); + EXPECT(GetCommand("; RUN: foo") == Optional{"blarg"}); + EXPECT( + GetCommand("; RUN: echo %bit %p/Input/$(%t2) > $(baz \"$BAR->%t\")") == + Optional("echo %bit %p/Input/$(%t2) > $(baz \"$BAR->%t\")")); +} diff --git a/runtime/llvm_codegen/codegen/BUILD.gn b/runtime/llvm_codegen/codegen/BUILD.gn new file mode 100644 index 00000000000..32249709c48 --- /dev/null +++ b/runtime/llvm_codegen/codegen/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +executable("codegen") { + sources = [ + "main.cc", + ] + + deps = [ + "//third_party/llvm:LLVMAsmPrinter", + "//third_party/llvm:LLVMIRReader", + ] +} diff --git a/runtime/llvm_codegen/codegen/main.cc b/runtime/llvm_codegen/codegen/main.cc new file mode 100644 index 00000000000..b45fcd2bb21 --- /dev/null +++ b/runtime/llvm_codegen/codegen/main.cc @@ -0,0 +1,42 @@ +// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +#include "llvm/ADT/StringRef.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" +#include "llvm/IRReader/IRReader.h" +#include "llvm/Support/InitLLVM.h" +#include "llvm/Support/SourceMgr.h" +#include "llvm/Support/WithColor.h" + +using namespace llvm; + +namespace { + +StringRef tool_name; + +LLVM_ATTRIBUTE_NORETURN void error(Twine message) { + WithColor::error(errs(), "llvm-codegen") << message << ".\n"; + errs().flush(); + exit(1); +} + +} // namespace + +int main(int argc, char** argv) { + InitLLVM X(argc, argv); + + LLVMContext context; + SMDiagnostic err; + if (argc != 2) error("exactly one argument is taken"); + tool_name = argv[0]; + std::unique_ptr mod = parseIRFile(argv[1], err, context); + if (mod == nullptr) { + err.print(tool_name.data(), errs()); + exit(1); + } + mod->print(outs(), nullptr); +} diff --git a/runtime/llvm_codegen/test/BUILD.gn b/runtime/llvm_codegen/test/BUILD.gn new file mode 100644 index 00000000000..b30e8403045 --- /dev/null +++ b/runtime/llvm_codegen/test/BUILD.gn @@ -0,0 +1,10 @@ +# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +group("test") { + deps = [ + "codegen", + "bit", + ] +} diff --git a/runtime/llvm_codegen/test/bit/BUILD.gn b/runtime/llvm_codegen/test/bit/BUILD.gn new file mode 100644 index 00000000000..dd09722fa5d --- /dev/null +++ b/runtime/llvm_codegen/test/bit/BUILD.gn @@ -0,0 +1,9 @@ +# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +import("//runtime/llvm_codegen/test/bit_test.gni") + +bit_test("bit") { + tests = [ "basic.test" ] +} diff --git a/runtime/llvm_codegen/test/bit/Inputs/basic_input.test b/runtime/llvm_codegen/test/bit/Inputs/basic_input.test new file mode 100644 index 00000000000..3889c3f71de --- /dev/null +++ b/runtime/llvm_codegen/test/bit/Inputs/basic_input.test @@ -0,0 +1 @@ +; RUN: %codegen %p/../../codegen/basic.ll diff --git a/runtime/llvm_codegen/test/bit/Inputs/percent.test b/runtime/llvm_codegen/test/bit/Inputs/percent.test new file mode 100644 index 00000000000..8b6782d1eeb --- /dev/null +++ b/runtime/llvm_codegen/test/bit/Inputs/percent.test @@ -0,0 +1 @@ +this is a percent sign: % diff --git a/runtime/llvm_codegen/test/bit/basic.test b/runtime/llvm_codegen/test/bit/basic.test new file mode 100644 index 00000000000..e4989c69fca --- /dev/null +++ b/runtime/llvm_codegen/test/bit/basic.test @@ -0,0 +1,8 @@ +; RUN: echo this is a test > %t1 +; RUN: echo this is a test > %t2 +; RUN: cmp %t1 %t2 +; RUN: echo this is a percent sign: % > %t3 +; RUN: cmp %t3 %p/Inputs/percent.test +; RUN: %bit %p/Inputs/basic_input.test %P > %t.test +; RUN: echo Commands run: 1 > %t.test2 +; RUN: cmp %t.test %t.test2 diff --git a/runtime/llvm_codegen/test/bit_test.gni b/runtime/llvm_codegen/test/bit_test.gni new file mode 100644 index 00000000000..bb1d3a53158 --- /dev/null +++ b/runtime/llvm_codegen/test/bit_test.gni @@ -0,0 +1,40 @@ +# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# This file defines a template for running bit tests. +# +# - bit_test() +# Runs bit on the specified file. + +# A template for running bit. This lets bit commands be run as ninja commands. +# +# Parameters: +# tests: +# The list of files to input into bit +template("bit_test") { + assert(defined(invoker.tests), "tests must be defined for $target_name") + + action_foreach(target_name) { + script = "//build/gn_run_binary.py" + sources = invoker.tests + + deps = [ + "//runtime/llvm_codegen/bit", + ] + inputs = [ + "${root_out_dir}/bit", + ] + + # This output is always dirty so ninja will always run this step when asked to. + outputs = [ + "$target_gen_dir/{{source_name_part}}}", + ] + args = [ + "compiled_action", + rebase_path("${root_out_dir}/bit"), + "{{source}}", + rebase_path(target_gen_dir), + ] + } +} diff --git a/runtime/llvm_codegen/test/codegen/BUILD.gn b/runtime/llvm_codegen/test/codegen/BUILD.gn new file mode 100644 index 00000000000..e0598f03d10 --- /dev/null +++ b/runtime/llvm_codegen/test/codegen/BUILD.gn @@ -0,0 +1,9 @@ +# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +import("//runtime/llvm_codegen/test/bit_test.gni") + +bit_test("codegen") { + tests = [ "basic.ll" ] +} diff --git a/runtime/llvm_codegen/test/codegen/basic.ll b/runtime/llvm_codegen/test/codegen/basic.ll new file mode 100644 index 00000000000..2afc69b3f48 --- /dev/null +++ b/runtime/llvm_codegen/test/codegen/basic.ll @@ -0,0 +1,6 @@ +; RUN: %codegen %s > %t + +define i32 @mult(i32, i32) { + %3 = mul i32 %0, %1 + ret i32 %3 +} diff --git a/third_party/llvm/BUILD.gn b/third_party/llvm/BUILD.gn new file mode 100644 index 00000000000..74424237ffa --- /dev/null +++ b/third_party/llvm/BUILD.gn @@ -0,0 +1,1576 @@ +# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +declare_args() { + llvm_prefix = "//third_party/llvm" +} + +template("llvm_library") { + config(target_name + "_config") { + visibility = [ ":*" ] + include_dirs = [ "include" ] + libs = [ "lib/lib${target_name}.a" ] + } + + group(target_name) { + forward_variables_from(invoker, [ "deps" ]) + public_configs = [ ":${target_name}_config" ] + } +} + +llvm_library("LLVMDemangle") { +} + +llvm_library("LLVMSupport") { + deps = [ + ":LLVMDemangle", + ] +} + +llvm_library("LLVMAArch64Utils") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMBinaryFormat") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMDebugInfoMSF") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMDebugInfoCodeView") { + deps = [ + ":LLVMDebugInfoMSF", + ":LLVMSupport", + ] +} + +llvm_library("LLVMMC") { + deps = [ + ":LLVMBinaryFormat", + ":LLVMDebugInfoCodeView", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAArch64AsmPrinter") { + deps = [ + ":LLVMAArch64Utils", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAArch64Info") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMAArch64Desc") { + deps = [ + ":LLVMAArch64AsmPrinter", + ":LLVMAArch64Info", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMMCParser") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAArch64AsmParser") { + deps = [ + ":LLVMAArch64Desc", + ":LLVMAArch64Info", + ":LLVMAArch64Utils", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMCore") { + deps = [ + ":LLVMBinaryFormat", + ":LLVMSupport", + ] +} + +llvm_library("LLVMBitReader") { + deps = [ + ":LLVMCore", + ":LLVMSupport", + ] +} + +llvm_library("LLVMObject") { + deps = [ + ":LLVMBinaryFormat", + ":LLVMBitReader", + ":LLVMCore", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMProfileData") { + deps = [ + ":LLVMCore", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAnalysis") { + deps = [ + ":LLVMBinaryFormat", + ":LLVMCore", + ":LLVMObject", + ":LLVMProfileData", + ":LLVMSupport", + ] +} + +llvm_library("LLVMBitWriter") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMMC", + ":LLVMObject", + ":LLVMSupport", + ] +} + +llvm_library("LLVMTransformUtils") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAggressiveInstCombine") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMSupport", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMInstCombine") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMSupport", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMScalarOpts") { + deps = [ + ":LLVMAggressiveInstCombine", + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMInstCombine", + ":LLVMSupport", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMTarget") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMBitReader", + ":LLVMBitWriter", + ":LLVMCore", + ":LLVMMC", + ":LLVMProfileData", + ":LLVMScalarOpts", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMAsmPrinter") { + deps = [ + ":LLVMAnalysis", + ":LLVMBinaryFormat", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMDebugInfoCodeView", + ":LLVMDebugInfoMSF", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMSelectionDAG") { + deps = [ + ":LLVMAnalysis", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMGlobalISel") { + deps = [ + ":LLVMAnalysis", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMAArch64CodeGen") { + deps = [ + ":LLVMAArch64AsmPrinter", + ":LLVMAArch64Desc", + ":LLVMAArch64Info", + ":LLVMAArch64Utils", + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMGlobalISel", + ":LLVMMC", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMMCDisassembler") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAArch64Disassembler") { + deps = [ + ":LLVMAArch64Desc", + ":LLVMAArch64Info", + ":LLVMAArch64Utils", + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAMDGPUUtils") { + deps = [ + ":LLVMCore", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAMDGPUAsmPrinter") { + deps = [ + ":LLVMAMDGPUUtils", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAMDGPUInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMAMDGPUDesc") { + deps = [ + ":LLVMAMDGPUAsmPrinter", + ":LLVMAMDGPUInfo", + ":LLVMAMDGPUUtils", + ":LLVMCore", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAMDGPUAsmParser") { + deps = [ + ":LLVMAMDGPUDesc", + ":LLVMAMDGPUInfo", + ":LLVMAMDGPUUtils", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAsmParser") { + deps = [ + ":LLVMBinaryFormat", + ":LLVMCore", + ":LLVMSupport", + ] +} + +llvm_library("LLVMIRReader") { + deps = [ + ":LLVMAsmParser", + ":LLVMBitReader", + ":LLVMCore", + ":LLVMSupport", + ] +} + +llvm_library("LLVMLinker") { + deps = [ + ":LLVMCore", + ":LLVMSupport", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMVectorize") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMSupport", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMInstrumentation") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMMC", + ":LLVMProfileData", + ":LLVMSupport", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMipo") { + deps = [ + ":LLVMAggressiveInstCombine", + ":LLVMAnalysis", + ":LLVMBitReader", + ":LLVMBitWriter", + ":LLVMCore", + ":LLVMIRReader", + ":LLVMInstCombine", + ":LLVMInstrumentation", + ":LLVMLinker", + ":LLVMObject", + ":LLVMProfileData", + ":LLVMScalarOpts", + ":LLVMSupport", + ":LLVMTransformUtils", + ":LLVMVectorize", + ] +} + +llvm_library("LLVMAMDGPUCodeGen") { + deps = [ + ":LLVMAMDGPUAsmPrinter", + ":LLVMAMDGPUDesc", + ":LLVMAMDGPUInfo", + ":LLVMAMDGPUUtils", + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMGlobalISel", + ":LLVMMC", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ":LLVMVectorize", + ":LLVMipo", + ] +} + +llvm_library("LLVMAMDGPUDisassembler") { + deps = [ + ":LLVMAMDGPUDesc", + ":LLVMAMDGPUInfo", + ":LLVMAMDGPUUtils", + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMARCAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMARCInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMARCDesc") { + deps = [ + ":LLVMARCAsmPrinter", + ":LLVMARCInfo", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMARCCodeGen") { + deps = [ + ":LLVMARCAsmPrinter", + ":LLVMARCDesc", + ":LLVMARCInfo", + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMARCDisassembler") { + deps = [ + ":LLVMARCInfo", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMARMUtils") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMARMAsmPrinter") { + deps = [ + ":LLVMARMUtils", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMARMInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMARMDesc") { + deps = [ + ":LLVMARMAsmPrinter", + ":LLVMARMInfo", + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMARMAsmParser") { + deps = [ + ":LLVMARMDesc", + ":LLVMARMInfo", + ":LLVMARMUtils", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMARMCodeGen") { + deps = [ + ":LLVMARMAsmPrinter", + ":LLVMARMDesc", + ":LLVMARMInfo", + ":LLVMARMUtils", + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMGlobalISel", + ":LLVMMC", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMARMDisassembler") { + deps = [ + ":LLVMARMDesc", + ":LLVMARMInfo", + ":LLVMARMUtils", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAVRAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAVRInfo") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAVRDesc") { + deps = [ + ":LLVMAVRAsmPrinter", + ":LLVMAVRInfo", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAVRAsmParser") { + deps = [ + ":LLVMAVRDesc", + ":LLVMAVRInfo", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMAVRCodeGen") { + deps = [ + ":LLVMAVRAsmPrinter", + ":LLVMAVRDesc", + ":LLVMAVRInfo", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMAVRDisassembler") { + deps = [ + ":LLVMAVRInfo", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMBPFAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMBPFInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMBPFDesc") { + deps = [ + ":LLVMBPFAsmPrinter", + ":LLVMBPFInfo", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMBPFAsmParser") { + deps = [ + ":LLVMBPFDesc", + ":LLVMBPFInfo", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMBPFCodeGen") { + deps = [ + ":LLVMAsmPrinter", + ":LLVMBPFAsmPrinter", + ":LLVMBPFDesc", + ":LLVMBPFInfo", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMBPFDisassembler") { + deps = [ + ":LLVMBPFInfo", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMCoroutines") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMScalarOpts", + ":LLVMSupport", + ":LLVMTransformUtils", + ":LLVMipo", + ] +} + +llvm_library("LLVMCoverage") { + deps = [ + ":LLVMCore", + ":LLVMObject", + ":LLVMProfileData", + ":LLVMSupport", + ] +} + +llvm_library("LLVMDebugInfoDWARF") { + deps = [ + ":LLVMBinaryFormat", + ":LLVMMC", + ":LLVMObject", + ":LLVMSupport", + ] +} + +llvm_library("LLVMDebugInfoPDB") { + deps = [ + ":LLVMDebugInfoCodeView", + ":LLVMDebugInfoMSF", + ":LLVMObject", + ":LLVMSupport", + ] +} + +llvm_library("LLVMOption") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMDlltoolDriver") { + deps = [ + ":LLVMObject", + ":LLVMOption", + ":LLVMSupport", + ] +} + +llvm_library("LLVMRuntimeDyld") { + deps = [ + ":LLVMMC", + ":LLVMObject", + ":LLVMSupport", + ] +} + +llvm_library("LLVMExecutionEngine") { + deps = [ + ":LLVMCore", + ":LLVMMC", + ":LLVMObject", + ":LLVMRuntimeDyld", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMMCJIT") { + deps = [ + ":LLVMCore", + ":LLVMExecutionEngine", + ":LLVMObject", + ":LLVMRuntimeDyld", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMFuzzMutate") { + deps = [ + ":LLVMAnalysis", + ":LLVMBitReader", + ":LLVMBitWriter", + ":LLVMCore", + ":LLVMScalarOpts", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMHexagonInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMHexagonDesc") { + deps = [ + ":LLVMHexagonInfo", + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMHexagonAsmParser") { + deps = [ + ":LLVMHexagonDesc", + ":LLVMHexagonInfo", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMHexagonCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMHexagonAsmParser", + ":LLVMHexagonDesc", + ":LLVMHexagonInfo", + ":LLVMMC", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ":LLVMipo", + ] +} + +llvm_library("LLVMHexagonDisassembler") { + deps = [ + ":LLVMHexagonDesc", + ":LLVMHexagonInfo", + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMInterpreter") { + deps = [ + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMExecutionEngine", + ":LLVMSupport", + ] +} + +llvm_library("LLVMObjCARCOpts") { + deps = [ + ":LLVMAnalysis", + ":LLVMCore", + ":LLVMSupport", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMPasses") { + deps = [ + ":LLVMAggressiveInstCombine", + ":LLVMAnalysis", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMInstCombine", + ":LLVMInstrumentation", + ":LLVMScalarOpts", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ":LLVMVectorize", + ":LLVMipo", + ] +} + +llvm_library("LLVMLTO") { + deps = [ + ":LLVMAggressiveInstCombine", + ":LLVMAnalysis", + ":LLVMBitReader", + ":LLVMBitWriter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMInstCombine", + ":LLVMLinker", + ":LLVMMC", + ":LLVMObjCARCOpts", + ":LLVMObject", + ":LLVMPasses", + ":LLVMScalarOpts", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ":LLVMipo", + ] +} + +llvm_library("LLVMLanaiInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMLanaiAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMLanaiDesc") { + deps = [ + ":LLVMLanaiAsmPrinter", + ":LLVMLanaiInfo", + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMLanaiAsmParser") { + deps = [ + ":LLVMLanaiDesc", + ":LLVMLanaiInfo", + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ] +} + +llvm_library("LLVMLanaiCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMLanaiAsmParser", + ":LLVMLanaiAsmPrinter", + ":LLVMLanaiDesc", + ":LLVMLanaiInfo", + ":LLVMMC", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMLanaiDisassembler") { + deps = [ + ":LLVMLanaiDesc", + ":LLVMLanaiInfo", + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMSupport", + ] +} + +llvm_library("LLVMLibDriver") { + deps = [ + ":LLVMBinaryFormat", + ":LLVMObject", + ":LLVMOption", + ":LLVMSupport", + ] +} + +llvm_library("LLVMLineEditor") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMMIRParser") { + deps = [ + ":LLVMAsmParser", + ":LLVMBinaryFormat", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMMSP430AsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMMSP430Info") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMMSP430Desc") { + deps = [ + ":LLVMMC", + ":LLVMMSP430AsmPrinter", + ":LLVMMSP430Info", + ":LLVMSupport", + ] +} + +llvm_library("LLVMMSP430CodeGen") { + deps = [ + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMMSP430AsmPrinter", + ":LLVMMSP430Desc", + ":LLVMMSP430Info", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMMipsAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMMipsInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMMipsDesc") { + deps = [ + ":LLVMMC", + ":LLVMMipsAsmPrinter", + ":LLVMMipsInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMMipsAsmParser") { + deps = [ + ":LLVMMC", + ":LLVMMCParser", + ":LLVMMipsDesc", + ":LLVMMipsInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMMipsCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMGlobalISel", + ":LLVMMC", + ":LLVMMipsAsmPrinter", + ":LLVMMipsDesc", + ":LLVMMipsInfo", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMMipsDisassembler") { + deps = [ + ":LLVMMCDisassembler", + ":LLVMMipsInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMNVPTXAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMNVPTXInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMNVPTXDesc") { + deps = [ + ":LLVMMC", + ":LLVMNVPTXAsmPrinter", + ":LLVMNVPTXInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMNVPTXCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMNVPTXAsmPrinter", + ":LLVMNVPTXDesc", + ":LLVMNVPTXInfo", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ":LLVMVectorize", + ":LLVMipo", + ] +} + +llvm_library("LLVMX86Utils") { + deps = [ + ":LLVMCore", + ":LLVMSupport", + ] +} + +llvm_library("LLVMX86AsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ":LLVMX86Utils", + ] +} + +llvm_library("LLVMX86Info") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMX86Desc") { + deps = [ + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMObject", + ":LLVMSupport", + ":LLVMX86AsmPrinter", + ":LLVMX86Info", + ] +} + +llvm_library("LLVMX86CodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMGlobalISel", + ":LLVMMC", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMX86AsmPrinter", + ":LLVMX86Desc", + ":LLVMX86Info", + ":LLVMX86Utils", + ] +} + +llvm_library("LLVMNios2AsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMNios2Info") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMNios2Desc") { + deps = [ + ":LLVMMC", + ":LLVMNios2AsmPrinter", + ":LLVMNios2Info", + ":LLVMSupport", + ] +} + +llvm_library("LLVMNios2CodeGen") { + deps = [ + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMGlobalISel", + ":LLVMMC", + ":LLVMNios2Desc", + ":LLVMNios2Info", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMObjectYAML") { + deps = [ + ":LLVMDebugInfoCodeView", + ":LLVMSupport", + ] +} + +llvm_library("LLVMOrcJIT") { + deps = [ + ":LLVMCore", + ":LLVMExecutionEngine", + ":LLVMMC", + ":LLVMObject", + ":LLVMRuntimeDyld", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMPowerPCAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMPowerPCInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMPowerPCDesc") { + deps = [ + ":LLVMMC", + ":LLVMPowerPCAsmPrinter", + ":LLVMPowerPCInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMPowerPCAsmParser") { + deps = [ + ":LLVMMC", + ":LLVMMCParser", + ":LLVMPowerPCDesc", + ":LLVMPowerPCInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMPowerPCCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMPowerPCAsmPrinter", + ":LLVMPowerPCDesc", + ":LLVMPowerPCInfo", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ] +} + +llvm_library("LLVMPowerPCDisassembler") { + deps = [ + ":LLVMMCDisassembler", + ":LLVMPowerPCInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMRISCVAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMRISCVInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMRISCVDesc") { + deps = [ + ":LLVMMC", + ":LLVMRISCVAsmPrinter", + ":LLVMRISCVInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMRISCVAsmParser") { + deps = [ + ":LLVMMC", + ":LLVMMCParser", + ":LLVMRISCVDesc", + ":LLVMRISCVInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMRISCVCodeGen") { + deps = [ + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMRISCVAsmPrinter", + ":LLVMRISCVDesc", + ":LLVMRISCVInfo", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMRISCVDisassembler") { + deps = [ + ":LLVMMCDisassembler", + ":LLVMRISCVInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMSparcAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMSparcInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMSparcDesc") { + deps = [ + ":LLVMMC", + ":LLVMSparcAsmPrinter", + ":LLVMSparcInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMSparcAsmParser") { + deps = [ + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSparcDesc", + ":LLVMSparcInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMSparcCodeGen") { + deps = [ + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSelectionDAG", + ":LLVMSparcAsmPrinter", + ":LLVMSparcDesc", + ":LLVMSparcInfo", + ":LLVMSupport", + ":LLVMTarget", + ] +} + +llvm_library("LLVMSparcDisassembler") { + deps = [ + ":LLVMMCDisassembler", + ":LLVMSparcInfo", + ":LLVMSupport", + ] +} + +llvm_library("LLVMSymbolize") { + deps = [ + ":LLVMDebugInfoDWARF", + ":LLVMDebugInfoPDB", + ":LLVMDemangle", + ":LLVMObject", + ":LLVMSupport", + ] +} + +llvm_library("LLVMSystemZAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMSystemZInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMSystemZDesc") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ":LLVMSystemZAsmPrinter", + ":LLVMSystemZInfo", + ] +} + +llvm_library("LLVMSystemZAsmParser") { + deps = [ + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ":LLVMSystemZDesc", + ":LLVMSystemZInfo", + ] +} + +llvm_library("LLVMSystemZCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMSystemZAsmPrinter", + ":LLVMSystemZDesc", + ":LLVMSystemZInfo", + ":LLVMTarget", + ] +} + +llvm_library("LLVMSystemZDisassembler") { + deps = [ + ":LLVMMC", + ":LLVMMCDisassembler", + ":LLVMSupport", + ":LLVMSystemZDesc", + ":LLVMSystemZInfo", + ] +} + +llvm_library("LLVMTableGen") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMTestingSupport") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMWebAssemblyInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMWebAssemblyAsmParser") { + deps = [ + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ":LLVMWebAssemblyInfo", + ] +} + +llvm_library("LLVMWebAssemblyAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMWebAssemblyDesc") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ":LLVMWebAssemblyAsmPrinter", + ":LLVMWebAssemblyInfo", + ] +} + +llvm_library("LLVMWebAssemblyCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMScalarOpts", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ":LLVMWebAssemblyAsmPrinter", + ":LLVMWebAssemblyDesc", + ":LLVMWebAssemblyInfo", + ] +} + +llvm_library("LLVMWebAssemblyDisassembler") { + deps = [ + ":LLVMMCDisassembler", + ":LLVMSupport", + ":LLVMWebAssemblyInfo", + ] +} + +llvm_library("LLVMWindowsManifest") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMX86AsmParser") { + deps = [ + ":LLVMMC", + ":LLVMMCParser", + ":LLVMSupport", + ":LLVMX86AsmPrinter", + ":LLVMX86Desc", + ":LLVMX86Info", + ] +} + +llvm_library("LLVMX86Disassembler") { + deps = [ + ":LLVMMCDisassembler", + ":LLVMSupport", + ":LLVMX86Info", + ] +} + +llvm_library("LLVMXCoreAsmPrinter") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ] +} + +llvm_library("LLVMXCoreInfo") { + deps = [ + ":LLVMSupport", + ] +} + +llvm_library("LLVMXCoreDesc") { + deps = [ + ":LLVMMC", + ":LLVMSupport", + ":LLVMXCoreAsmPrinter", + ":LLVMXCoreInfo", + ] +} + +llvm_library("LLVMXCoreCodeGen") { + deps = [ + ":LLVMAnalysis", + ":LLVMAsmPrinter", + ":LLVMCodeGen", + ":LLVMCore", + ":LLVMMC", + ":LLVMSelectionDAG", + ":LLVMSupport", + ":LLVMTarget", + ":LLVMTransformUtils", + ":LLVMXCoreAsmPrinter", + ":LLVMXCoreDesc", + ":LLVMXCoreInfo", + ] +} + +llvm_library("LLVMXCoreDisassembler") { + deps = [ + ":LLVMMCDisassembler", + ":LLVMSupport", + ":LLVMXCoreInfo", + ] +}