Files
carbon-lang/third_party/update_llvm.sh
T
Chandler Carruth 6aae31b65b Merge LLVM and Bazel infra from the toolchain repository. (#207)
The Bazel bits are collected into a directory and given less confusing
names (I hope). Other than names, everything is a direct copy from the
toolchain repository without any edits.

A few files needed to be merged in:
- `.gitignore`
- `.pre-commit-config.yaml`

Subsequent commits will add relevant C++ infrastructure and then the
source code itself.
2020-12-04 19:26:07 -08:00

20 lines
682 B
Bash
Executable File

#!/bin/bash -eux
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Ensure the working directory is the script's directory.
cd "$(dirname "$0")"
# Update the `llvm-bazel` project first by just pulling from its HEAD.
git submodule update --remote llvm-bazel
# Find the current LLVM commit in the `llvm-bazel` project.
llvm_commit=$(cd llvm-bazel; git submodule status third_party/llvm-project | awk '/-[0-9a-f]+ / { print substr($1, 2) }')
# Fetch and checkout this commit of LLVM
cd llvm-project
git fetch
git checkout $llvm_commit
cd ..