tools/clang/scripts/build_clang_tools_extra.py
def FetchLLVM(checkout_dir, revision):
  """Clone llvm repo into |out_dir| or update if it already exists."""
  CreateDirIfNotExists(os.path.dirname(checkout_dir))

  try:
    # First, try to clone the repo.
    args = [
        'git',
        'clone',
        'https://github.com/llvm/llvm-project.git',
        checkout_dir,
    ]
    subprocess.check_call(args, shell=sys.platform == 'win32')
  except subprocess.CalledProcessError:
    # Otherwise, try to update it.
    print('-- Attempting to update existing repo')
    args = ['git', 'pull', '--rebase', 'origin', 'main']
    subprocess.check_call(args, cwd=checkout_dir, shell=sys.platform == 'win32')
  if revision:
    args = ['git', 'checkout', revision]
    subprocess.check_call(args, cwd=checkout_dir, shell=sys.platform == 'win32')
Clone llvm repo into |out_dir| or update if it already exists.
Clone llvm repo into |out_dir| or update if it already exists.
Clone llvm repo into |out_dir| or update if it already exists .
def FetchLLVM(checkout_dir, revision):
  CreateDirIfNotExists(os.path.dirname(checkout_dir))
  try:
    args = [
        'git',
        'clone',
        'https://github.com/llvm/llvm-project.git',
        checkout_dir,
    ]
    subprocess.check_call(args, shell=sys.platform == 'win32')
  except subprocess.CalledProcessError:
    print('-- Attempting to update existing repo')
    args = ['git', 'pull', '--rebase', 'origin', 'main']
    subprocess.check_call(args, cwd=checkout_dir, shell=sys.platform == 'win32')
  if revision:
    args = ['git', 'checkout', revision]
    subprocess.check_call(args, cwd=checkout_dir, shell=sys.platform == 'win32')
def FetchLLVM ( checkout_dir , revision ) : CreateDirIfNotExists ( os . path . dirname ( checkout_dir ) ) try : args = [ 'git' , 'clone' , 'https://github.com/llvm/llvm-project.git' , checkout_dir , ] subprocess . check_call ( args , shell = sys . platform == 'win32' ) except subprocess . CalledProcessError : print ( '-- Attempting to update existing repo' ) args = [ 'git' , 'pull' , '--rebase' , 'origin' , 'main' ] subprocess . check_call ( args , cwd = checkout_dir , shell = sys . platform == 'win32' ) if revision : args = [ 'git' , 'checkout' , revision ] subprocess . check_call ( args , cwd = checkout_dir , shell = sys . platform == 'win32' )
Clone llvm repo into |out_dir| or update if it already exists.
Clone llvm repo into |out_dir| or update if it already exists .
"""Clone llvm repo into |out_dir| or update if it already exists.""" # First, try to clone the repo. # Otherwise, try to update it.
checkout_dir
revision