workspace.bzl 1.0 KB
Newer Older
1 2 3 4 5 6
"""Provides the repository macro to import LLVM."""

load("//third_party:repo.bzl", "tf_http_archive")

def repo(name):
    """Imports LLVM."""
7 8
    LLVM_COMMIT = "a72cc958a386e5fc97e8c30137fb56eb77ef571c"
    LLVM_SHA256 = "6c60b12fac62e9c407acc0c35434188098d1bbdb432fc1663711dcb814590869"
9 10 11 12

    tf_http_archive(
        name = name,
        sha256 = LLVM_SHA256,
13
        strip_prefix = "llvm-project-{commit}".format(commit = LLVM_COMMIT),
14 15 16 17
        urls = [
            "https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
            "https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
        ],
18
        build_file = "//third_party/llvm:llvm.BUILD",
19
        patch_file = [
20
            "//third_party/llvm:infer_type.patch",  # TODO(b/231285230): remove once resolved
21 22
            "//third_party/llvm:macos_build_fix.patch",
        ],
23
        link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"},
24
    )