update_llvm.sh 682 B

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