feat(build): switch to using targets generated by kythe/llvmbzlgen (#3837)

* feat(build): switch to using targets generated by kythe/llvmbzlgen

* chore(build): update to latest llvmbzlgen commit
diff --git a/external.bzl b/external.bzl
index 8803c5a..400bd9c 100644
--- a/external.bzl
+++ b/external.bzl
@@ -713,6 +713,14 @@
         urls = ["https://github.com/bazelbuild/bazel-skylib/archive/0.5.0.zip"],
     )
 
+    maybe(
+        http_archive,
+        name = "io_kythe_llvmbzlgen",
+        sha256 = "6d077cfe818d08ea9184d71f73581135b69c379692771afd88392fa1fee018ac",
+        urls = ["https://github.com/kythe/llvmbzlgen/archive/435bad1d07f7a8d32979d66cd5547e1b32dca812.zip"],
+        strip_prefix = "llvmbzlgen-435bad1d07f7a8d32979d66cd5547e1b32dca812",
+    )
+
     _rule_dependencies()
     if sample_ui:
         _sample_ui_dependencies()
diff --git a/tools/build_rules/llvm/cmakedefines/BUILD b/tools/build_rules/llvm/cmakedefines/BUILD
deleted file mode 100644
index 0c70716..0000000
--- a/tools/build_rules/llvm/cmakedefines/BUILD
+++ /dev/null
@@ -1,9 +0,0 @@
-load("//tools:build_rules/shims.bzl", "go_binary")
-
-package(default_visibility = ["//kythe:default_visibility"])
-
-go_binary(
-    name = "cmakedefines",
-    srcs = ["cmakedefines.go"],
-    visibility = ["//visibility:public"],
-)
diff --git a/tools/build_rules/llvm/cmakedefines/cmakedefines.go b/tools/build_rules/llvm/cmakedefines/cmakedefines.go
deleted file mode 100644
index 473f8ba..0000000
--- a/tools/build_rules/llvm/cmakedefines/cmakedefines.go
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright 2019 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Processes CMake input files to handle CMake-style substitutions.
-//
-// For details see:
-// https://cmake.org/cmake/help/latest/command/configure_file.html
-package main
-
-import (
-	"bufio"
-	"bytes"
-	"encoding/json"
-	"flag"
-	"fmt"
-	"log"
-	"os"
-	"regexp"
-	"strings"
-)
-
-type cmakeValue string
-type cmakeDefines map[string]cmakeValue
-
-var (
-	atOnly       = flag.Bool("at_only", false, "Restrict variable replacement to references of the form @VAR@.")
-	strict       = flag.Bool("strict", false, "Exit with an error if an undefined variable is inspected.")
-	verbose      = flag.Bool("verbose", false, "Print an error if an undefined variable is inspected.")
-	jsonValues   = flag.String("json", "", "Parse the string as a JSON dictionary to use as CMake defines.")
-	outFile      = flag.String("outfile", "-", "File to which output should be written. Defaults to stdout.")
-	atPattern    = regexp.MustCompile("@([^@]*)@")
-	allPattern   = regexp.MustCompile(`\${([^}]*)}|` + atPattern.String())
-	defPattern   = regexp.MustCompile(`^#(\s*)cmakedefine(01)?\s+([^\s]+)`)
-	falsePattern = regexp.MustCompile("^(0|OFF|NO|FALSE|N|IGNORE|(.*-)?NOTFOUND)$")
-	varMap       = &cmakeDefines{}
-)
-
-func (cv *cmakeValue) UnmarshalJSON(data []byte) error {
-	var i interface{}
-	json.Unmarshal(data, &i)
-	switch v := i.(type) {
-	case bool:
-		*cv = cmakeValue(strings.ToUpper(fmt.Sprint(v)))
-	case float64:
-		*cv = cmakeValue(fmt.Sprint(v))
-	case string:
-		*cv = cmakeValue(v)
-	case nil:
-		*cv = ""
-	default:
-		return fmt.Errorf("expected bool, string or number, found: %T", v)
-	}
-	return nil
-}
-
-// Get returns the currently defined value or the empty string.
-func (vars *cmakeDefines) Get(key string) string {
-	if value, ok := (*vars)[key]; ok {
-		return string(value)
-	} else if *strict {
-		log.Fatalln("Undefined variable: ", key)
-	} else if *verbose {
-		log.Println("Undefined variable: ", key)
-	}
-	return ""
-}
-
-// Defined returns true if the value is set to a value "not considered false".
-// See https://cmake.org/cmake/help/latest/command/if.html#command:if for more details.
-func (vars *cmakeDefines) Defined(key string) bool {
-	value, ok := (*vars)[key]
-	if !ok {
-		if *strict {
-			log.Fatalln("Undefined variable: ", key)
-		} else if *verbose {
-			log.Println("Undefined variable: ", key)
-		}
-	}
-	return ok && len(value) > 0 && !falsePattern.MatchString(string(value))
-}
-
-func (vars *cmakeDefines) String() string {
-	bytes, err := json.Marshal(vars)
-	if err != nil {
-		panic(err)
-	}
-	return string(bytes)
-}
-
-func init() {
-	flag.Usage = func() {
-		fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [options] <input>\n", os.Args[0])
-		flag.PrintDefaults()
-	}
-}
-
-func transform(input, output *os.File) error {
-	scanner := bufio.NewScanner(input)
-	for scanner.Scan() {
-		text := scanner.Bytes()
-		text = replaceLine(text)
-		text = append(text, '\n')
-		if _, err := output.Write(text); err != nil {
-			return err
-		}
-	}
-	return scanner.Err()
-}
-
-func replaceLine(text []byte) []byte {
-	// There should only be a single match.
-	submatches := defPattern.FindSubmatch(text)
-	if submatches == nil {
-		return replaceVars(text)
-	}
-	spacing := submatches[1]
-	isBinary := len(submatches[2]) == 2
-	varName := submatches[3]
-
-	var result bytes.Buffer
-	if isBinary {
-		result.WriteByte('#')
-		result.Write(spacing)
-		result.WriteString("define ")
-		result.Write(varName)
-		result.WriteByte(' ')
-		if varMap.Defined(string(varName)) {
-			result.WriteByte('1')
-		} else {
-			result.WriteByte('0')
-		}
-	} else if varMap.Defined(string(varName)) {
-		result.WriteByte('#')
-		result.Write(spacing)
-		result.WriteString("define ")
-		result.Write(varName)
-		result.Write(replaceVars(text[len(submatches[0]):]))
-	} else {
-		result.WriteString("/* #undef ")
-		result.Write(varName)
-		result.WriteString(" */")
-	}
-	return result.Bytes()
-}
-
-func replaceVars(text []byte) []byte {
-	pattern := allPattern
-	if *atOnly {
-		pattern = atPattern
-	}
-	return pattern.ReplaceAllFunc(text, func(key []byte) []byte {
-		// Chop off the delimiters before looking up the variable.
-		if key[0] == '@' {
-			key = key[1 : len(key)-1]
-		} else {
-			key = key[2 : len(key)-1]
-		}
-		return []byte(varMap.Get(string(key)))
-	})
-}
-
-func main() {
-	flag.Parse()
-	if flag.NArg() != 1 {
-		fmt.Fprintf(flag.CommandLine.Output(), "Missing required input file\n")
-		flag.Usage()
-		os.Exit(1)
-	}
-	if err := json.Unmarshal([]byte(*jsonValues), varMap); err != nil {
-		log.Fatalf("Invalid JSON: %s", err)
-	}
-
-	input, err := os.Open(flag.Arg(0))
-	if err != nil {
-		log.Fatal(err)
-	}
-	defer input.Close()
-
-	output := os.Stdout
-	if len(*outFile) > 0 && *outFile != "-" {
-		if output, err = os.Create(*outFile); err != nil {
-			log.Fatal(err)
-		}
-		defer output.Close()
-	}
-
-	if err := transform(input, output); err != nil {
-		log.Fatalf("Error processing file: %s", err)
-	}
-}
diff --git a/tools/build_rules/llvm/configure_file.bzl b/tools/build_rules/llvm/configure_file.bzl
deleted file mode 100644
index 538a853..0000000
--- a/tools/build_rules/llvm/configure_file.bzl
+++ /dev/null
@@ -1,30 +0,0 @@
-def _configure_file(ctx):
-    args = ctx.actions.args()
-    if ctx.attr.strict:
-        args.add("-strict")
-    args.add("-outfile", ctx.outputs.out)
-    args.add("-json", struct(**ctx.attr.defines).to_json())
-    args.add(ctx.file.src)
-    ctx.actions.run(
-        outputs = [ctx.outputs.out],
-        inputs = [ctx.file.src],
-        executable = ctx.file._cmakedefines,
-        arguments = [args],
-        mnemonic = "ConfigureFile",
-    )
-
-configure_file = rule(
-    implementation = _configure_file,
-    attrs = {
-        "src": attr.label(allow_single_file = True),
-        "out": attr.output(mandatory = True),
-        "strict": attr.bool(default = False),
-        "defines": attr.string_dict(),
-        "_cmakedefines": attr.label(
-            default = Label("@io_kythe//tools/build_rules/llvm/cmakedefines"),
-            allow_single_file = True,
-            executable = True,
-            cfg = "host",
-        ),
-    },
-)
diff --git a/tools/build_rules/llvm/generated_cmake_targets.bzl b/tools/build_rules/llvm/generated_cmake_targets.bzl
index 29a52fa..1f7b944 100644
--- a/tools/build_rules/llvm/generated_cmake_targets.bzl
+++ b/tools/build_rules/llvm/generated_cmake_targets.bzl
@@ -1,53 +1,53 @@
 def generated_cmake_targets(ctx):
-    ctx = ctx.enter_directory(ctx, "")
+    ctx = ctx.push_directory(ctx, "")
     ctx.set(ctx, "LLVM_ALL_PROJECTS", "clang;clang-tools-extra;compiler-rt;debuginfo-tests;libclc;libcxx;libcxxabi;libunwind;lld;lldb;llgo;openmp;parallel-libs;polly;pstl")
-    ctx.set(ctx, "LLVM_ENABLE_PROJECTS", "", "CACHE", "STRING", "Semicolon-separated list of projects to build (), or \\\"all\\\".")
+    ctx.set(ctx, "LLVM_ENABLE_PROJECTS", "", "CACHE", "STRING", "Semicolon-separated list of projects to build (clang;clang-tools-extra;compiler-rt;debuginfo-tests;libclc;libcxx;libcxxabi;libunwind;lld;lldb;llgo;openmp;parallel-libs;polly;pstl), or \"all\".")
     ctx.set(ctx, "LLVM_ENABLE_PROJECTS_USED", "OFF", "CACHE", "BOOL", "")
     ctx.set(ctx, "LLVM_CCACHE_BUILD", "OFF", "CACHE", "BOOL", "Set to ON for a ccache enabled build")
-    ctx.set(ctx, "CMAKE_MODULE_PATH", "", "//cmake", "//cmake/modules")
+    ctx.set(ctx, "CMAKE_MODULE_PATH", "", "/root/cmake", "/root/cmake/modules")
     ctx.set(ctx, "CMAKE_EXPORT_COMPILE_COMMANDS", "1")
     ctx.set(ctx, "PACKAGE_NAME", "LLVM")
-    ctx.set(ctx, "PACKAGE_STRING", " ")
+    ctx.set(ctx, "PACKAGE_STRING", "LLVM ")
     ctx.set(ctx, "PACKAGE_BUGREPORT", "https://bugs.llvm.org/")
-    ctx.set(ctx, "BUG_REPORT_URL", "", "CACHE", "STRING", "Default URL where bug reports are to be submitted.")
+    ctx.set(ctx, "BUG_REPORT_URL", "https://bugs.llvm.org/", "CACHE", "STRING", "Default URL where bug reports are to be submitted.")
     ctx.set(ctx, "CPACK_PACKAGE_INSTALL_DIRECTORY", "LLVM")
     ctx.set(ctx, "CPACK_PACKAGE_VENDOR", "LLVM")
     ctx.set(ctx, "CPACK_PACKAGE_VERSION_MAJOR", "")
     ctx.set(ctx, "CPACK_PACKAGE_VERSION_MINOR", "")
     ctx.set(ctx, "CPACK_PACKAGE_VERSION_PATCH", "")
     ctx.set(ctx, "CPACK_PACKAGE_VERSION", "")
-    ctx.set(ctx, "CPACK_RESOURCE_FILE_LICENSE", "//LICENSE.TXT")
-    ctx.set(ctx, "CPACK_NSIS_COMPRESSOR", "/SOLID lzma \\r\\n SetCompressorDictSize 32")
+    ctx.set(ctx, "CPACK_RESOURCE_FILE_LICENSE", "/root/LICENSE.TXT")
+    ctx.set(ctx, "CPACK_NSIS_COMPRESSOR", "/SOLID lzma \r\n SetCompressorDictSize 32")
     ctx.set(ctx, "LLVM_LIBDIR_SUFFIX", "", "CACHE", "STRING", "Define suffix of library directory name (32/64)")
     ctx.set(ctx, "LLVM_TOOLS_INSTALL_DIR", "bin", "CACHE", "STRING", "Path for binary subdirectory (defaults to 'bin')")
-    ctx.set(ctx, "LLVM_UTILS_INSTALL_DIR", "", "CACHE", "STRING", "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)")
-    ctx.set(ctx, "LLVM_RUNTIME_OUTPUT_INTDIR", "///bin")
-    ctx.set(ctx, "LLVM_LIBRARY_OUTPUT_INTDIR", "///lib")
-    ctx.set(ctx, "LLVM_TOOLS_BINARY_DIR", "")
-    ctx.set(ctx, "LLVM_LIBRARY_DIR", "")
-    ctx.set(ctx, "LLVM_MAIN_SRC_DIR", "/")
-    ctx.set(ctx, "LLVM_MAIN_INCLUDE_DIR", "/include")
-    ctx.set(ctx, "LLVM_BINARY_DIR", "/")
-    ctx.set(ctx, "LLVM_CMAKE_PATH", "/cmake/modules")
-    ctx.set(ctx, "LLVM_EXAMPLES_BINARY_DIR", "/examples")
-    ctx.set(ctx, "LLVM_INCLUDE_DIR", "//include")
+    ctx.set(ctx, "LLVM_UTILS_INSTALL_DIR", "bin", "CACHE", "STRING", "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)")
+    ctx.set(ctx, "LLVM_RUNTIME_OUTPUT_INTDIR", "/root//bin")
+    ctx.set(ctx, "LLVM_LIBRARY_OUTPUT_INTDIR", "/root//lib")
+    ctx.set(ctx, "LLVM_TOOLS_BINARY_DIR", "/root//bin")
+    ctx.set(ctx, "LLVM_LIBRARY_DIR", "/root//lib")
+    ctx.set(ctx, "LLVM_MAIN_SRC_DIR", "/root")
+    ctx.set(ctx, "LLVM_MAIN_INCLUDE_DIR", "/root/include")
+    ctx.set(ctx, "LLVM_BINARY_DIR", "/root")
+    ctx.set(ctx, "LLVM_CMAKE_PATH", "/root/cmake/modules")
+    ctx.set(ctx, "LLVM_EXAMPLES_BINARY_DIR", "/root/examples")
+    ctx.set(ctx, "LLVM_INCLUDE_DIR", "/root/include")
     ctx.set(ctx, "LLVM_ALL_TARGETS", "AArch64", "AMDGPU", "ARM", "BPF", "Hexagon", "Lanai", "Mips", "MSP430", "NVPTX", "PowerPC", "Sparc", "SystemZ", "WebAssembly", "X86", "XCore")
     ctx.set(ctx, "LLVM_TARGETS_WITH_JIT", "X86", "PowerPC", "AArch64", "ARM", "Mips", "SystemZ")
-    ctx.set(ctx, "LLVM_TARGETS_TO_BUILD", "all", "CACHE", "STRING", "Semicolon-separated list of targets to build, or \\\"all\\\".")
+    ctx.set(ctx, "LLVM_TARGETS_TO_BUILD", "all", "CACHE", "STRING", "Semicolon-separated list of targets to build, or \"all\".")
     ctx.set(ctx, "LLVM_EXPERIMENTAL_TARGETS_TO_BUILD", "", "CACHE", "STRING", "Semicolon-separated list of experimental targets to build.")
     ctx.set(ctx, "FFI_LIBRARY_DIR", "", "CACHE", "PATH", "Additional directory, where CMake should search for libffi.so")
     ctx.set(ctx, "FFI_INCLUDE_DIR", "", "CACHE", "PATH", "Additional directory, where CMake should search for ffi.h or ffi/ffi.h")
-    ctx.set(ctx, "LLVM_TARGET_ARCH", "host", "CACHE", "STRING", "Set target to use for LLVM JIT or use \\\"host\\\" for automatic detection.")
+    ctx.set(ctx, "LLVM_TARGET_ARCH", "host", "CACHE", "STRING", "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
     ctx.set(ctx, "LLVM_ENABLE_LIBXML2", "ON", "CACHE", "STRING", "Use libxml2 if available. Can be ON, OFF, or FORCE_ON")
     ctx.set(ctx, "LLVM_Z3_INSTALL_DIR", "", "CACHE", "STRING", "Install directory of the Z3 solver.")
     ctx.set(ctx, "LLVM_ENABLE_Z3_SOLVER_DEFAULT", "")
-    ctx.set(ctx, "LLVM_TARGETS_TO_BUILD", "", "")
+    ctx.set(ctx, "LLVM_TARGETS_TO_BUILD", "all", "")
     ctx.set(ctx, "LLVM_ABI_BREAKING_CHECKS", "WITH_ASSERTS", "CACHE", "STRING", "Enable abi-breaking checks.  Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
     ctx.set(ctx, "LLVM_CODESIGNING_IDENTITY", "", "CACHE", "STRING", "Sign executables and dylibs with the given identity or skip if empty (Darwin Only)")
     ctx.set(ctx, "LLVM_USE_SANITIZER", "", "CACHE", "STRING", "Define the sanitizer used to build binaries and tests.")
     ctx.set(ctx, "LLVM_LIB_FUZZING_ENGINE", "", "CACHE", "PATH", "Path to fuzzing library for linking with fuzz targets")
     ctx.set(ctx, "LIT_ARGS_DEFAULT", "-sv")
-    ctx.set(ctx, "LLVM_LIT_ARGS", "", "CACHE", "STRING", "Default options for lit")
+    ctx.set(ctx, "LLVM_LIT_ARGS", "-sv", "CACHE", "STRING", "Default options for lit")
     ctx.set(ctx, "LLVM_INSTALL_DOXYGEN_HTML_DIR", "share/doc/llvm/doxygen-html", "CACHE", "STRING", "Doxygen-generated HTML documentation install directory")
     ctx.set(ctx, "LLVM_INSTALL_OCAMLDOC_HTML_DIR", "share/doc/llvm/ocaml-html", "CACHE", "STRING", "OCamldoc-generated HTML documentation install directory")
     ctx.set(ctx, "LLVM_BUILD_LLVM_DYLIB_default", "OFF")
@@ -56,252 +56,252 @@
     ctx.set(ctx, "LLVM_DEFAULT_TARGET_TRIPLE", "", "CACHE", "STRING", "Default target for which LLVM will generate code.")
     ctx.set(ctx, "TARGET_TRIPLE", "")
     ctx.set(ctx, "Python_ADDITIONAL_VERSIONS", "2.7")
-    ctx.set(ctx, "LLVMBUILDTOOL", "/utils/llvm-build/llvm-build")
-    ctx.set(ctx, "LLVMCONFIGLIBRARYDEPENDENCIESINC", "/tools/llvm-config/LibraryDependencies.inc")
-    ctx.set(ctx, "LLVMBUILDCMAKEFRAG", "/LLVMBuild.cmake")
+    ctx.set(ctx, "LLVMBUILDTOOL", "/root/utils/llvm-build/llvm-build")
+    ctx.set(ctx, "LLVMCONFIGLIBRARYDEPENDENCIESINC", "/root/tools/llvm-config/LibraryDependencies.inc")
+    ctx.set(ctx, "LLVMBUILDCMAKEFRAG", "/root/LLVMBuild.cmake")
     ctx.set(ctx, "LLVM_ENUM_TARGETS", "")
     ctx.set(ctx, "LLVM_ENUM_ASM_PRINTERS", "")
     ctx.set(ctx, "LLVM_ENUM_ASM_PARSERS", "")
     ctx.set(ctx, "LLVM_ENUM_DISASSEMBLERS", "")
-    ctx.configure_file(ctx, "/include/llvm/Config/AsmPrinters.def.in", "/include/llvm/Config/AsmPrinters.def")
-    ctx.configure_file(ctx, "/include/llvm/Config/AsmParsers.def.in", "/include/llvm/Config/AsmParsers.def")
-    ctx.configure_file(ctx, "/include/llvm/Config/Disassemblers.def.in", "/include/llvm/Config/Disassemblers.def")
-    ctx.configure_file(ctx, "/include/llvm/Config/Targets.def.in", "/include/llvm/Config/Targets.def")
-    ctx.configure_file(ctx, "/include/llvm/Config/config.h.cmake", "/include/llvm/Config/config.h")
-    ctx.configure_file(ctx, "/include/llvm/Config/llvm-config.h.cmake", "/include/llvm/Config/llvm-config.h")
-    ctx.configure_file(ctx, "/include/llvm/Config/abi-breaking.h.cmake", "/include/llvm/Config/abi-breaking.h")
-    ctx.set(ctx, "LLVM_SRPM_USER_BINARY_SPECFILE", "//llvm.spec.in", "CACHE", "FILEPATH", ".spec file to use for srpm generation")
-    ctx.set(ctx, "LLVM_SRPM_BINARY_SPECFILE", "//llvm.spec")
-    ctx.set(ctx, "LLVM_SRPM_DIR", "//srpm")
-    ctx.configure_file(ctx, "", "", "@ONLY")
-    ctx.set(ctx, "CMAKE_RUNTIME_OUTPUT_DIRECTORY", "/bin")
-    ctx.set(ctx, "CMAKE_LIBRARY_OUTPUT_DIRECTORY", "/lib")
-    ctx.set(ctx, "CMAKE_ARCHIVE_OUTPUT_DIRECTORY", "/lib")
+    ctx.configure_file(ctx, "/root/include/llvm/Config/AsmPrinters.def.in", "/root/include/llvm/Config/AsmPrinters.def")
+    ctx.configure_file(ctx, "/root/include/llvm/Config/AsmParsers.def.in", "/root/include/llvm/Config/AsmParsers.def")
+    ctx.configure_file(ctx, "/root/include/llvm/Config/Disassemblers.def.in", "/root/include/llvm/Config/Disassemblers.def")
+    ctx.configure_file(ctx, "/root/include/llvm/Config/Targets.def.in", "/root/include/llvm/Config/Targets.def")
+    ctx.configure_file(ctx, "/root/include/llvm/Config/config.h.cmake", "/root/include/llvm/Config/config.h")
+    ctx.configure_file(ctx, "/root/include/llvm/Config/llvm-config.h.cmake", "/root/include/llvm/Config/llvm-config.h")
+    ctx.configure_file(ctx, "/root/include/llvm/Config/abi-breaking.h.cmake", "/root/include/llvm/Config/abi-breaking.h")
+    ctx.set(ctx, "LLVM_SRPM_USER_BINARY_SPECFILE", "/root/llvm.spec.in", "CACHE", "FILEPATH", ".spec file to use for srpm generation")
+    ctx.set(ctx, "LLVM_SRPM_BINARY_SPECFILE", "/root/llvm.spec")
+    ctx.set(ctx, "LLVM_SRPM_DIR", "/root/srpm")
+    ctx.configure_file(ctx, "/root/llvm.spec.in", "/root/llvm.spec", "@ONLY")
+    ctx.set(ctx, "CMAKE_RUNTIME_OUTPUT_DIRECTORY", "/root/bin")
+    ctx.set(ctx, "CMAKE_LIBRARY_OUTPUT_DIRECTORY", "/root/lib")
+    ctx.set(ctx, "CMAKE_ARCHIVE_OUTPUT_DIRECTORY", "/root/lib")
     ctx.set(ctx, "CMAKE_INCLUDE_CURRENT_DIR", "ON")
     ctx.set(ctx, "CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS", "")
     ctx.set(ctx, "LLVM_PROFDATA_FILE", "", "CACHE", "FILEPATH", "Profiling data file to use when compiling in order to improve runtime performance.")
-    ctx = ctx.enter_directory(ctx, "lib/Demangle")
-    ctx.add_llvm_library(ctx, "LLVMDemangle", "Demangle.cpp", "ItaniumDemangle.cpp", "MicrosoftDemangle.cpp", "MicrosoftDemangleNodes.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Demangle")
-    ctx = ctx.exit_directory(ctx, "lib/Demangle")
-    ctx = ctx.enter_directory(ctx, "lib/Support")
+    ctx = ctx.push_directory(ctx, "lib/Demangle")
+    ctx.add_llvm_library(ctx, "LLVMDemangle", "Demangle.cpp", "ItaniumDemangle.cpp", "MicrosoftDemangle.cpp", "MicrosoftDemangleNodes.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Demangle")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib/Support")
     ctx.set(ctx, "system_libs")
     ctx.set(ctx, "delayload_flags")
-    ctx.add_llvm_library(ctx, "LLVMSupport", "AArch64TargetParser.cpp", "ARMTargetParser.cpp", "AMDGPUMetadata.cpp", "APFloat.cpp", "APInt.cpp", "APSInt.cpp", "ARMBuildAttrs.cpp", "ARMAttributeParser.cpp", "ARMWinEH.cpp", "Allocator.cpp", "BinaryStreamError.cpp", "BinaryStreamReader.cpp", "BinaryStreamRef.cpp", "BinaryStreamWriter.cpp", "BlockFrequency.cpp", "BranchProbability.cpp", "BuryPointer.cpp", "CachePruning.cpp", "circular_raw_ostream.cpp", "Chrono.cpp", "COM.cpp", "CodeGenCoverage.cpp", "CommandLine.cpp", "Compression.cpp", "CRC.cpp", "ConvertUTF.cpp", "ConvertUTFWrapper.cpp", "CrashRecoveryContext.cpp", "DataExtractor.cpp", "Debug.cpp", "DebugCounter.cpp", "DeltaAlgorithm.cpp", "DAGDeltaAlgorithm.cpp", "DJB.cpp", "Error.cpp", "ErrorHandling.cpp", "FileCheck.cpp", "FileUtilities.cpp", "FileOutputBuffer.cpp", "FoldingSet.cpp", "FormattedStream.cpp", "FormatVariadic.cpp", "GlobPattern.cpp", "GraphWriter.cpp", "Hashing.cpp", "InitLLVM.cpp", "IntEqClasses.cpp", "IntervalMap.cpp", "ItaniumManglingCanonicalizer.cpp", "JamCRC.cpp", "JSON.cpp", "KnownBits.cpp", "LEB128.cpp", "LineIterator.cpp", "Locale.cpp", "LockFileManager.cpp", "LowLevelType.cpp", "ManagedStatic.cpp", "MathExtras.cpp", "MemoryBuffer.cpp", "MD5.cpp", "NativeFormatting.cpp", "Optional.cpp", "Options.cpp", "Parallel.cpp", "PluginLoader.cpp", "PrettyStackTrace.cpp", "RandomNumberGenerator.cpp", "Regex.cpp", "ScaledNumber.cpp", "ScopedPrinter.cpp", "SHA1.cpp", "Signposts.cpp", "SmallPtrSet.cpp", "SmallVector.cpp", "SourceMgr.cpp", "SpecialCaseList.cpp", "Statistic.cpp", "StringExtras.cpp", "StringMap.cpp", "StringPool.cpp", "StringSaver.cpp", "StringRef.cpp", "SymbolRemappingReader.cpp", "SystemUtils.cpp", "TarWriter.cpp", "TargetParser.cpp", "ThreadPool.cpp", "TimeProfiler.cpp", "Timer.cpp", "ToolOutputFile.cpp", "TrigramIndex.cpp", "Triple.cpp", "Twine.cpp", "Unicode.cpp", "UnicodeCaseFold.cpp", "VersionTuple.cpp", "VirtualFileSystem.cpp", "WithColor.cpp", "YAMLParser.cpp", "YAMLTraits.cpp", "raw_os_ostream.cpp", "raw_ostream.cpp", "regcomp.c", "regerror.c", "regexec.c", "regfree.c", "regstrlcpy.c", "xxhash.cpp", "Z3Solver.cpp", "Atomic.cpp", "DynamicLibrary.cpp", "Errno.cpp", "Host.cpp", "Memory.cpp", "Mutex.cpp", "Path.cpp", "Process.cpp", "Program.cpp", "RWMutex.cpp", "Signals.cpp", "TargetRegistry.cpp", "ThreadLocal.cpp", "Threading.cpp", "Valgrind.cpp", "Watchdog.cpp", "ADDITIONAL_HEADER_DIRS", "Unix", "Windows", "/include/llvm/ADT", "/include/llvm/Support", "", "LINK_LIBS", "", "", "")
-    ctx = ctx.exit_directory(ctx, "lib/Support")
-    ctx = ctx.enter_directory(ctx, "lib/TableGen")
-    ctx.add_llvm_library(ctx, "LLVMTableGen", "Error.cpp", "JSONBackend.cpp", "Main.cpp", "Record.cpp", "SetTheory.cpp", "StringMatcher.cpp", "TableGenBackend.cpp", "TGLexer.cpp", "TGParser.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/TableGen")
-    ctx = ctx.exit_directory(ctx, "lib/TableGen")
-    ctx = ctx.enter_directory(ctx, "utils/TableGen")
+    ctx.add_llvm_library(ctx, "LLVMSupport", "AArch64TargetParser.cpp", "ARMTargetParser.cpp", "AMDGPUMetadata.cpp", "APFloat.cpp", "APInt.cpp", "APSInt.cpp", "ARMBuildAttrs.cpp", "ARMAttributeParser.cpp", "ARMWinEH.cpp", "Allocator.cpp", "BinaryStreamError.cpp", "BinaryStreamReader.cpp", "BinaryStreamRef.cpp", "BinaryStreamWriter.cpp", "BlockFrequency.cpp", "BranchProbability.cpp", "BuryPointer.cpp", "CachePruning.cpp", "circular_raw_ostream.cpp", "Chrono.cpp", "COM.cpp", "CodeGenCoverage.cpp", "CommandLine.cpp", "Compression.cpp", "CRC.cpp", "ConvertUTF.cpp", "ConvertUTFWrapper.cpp", "CrashRecoveryContext.cpp", "DataExtractor.cpp", "Debug.cpp", "DebugCounter.cpp", "DeltaAlgorithm.cpp", "DAGDeltaAlgorithm.cpp", "DJB.cpp", "Error.cpp", "ErrorHandling.cpp", "FileCheck.cpp", "FileUtilities.cpp", "FileOutputBuffer.cpp", "FoldingSet.cpp", "FormattedStream.cpp", "FormatVariadic.cpp", "GlobPattern.cpp", "GraphWriter.cpp", "Hashing.cpp", "InitLLVM.cpp", "IntEqClasses.cpp", "IntervalMap.cpp", "ItaniumManglingCanonicalizer.cpp", "JamCRC.cpp", "JSON.cpp", "KnownBits.cpp", "LEB128.cpp", "LineIterator.cpp", "Locale.cpp", "LockFileManager.cpp", "LowLevelType.cpp", "ManagedStatic.cpp", "MathExtras.cpp", "MemoryBuffer.cpp", "MD5.cpp", "NativeFormatting.cpp", "Optional.cpp", "Options.cpp", "Parallel.cpp", "PluginLoader.cpp", "PrettyStackTrace.cpp", "RandomNumberGenerator.cpp", "Regex.cpp", "ScaledNumber.cpp", "ScopedPrinter.cpp", "SHA1.cpp", "Signposts.cpp", "SmallPtrSet.cpp", "SmallVector.cpp", "SourceMgr.cpp", "SpecialCaseList.cpp", "Statistic.cpp", "StringExtras.cpp", "StringMap.cpp", "StringPool.cpp", "StringSaver.cpp", "StringRef.cpp", "SymbolRemappingReader.cpp", "SystemUtils.cpp", "TarWriter.cpp", "TargetParser.cpp", "ThreadPool.cpp", "TimeProfiler.cpp", "Timer.cpp", "ToolOutputFile.cpp", "TrigramIndex.cpp", "Triple.cpp", "Twine.cpp", "Unicode.cpp", "UnicodeCaseFold.cpp", "VersionTuple.cpp", "VirtualFileSystem.cpp", "WithColor.cpp", "YAMLParser.cpp", "YAMLTraits.cpp", "raw_os_ostream.cpp", "raw_ostream.cpp", "regcomp.c", "regerror.c", "regexec.c", "regfree.c", "regstrlcpy.c", "xxhash.cpp", "Z3Solver.cpp", "Atomic.cpp", "DynamicLibrary.cpp", "Errno.cpp", "Host.cpp", "Memory.cpp", "Mutex.cpp", "Path.cpp", "Process.cpp", "Program.cpp", "RWMutex.cpp", "Signals.cpp", "TargetRegistry.cpp", "ThreadLocal.cpp", "Threading.cpp", "Valgrind.cpp", "Watchdog.cpp", "ADDITIONAL_HEADER_DIRS", "Unix", "Windows", "/root/include/llvm/ADT", "/root/include/llvm/Support", "", "LINK_LIBS", "", "", "")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib/TableGen")
+    ctx.add_llvm_library(ctx, "LLVMTableGen", "Error.cpp", "JSONBackend.cpp", "Main.cpp", "Record.cpp", "SetTheory.cpp", "StringMatcher.cpp", "TableGenBackend.cpp", "TGLexer.cpp", "TGParser.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/TableGen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "utils/TableGen")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_tablegen(ctx, "llvm-tblgen", "LLVM", "AsmMatcherEmitter.cpp", "AsmWriterEmitter.cpp", "AsmWriterInst.cpp", "Attributes.cpp", "CallingConvEmitter.cpp", "CodeEmitterGen.cpp", "CodeGenDAGPatterns.cpp", "CodeGenHwModes.cpp", "CodeGenInstruction.cpp", "CodeGenMapTable.cpp", "CodeGenRegisters.cpp", "CodeGenSchedule.cpp", "CodeGenTarget.cpp", "DAGISelEmitter.cpp", "DAGISelMatcherEmitter.cpp", "DAGISelMatcherGen.cpp", "DAGISelMatcherOpt.cpp", "DAGISelMatcher.cpp", "DFAPacketizerEmitter.cpp", "DisassemblerEmitter.cpp", "ExegesisEmitter.cpp", "FastISelEmitter.cpp", "FixedLenDecoderEmitter.cpp", "GlobalISelEmitter.cpp", "InfoByHwMode.cpp", "InstrInfoEmitter.cpp", "InstrDocsEmitter.cpp", "IntrinsicEmitter.cpp", "OptParserEmitter.cpp", "PredicateExpander.cpp", "PseudoLoweringEmitter.cpp", "RISCVCompressInstEmitter.cpp", "RegisterBankEmitter.cpp", "RegisterInfoEmitter.cpp", "SDNodeProperties.cpp", "SearchableTableEmitter.cpp", "SubtargetEmitter.cpp", "SubtargetFeatureInfo.cpp", "TableGen.cpp", "Types.cpp", "X86DisassemblerTables.cpp", "X86EVEX2VEXTablesEmitter.cpp", "X86FoldTablesEmitter.cpp", "X86ModRMFilters.cpp", "X86RecognizableInstr.cpp", "WebAssemblyDisassemblerEmitter.cpp", "CTagsEmitter.cpp")
-    ctx = ctx.exit_directory(ctx, "utils/TableGen")
-    ctx = ctx.enter_directory(ctx, "include/llvm")
-    ctx = ctx.enter_directory(ctx, "IR")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "include/llvm")
+    ctx = ctx.push_directory(ctx, "IR")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "Attributes.td")
     ctx.tablegen(ctx, "LLVM", "Attributes.inc", "-gen-attrs")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "Intrinsics.td")
     ctx.tablegen(ctx, "LLVM", "IntrinsicEnums.inc", "-gen-intrinsic-enums")
     ctx.tablegen(ctx, "LLVM", "IntrinsicImpl.inc", "-gen-intrinsic-impl")
     ctx.add_public_tablegen_target(ctx, "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "IR")
-    ctx = ctx.enter_directory(ctx, "Support")
-    ctx.set(ctx, "version_inc", "/include/llvm/Support/VCSRevision.h")
-    ctx.set(ctx, "generate_vcs_version_script", "/GenerateVersionFromVCS.cmake")
-    ctx = ctx.exit_directory(ctx, "Support")
-    ctx = ctx.exit_directory(ctx, "include/llvm")
-    ctx = ctx.enter_directory(ctx, "lib")
-    ctx = ctx.enter_directory(ctx, "IR")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Support")
+    ctx.set(ctx, "version_inc", "/root/include/llvm/Support/VCSRevision.h")
+    ctx.set(ctx, "generate_vcs_version_script", "/root/cmake/modules/GenerateVersionFromVCS.cmake")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib")
+    ctx = ctx.push_directory(ctx, "IR")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "AttributesCompatFunc.td")
     ctx.tablegen(ctx, "LLVM", "AttributesCompatFunc.inc", "-gen-attrs")
     ctx.add_public_tablegen_target(ctx, "AttributeCompatFuncTableGen")
-    ctx.add_llvm_library(ctx, "LLVMCore", "AbstractCallSite.cpp", "AsmWriter.cpp", "Attributes.cpp", "AutoUpgrade.cpp", "BasicBlock.cpp", "Comdat.cpp", "ConstantFold.cpp", "ConstantRange.cpp", "Constants.cpp", "Core.cpp", "DIBuilder.cpp", "DataLayout.cpp", "DebugInfo.cpp", "DebugInfoMetadata.cpp", "DebugLoc.cpp", "DiagnosticHandler.cpp", "DiagnosticInfo.cpp", "DiagnosticPrinter.cpp", "Dominators.cpp", "Function.cpp", "GVMaterializer.cpp", "Globals.cpp", "IRBuilder.cpp", "IRPrintingPasses.cpp", "InlineAsm.cpp", "Instruction.cpp", "Instructions.cpp", "IntrinsicInst.cpp", "LLVMContext.cpp", "LLVMContextImpl.cpp", "LegacyPassManager.cpp", "MDBuilder.cpp", "Mangler.cpp", "Metadata.cpp", "Module.cpp", "ModuleSummaryIndex.cpp", "Operator.cpp", "OptBisect.cpp", "Pass.cpp", "PassInstrumentation.cpp", "PassManager.cpp", "PassRegistry.cpp", "PassTimingInfo.cpp", "RemarkStreamer.cpp", "SafepointIRVerifier.cpp", "ProfileSummary.cpp", "Statepoint.cpp", "Type.cpp", "TypeFinder.cpp", "Use.cpp", "User.cpp", "Value.cpp", "ValueSymbolTable.cpp", "Verifier.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/IR", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "IR")
-    ctx = ctx.enter_directory(ctx, "FuzzMutate")
-    ctx.add_llvm_library(ctx, "LLVMFuzzMutate", "FuzzerCLI.cpp", "IRMutator.cpp", "OpDescriptor.cpp", "Operations.cpp", "RandomIRBuilder.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/FuzzMutate", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "FuzzMutate")
-    ctx = ctx.enter_directory(ctx, "IRReader")
-    ctx.add_llvm_library(ctx, "LLVMIRReader", "IRReader.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/IRReader", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "IRReader")
-    ctx = ctx.enter_directory(ctx, "CodeGen")
-    ctx.add_llvm_library(ctx, "LLVMCodeGen", "AggressiveAntiDepBreaker.cpp", "AllocationOrder.cpp", "Analysis.cpp", "AtomicExpandPass.cpp", "BasicTargetTransformInfo.cpp", "BranchFolding.cpp", "BranchRelaxation.cpp", "BreakFalseDeps.cpp", "BuiltinGCs.cpp", "CalcSpillWeights.cpp", "CallingConvLower.cpp", "CFIInstrInserter.cpp", "CodeGen.cpp", "CodeGenPrepare.cpp", "CriticalAntiDepBreaker.cpp", "DeadMachineInstructionElim.cpp", "DetectDeadLanes.cpp", "DFAPacketizer.cpp", "DwarfEHPrepare.cpp", "EarlyIfConversion.cpp", "EdgeBundles.cpp", "ExecutionDomainFix.cpp", "ExpandISelPseudos.cpp", "ExpandMemCmp.cpp", "ExpandPostRAPseudos.cpp", "ExpandReductions.cpp", "FaultMaps.cpp", "FEntryInserter.cpp", "FuncletLayout.cpp", "GCMetadata.cpp", "GCMetadataPrinter.cpp", "GCRootLowering.cpp", "GCStrategy.cpp", "GlobalMerge.cpp", "HardwareLoops.cpp", "IfConversion.cpp", "ImplicitNullChecks.cpp", "IndirectBrExpandPass.cpp", "InlineSpiller.cpp", "InterferenceCache.cpp", "InterleavedAccessPass.cpp", "InterleavedLoadCombinePass.cpp", "IntrinsicLowering.cpp", "LatencyPriorityQueue.cpp", "LazyMachineBlockFrequencyInfo.cpp", "LexicalScopes.cpp", "LiveDebugValues.cpp", "LiveDebugVariables.cpp", "LiveIntervals.cpp", "LiveInterval.cpp", "LiveIntervalUnion.cpp", "LivePhysRegs.cpp", "LiveRangeCalc.cpp", "LiveRangeEdit.cpp", "LiveRangeShrink.cpp", "LiveRegMatrix.cpp", "LiveRegUnits.cpp", "LiveStacks.cpp", "LiveVariables.cpp", "LLVMTargetMachine.cpp", "LocalStackSlotAllocation.cpp", "LoopTraversal.cpp", "LowLevelType.cpp", "LowerEmuTLS.cpp", "MachineBasicBlock.cpp", "MachineBlockFrequencyInfo.cpp", "MachineBlockPlacement.cpp", "MachineBranchProbabilityInfo.cpp", "MachineCombiner.cpp", "MachineCopyPropagation.cpp", "MachineCSE.cpp", "MachineDominanceFrontier.cpp", "MachineDominators.cpp", "MachineFrameInfo.cpp", "MachineFunction.cpp", "MachineFunctionPass.cpp", "MachineFunctionPrinterPass.cpp", "MachineInstrBundle.cpp", "MachineInstr.cpp", "MachineLICM.cpp", "MachineLoopInfo.cpp", "MachineModuleInfo.cpp", "MachineModuleInfoImpls.cpp", "MachineOperand.cpp", "MachineOptimizationRemarkEmitter.cpp", "MachineOutliner.cpp", "MachinePipeliner.cpp", "MachinePostDominators.cpp", "MachineRegionInfo.cpp", "MachineRegisterInfo.cpp", "MachineScheduler.cpp", "MachineSink.cpp", "MachineSSAUpdater.cpp", "MachineTraceMetrics.cpp", "MachineVerifier.cpp", "PatchableFunction.cpp", "MIRPrinter.cpp", "MIRPrintingPass.cpp", "MacroFusion.cpp", "OptimizePHIs.cpp", "ParallelCG.cpp", "PeepholeOptimizer.cpp", "PHIElimination.cpp", "PHIEliminationUtils.cpp", "PostRAHazardRecognizer.cpp", "PostRASchedulerList.cpp", "PreISelIntrinsicLowering.cpp", "ProcessImplicitDefs.cpp", "PrologEpilogInserter.cpp", "PseudoSourceValue.cpp", "ReachingDefAnalysis.cpp", "RegAllocBase.cpp", "RegAllocBasic.cpp", "RegAllocFast.cpp", "RegAllocGreedy.cpp", "RegAllocPBQP.cpp", "RegisterClassInfo.cpp", "RegisterCoalescer.cpp", "RegisterPressure.cpp", "RegisterScavenging.cpp", "RenameIndependentSubregs.cpp", "MIRCanonicalizerPass.cpp", "RegisterUsageInfo.cpp", "RegUsageInfoCollector.cpp", "RegUsageInfoPropagate.cpp", "ResetMachineFunctionPass.cpp", "SafeStack.cpp", "SafeStackColoring.cpp", "SafeStackLayout.cpp", "ScalarizeMaskedMemIntrin.cpp", "ScheduleDAG.cpp", "ScheduleDAGInstrs.cpp", "ScheduleDAGPrinter.cpp", "ScoreboardHazardRecognizer.cpp", "ShadowStackGCLowering.cpp", "ShrinkWrap.cpp", "SjLjEHPrepare.cpp", "SlotIndexes.cpp", "SpillPlacement.cpp", "SplitKit.cpp", "StackColoring.cpp", "StackMapLivenessAnalysis.cpp", "StackMaps.cpp", "StackProtector.cpp", "StackSlotColoring.cpp", "SwiftErrorValueTracking.cpp", "SwitchLoweringUtils.cpp", "TailDuplication.cpp", "TailDuplicator.cpp", "TargetFrameLoweringImpl.cpp", "TargetInstrInfo.cpp", "TargetLoweringBase.cpp", "TargetLoweringObjectFileImpl.cpp", "TargetOptionsImpl.cpp", "TargetPassConfig.cpp", "TargetRegisterInfo.cpp", "TargetSchedule.cpp", "TargetSubtargetInfo.cpp", "TwoAddressInstructionPass.cpp", "UnreachableBlockElim.cpp", "ValueTypes.cpp", "VirtRegMap.cpp", "WasmEHPrepare.cpp", "WinEHPrepare.cpp", "XRayInstrumentation.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/CodeGen", "/include/llvm/CodeGen/PBQP", "LINK_LIBS", "", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.enter_directory(ctx, "SelectionDAG")
+    ctx.add_llvm_library(ctx, "LLVMCore", "AbstractCallSite.cpp", "AsmWriter.cpp", "Attributes.cpp", "AutoUpgrade.cpp", "BasicBlock.cpp", "Comdat.cpp", "ConstantFold.cpp", "ConstantRange.cpp", "Constants.cpp", "Core.cpp", "DIBuilder.cpp", "DataLayout.cpp", "DebugInfo.cpp", "DebugInfoMetadata.cpp", "DebugLoc.cpp", "DiagnosticHandler.cpp", "DiagnosticInfo.cpp", "DiagnosticPrinter.cpp", "Dominators.cpp", "Function.cpp", "GVMaterializer.cpp", "Globals.cpp", "IRBuilder.cpp", "IRPrintingPasses.cpp", "InlineAsm.cpp", "Instruction.cpp", "Instructions.cpp", "IntrinsicInst.cpp", "LLVMContext.cpp", "LLVMContextImpl.cpp", "LegacyPassManager.cpp", "MDBuilder.cpp", "Mangler.cpp", "Metadata.cpp", "Module.cpp", "ModuleSummaryIndex.cpp", "Operator.cpp", "OptBisect.cpp", "Pass.cpp", "PassInstrumentation.cpp", "PassManager.cpp", "PassRegistry.cpp", "PassTimingInfo.cpp", "RemarkStreamer.cpp", "SafepointIRVerifier.cpp", "ProfileSummary.cpp", "Statepoint.cpp", "Type.cpp", "TypeFinder.cpp", "Use.cpp", "User.cpp", "Value.cpp", "ValueSymbolTable.cpp", "Verifier.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/IR", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "FuzzMutate")
+    ctx.add_llvm_library(ctx, "LLVMFuzzMutate", "FuzzerCLI.cpp", "IRMutator.cpp", "OpDescriptor.cpp", "Operations.cpp", "RandomIRBuilder.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/FuzzMutate", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "IRReader")
+    ctx.add_llvm_library(ctx, "LLVMIRReader", "IRReader.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/IRReader", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "CodeGen")
+    ctx.add_llvm_library(ctx, "LLVMCodeGen", "AggressiveAntiDepBreaker.cpp", "AllocationOrder.cpp", "Analysis.cpp", "AtomicExpandPass.cpp", "BasicTargetTransformInfo.cpp", "BranchFolding.cpp", "BranchRelaxation.cpp", "BreakFalseDeps.cpp", "BuiltinGCs.cpp", "CalcSpillWeights.cpp", "CallingConvLower.cpp", "CFIInstrInserter.cpp", "CodeGen.cpp", "CodeGenPrepare.cpp", "CriticalAntiDepBreaker.cpp", "DeadMachineInstructionElim.cpp", "DetectDeadLanes.cpp", "DFAPacketizer.cpp", "DwarfEHPrepare.cpp", "EarlyIfConversion.cpp", "EdgeBundles.cpp", "ExecutionDomainFix.cpp", "ExpandISelPseudos.cpp", "ExpandMemCmp.cpp", "ExpandPostRAPseudos.cpp", "ExpandReductions.cpp", "FaultMaps.cpp", "FEntryInserter.cpp", "FuncletLayout.cpp", "GCMetadata.cpp", "GCMetadataPrinter.cpp", "GCRootLowering.cpp", "GCStrategy.cpp", "GlobalMerge.cpp", "HardwareLoops.cpp", "IfConversion.cpp", "ImplicitNullChecks.cpp", "IndirectBrExpandPass.cpp", "InlineSpiller.cpp", "InterferenceCache.cpp", "InterleavedAccessPass.cpp", "InterleavedLoadCombinePass.cpp", "IntrinsicLowering.cpp", "LatencyPriorityQueue.cpp", "LazyMachineBlockFrequencyInfo.cpp", "LexicalScopes.cpp", "LiveDebugValues.cpp", "LiveDebugVariables.cpp", "LiveIntervals.cpp", "LiveInterval.cpp", "LiveIntervalUnion.cpp", "LivePhysRegs.cpp", "LiveRangeCalc.cpp", "LiveRangeEdit.cpp", "LiveRangeShrink.cpp", "LiveRegMatrix.cpp", "LiveRegUnits.cpp", "LiveStacks.cpp", "LiveVariables.cpp", "LLVMTargetMachine.cpp", "LocalStackSlotAllocation.cpp", "LoopTraversal.cpp", "LowLevelType.cpp", "LowerEmuTLS.cpp", "MachineBasicBlock.cpp", "MachineBlockFrequencyInfo.cpp", "MachineBlockPlacement.cpp", "MachineBranchProbabilityInfo.cpp", "MachineCombiner.cpp", "MachineCopyPropagation.cpp", "MachineCSE.cpp", "MachineDominanceFrontier.cpp", "MachineDominators.cpp", "MachineFrameInfo.cpp", "MachineFunction.cpp", "MachineFunctionPass.cpp", "MachineFunctionPrinterPass.cpp", "MachineInstrBundle.cpp", "MachineInstr.cpp", "MachineLICM.cpp", "MachineLoopInfo.cpp", "MachineModuleInfo.cpp", "MachineModuleInfoImpls.cpp", "MachineOperand.cpp", "MachineOptimizationRemarkEmitter.cpp", "MachineOutliner.cpp", "MachinePipeliner.cpp", "MachinePostDominators.cpp", "MachineRegionInfo.cpp", "MachineRegisterInfo.cpp", "MachineScheduler.cpp", "MachineSink.cpp", "MachineSSAUpdater.cpp", "MachineTraceMetrics.cpp", "MachineVerifier.cpp", "PatchableFunction.cpp", "MIRPrinter.cpp", "MIRPrintingPass.cpp", "MacroFusion.cpp", "OptimizePHIs.cpp", "ParallelCG.cpp", "PeepholeOptimizer.cpp", "PHIElimination.cpp", "PHIEliminationUtils.cpp", "PostRAHazardRecognizer.cpp", "PostRASchedulerList.cpp", "PreISelIntrinsicLowering.cpp", "ProcessImplicitDefs.cpp", "PrologEpilogInserter.cpp", "PseudoSourceValue.cpp", "ReachingDefAnalysis.cpp", "RegAllocBase.cpp", "RegAllocBasic.cpp", "RegAllocFast.cpp", "RegAllocGreedy.cpp", "RegAllocPBQP.cpp", "RegisterClassInfo.cpp", "RegisterCoalescer.cpp", "RegisterPressure.cpp", "RegisterScavenging.cpp", "RenameIndependentSubregs.cpp", "MIRCanonicalizerPass.cpp", "RegisterUsageInfo.cpp", "RegUsageInfoCollector.cpp", "RegUsageInfoPropagate.cpp", "ResetMachineFunctionPass.cpp", "SafeStack.cpp", "SafeStackColoring.cpp", "SafeStackLayout.cpp", "ScalarizeMaskedMemIntrin.cpp", "ScheduleDAG.cpp", "ScheduleDAGInstrs.cpp", "ScheduleDAGPrinter.cpp", "ScoreboardHazardRecognizer.cpp", "ShadowStackGCLowering.cpp", "ShrinkWrap.cpp", "SjLjEHPrepare.cpp", "SlotIndexes.cpp", "SpillPlacement.cpp", "SplitKit.cpp", "StackColoring.cpp", "StackMapLivenessAnalysis.cpp", "StackMaps.cpp", "StackProtector.cpp", "StackSlotColoring.cpp", "SwiftErrorValueTracking.cpp", "SwitchLoweringUtils.cpp", "TailDuplication.cpp", "TailDuplicator.cpp", "TargetFrameLoweringImpl.cpp", "TargetInstrInfo.cpp", "TargetLoweringBase.cpp", "TargetLoweringObjectFileImpl.cpp", "TargetOptionsImpl.cpp", "TargetPassConfig.cpp", "TargetRegisterInfo.cpp", "TargetSchedule.cpp", "TargetSubtargetInfo.cpp", "TwoAddressInstructionPass.cpp", "UnreachableBlockElim.cpp", "ValueTypes.cpp", "VirtRegMap.cpp", "WasmEHPrepare.cpp", "WinEHPrepare.cpp", "XRayInstrumentation.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/CodeGen", "/root/include/llvm/CodeGen/PBQP", "LINK_LIBS", "", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.push_directory(ctx, "SelectionDAG")
     ctx.add_llvm_library(ctx, "LLVMSelectionDAG", "DAGCombiner.cpp", "FastISel.cpp", "FunctionLoweringInfo.cpp", "InstrEmitter.cpp", "LegalizeDAG.cpp", "LegalizeFloatTypes.cpp", "LegalizeIntegerTypes.cpp", "LegalizeTypes.cpp", "LegalizeTypesGeneric.cpp", "LegalizeVectorOps.cpp", "LegalizeVectorTypes.cpp", "ResourcePriorityQueue.cpp", "ScheduleDAGFast.cpp", "ScheduleDAGRRList.cpp", "ScheduleDAGSDNodes.cpp", "ScheduleDAGVLIW.cpp", "SelectionDAGBuilder.cpp", "SelectionDAG.cpp", "SelectionDAGAddressAnalysis.cpp", "SelectionDAGDumper.cpp", "SelectionDAGISel.cpp", "SelectionDAGPrinter.cpp", "SelectionDAGTargetInfo.cpp", "StatepointLowering.cpp", "TargetLowering.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "SelectionDAG")
-    ctx = ctx.enter_directory(ctx, "AsmPrinter")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "AsmPrinter")
     ctx.add_llvm_library(ctx, "LLVMAsmPrinter", "AccelTable.cpp", "AddressPool.cpp", "ARMException.cpp", "AsmPrinter.cpp", "AsmPrinterDwarf.cpp", "AsmPrinterInlineAsm.cpp", "DbgEntityHistoryCalculator.cpp", "DebugHandlerBase.cpp", "DebugLocStream.cpp", "DIE.cpp", "DIEHash.cpp", "DwarfCFIException.cpp", "DwarfCompileUnit.cpp", "DwarfDebug.cpp", "DwarfExpression.cpp", "DwarfFile.cpp", "DwarfStringPool.cpp", "DwarfUnit.cpp", "EHStreamer.cpp", "ErlangGCPrinter.cpp", "OcamlGCPrinter.cpp", "WinCFGuard.cpp", "WinException.cpp", "CodeViewDebug.cpp", "WasmException.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "AsmPrinter")
-    ctx = ctx.enter_directory(ctx, "MIRParser")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MIRParser")
     ctx.add_llvm_library(ctx, "LLVMMIRParser", "MILexer.cpp", "MIParser.cpp", "MIRParser.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "MIRParser")
-    ctx = ctx.enter_directory(ctx, "GlobalISel")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "GlobalISel")
     ctx.add_llvm_library(ctx, "LLVMGlobalISel", "CSEInfo.cpp", "CSEMIRBuilder.cpp", "CallLowering.cpp", "GlobalISel.cpp", "Combiner.cpp", "CombinerHelper.cpp", "GISelChangeObserver.cpp", "IRTranslator.cpp", "InstructionSelect.cpp", "InstructionSelector.cpp", "LegalityPredicates.cpp", "LegalizeMutations.cpp", "Legalizer.cpp", "LegalizerHelper.cpp", "LegalizerInfo.cpp", "Localizer.cpp", "MachineIRBuilder.cpp", "RegBankSelect.cpp", "RegisterBank.cpp", "RegisterBankInfo.cpp", "Utils.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "GlobalISel")
-    ctx = ctx.exit_directory(ctx, "CodeGen")
-    ctx = ctx.enter_directory(ctx, "BinaryFormat")
-    ctx.add_llvm_library(ctx, "LLVMBinaryFormat", "AMDGPUMetadataVerifier.cpp", "Dwarf.cpp", "Magic.cpp", "Minidump.cpp", "MsgPackDocument.cpp", "MsgPackDocumentYAML.cpp", "MsgPackReader.cpp", "MsgPackWriter.cpp", "Wasm.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/BinaryFormat")
-    ctx = ctx.exit_directory(ctx, "BinaryFormat")
-    ctx = ctx.enter_directory(ctx, "Bitcode")
-    ctx = ctx.enter_directory(ctx, "Reader")
-    ctx.add_llvm_library(ctx, "LLVMBitReader", "BitReader.cpp", "BitcodeReader.cpp", "BitstreamReader.cpp", "MetadataLoader.cpp", "ValueList.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Bitcode", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Reader")
-    ctx = ctx.enter_directory(ctx, "Writer")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "BinaryFormat")
+    ctx.add_llvm_library(ctx, "LLVMBinaryFormat", "AMDGPUMetadataVerifier.cpp", "Dwarf.cpp", "Magic.cpp", "Minidump.cpp", "MsgPackDocument.cpp", "MsgPackDocumentYAML.cpp", "MsgPackReader.cpp", "MsgPackWriter.cpp", "Wasm.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/BinaryFormat")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Bitcode")
+    ctx = ctx.push_directory(ctx, "Reader")
+    ctx.add_llvm_library(ctx, "LLVMBitReader", "BitReader.cpp", "BitcodeReader.cpp", "BitstreamReader.cpp", "MetadataLoader.cpp", "ValueList.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Bitcode", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Writer")
     ctx.add_llvm_library(ctx, "LLVMBitWriter", "BitWriter.cpp", "BitcodeWriter.cpp", "BitcodeWriterPass.cpp", "ValueEnumerator.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Writer")
-    ctx = ctx.exit_directory(ctx, "Bitcode")
-    ctx = ctx.enter_directory(ctx, "Transforms")
-    ctx = ctx.enter_directory(ctx, "Utils")
-    ctx.add_llvm_library(ctx, "LLVMTransformUtils", "ASanStackFrameLayout.cpp", "AddDiscriminators.cpp", "BasicBlockUtils.cpp", "BreakCriticalEdges.cpp", "BuildLibCalls.cpp", "BypassSlowDivision.cpp", "CallPromotionUtils.cpp", "CanonicalizeAliases.cpp", "CloneFunction.cpp", "CloneModule.cpp", "CodeExtractor.cpp", "CtorUtils.cpp", "DemoteRegToStack.cpp", "EntryExitInstrumenter.cpp", "EscapeEnumerator.cpp", "Evaluator.cpp", "FlattenCFG.cpp", "FunctionComparator.cpp", "FunctionImportUtils.cpp", "GlobalStatus.cpp", "GuardUtils.cpp", "InlineFunction.cpp", "ImportedFunctionsInliningStatistics.cpp", "InstructionNamer.cpp", "IntegerDivision.cpp", "LCSSA.cpp", "LibCallsShrinkWrap.cpp", "Local.cpp", "LoopRotationUtils.cpp", "LoopSimplify.cpp", "LoopUnroll.cpp", "LoopUnrollAndJam.cpp", "LoopUnrollPeel.cpp", "LoopUnrollRuntime.cpp", "LoopUtils.cpp", "LoopVersioning.cpp", "LowerInvoke.cpp", "LowerMemIntrinsics.cpp", "LowerSwitch.cpp", "Mem2Reg.cpp", "MetaRenamer.cpp", "ModuleUtils.cpp", "NameAnonGlobals.cpp", "PredicateInfo.cpp", "PromoteMemoryToRegister.cpp", "StripGCRelocates.cpp", "SSAUpdater.cpp", "SSAUpdaterBulk.cpp", "SanitizerStats.cpp", "SimplifyCFG.cpp", "SimplifyIndVar.cpp", "SimplifyLibCalls.cpp", "SizeOpts.cpp", "SplitModule.cpp", "StripNonLineTableDebugInfo.cpp", "SymbolRewriter.cpp", "UnifyFunctionExitNodes.cpp", "Utils.cpp", "ValueMapper.cpp", "VNCoercion.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "/include/llvm/Transforms/Utils", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Utils")
-    ctx = ctx.enter_directory(ctx, "Instrumentation")
-    ctx.add_llvm_library(ctx, "LLVMInstrumentation", "AddressSanitizer.cpp", "BoundsChecking.cpp", "CGProfile.cpp", "ControlHeightReduction.cpp", "DataFlowSanitizer.cpp", "GCOVProfiling.cpp", "MemorySanitizer.cpp", "IndirectCallPromotion.cpp", "Instrumentation.cpp", "InstrOrderFile.cpp", "InstrProfiling.cpp", "PGOInstrumentation.cpp", "PGOMemOPSizeOpt.cpp", "SanitizerCoverage.cpp", "ThreadSanitizer.cpp", "HWAddressSanitizer.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Instrumentation")
-    ctx = ctx.enter_directory(ctx, "AggressiveInstCombine")
-    ctx.add_llvm_library(ctx, "LLVMAggressiveInstCombine", "AggressiveInstCombine.cpp", "TruncInstCombine.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "/include/llvm/Transforms/AggressiveInstCombine", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "AggressiveInstCombine")
-    ctx = ctx.enter_directory(ctx, "InstCombine")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Transforms")
+    ctx = ctx.push_directory(ctx, "Utils")
+    ctx.add_llvm_library(ctx, "LLVMTransformUtils", "ASanStackFrameLayout.cpp", "AddDiscriminators.cpp", "BasicBlockUtils.cpp", "BreakCriticalEdges.cpp", "BuildLibCalls.cpp", "BypassSlowDivision.cpp", "CallPromotionUtils.cpp", "CanonicalizeAliases.cpp", "CloneFunction.cpp", "CloneModule.cpp", "CodeExtractor.cpp", "CtorUtils.cpp", "DemoteRegToStack.cpp", "EntryExitInstrumenter.cpp", "EscapeEnumerator.cpp", "Evaluator.cpp", "FlattenCFG.cpp", "FunctionComparator.cpp", "FunctionImportUtils.cpp", "GlobalStatus.cpp", "GuardUtils.cpp", "InlineFunction.cpp", "ImportedFunctionsInliningStatistics.cpp", "InstructionNamer.cpp", "IntegerDivision.cpp", "LCSSA.cpp", "LibCallsShrinkWrap.cpp", "Local.cpp", "LoopRotationUtils.cpp", "LoopSimplify.cpp", "LoopUnroll.cpp", "LoopUnrollAndJam.cpp", "LoopUnrollPeel.cpp", "LoopUnrollRuntime.cpp", "LoopUtils.cpp", "LoopVersioning.cpp", "LowerInvoke.cpp", "LowerMemIntrinsics.cpp", "LowerSwitch.cpp", "Mem2Reg.cpp", "MetaRenamer.cpp", "ModuleUtils.cpp", "NameAnonGlobals.cpp", "PredicateInfo.cpp", "PromoteMemoryToRegister.cpp", "StripGCRelocates.cpp", "SSAUpdater.cpp", "SSAUpdaterBulk.cpp", "SanitizerStats.cpp", "SimplifyCFG.cpp", "SimplifyIndVar.cpp", "SimplifyLibCalls.cpp", "SizeOpts.cpp", "SplitModule.cpp", "StripNonLineTableDebugInfo.cpp", "SymbolRewriter.cpp", "UnifyFunctionExitNodes.cpp", "Utils.cpp", "ValueMapper.cpp", "VNCoercion.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "/root/include/llvm/Transforms/Utils", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Instrumentation")
+    ctx.add_llvm_library(ctx, "LLVMInstrumentation", "AddressSanitizer.cpp", "BoundsChecking.cpp", "CGProfile.cpp", "ControlHeightReduction.cpp", "DataFlowSanitizer.cpp", "GCOVProfiling.cpp", "MemorySanitizer.cpp", "IndirectCallPromotion.cpp", "Instrumentation.cpp", "InstrOrderFile.cpp", "InstrProfiling.cpp", "PGOInstrumentation.cpp", "PGOMemOPSizeOpt.cpp", "SanitizerCoverage.cpp", "ThreadSanitizer.cpp", "HWAddressSanitizer.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "AggressiveInstCombine")
+    ctx.add_llvm_library(ctx, "LLVMAggressiveInstCombine", "AggressiveInstCombine.cpp", "TruncInstCombine.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "/root/include/llvm/Transforms/AggressiveInstCombine", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "InstCombine")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "InstCombineTables.td")
     ctx.tablegen(ctx, "LLVM", "InstCombineTables.inc", "-gen-searchable-tables")
     ctx.add_public_tablegen_target(ctx, "InstCombineTableGen")
-    ctx.add_llvm_library(ctx, "LLVMInstCombine", "InstructionCombining.cpp", "InstCombineAddSub.cpp", "InstCombineAtomicRMW.cpp", "InstCombineAndOrXor.cpp", "InstCombineCalls.cpp", "InstCombineCasts.cpp", "InstCombineCompares.cpp", "InstCombineLoadStoreAlloca.cpp", "InstCombineMulDivRem.cpp", "InstCombinePHI.cpp", "InstCombineSelect.cpp", "InstCombineShifts.cpp", "InstCombineSimplifyDemanded.cpp", "InstCombineVectorOps.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "/include/llvm/Transforms/InstCombine", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "InstCombine")
-    ctx = ctx.enter_directory(ctx, "Scalar")
-    ctx.add_llvm_library(ctx, "LLVMScalarOpts", "ADCE.cpp", "AlignmentFromAssumptions.cpp", "BDCE.cpp", "CallSiteSplitting.cpp", "ConstantHoisting.cpp", "ConstantProp.cpp", "CorrelatedValuePropagation.cpp", "DCE.cpp", "DeadStoreElimination.cpp", "DivRemPairs.cpp", "EarlyCSE.cpp", "FlattenCFGPass.cpp", "Float2Int.cpp", "GuardWidening.cpp", "GVN.cpp", "GVNHoist.cpp", "GVNSink.cpp", "IVUsersPrinter.cpp", "InductiveRangeCheckElimination.cpp", "IndVarSimplify.cpp", "InferAddressSpaces.cpp", "InstSimplifyPass.cpp", "JumpThreading.cpp", "LICM.cpp", "LoopAccessAnalysisPrinter.cpp", "LoopSink.cpp", "LoopDeletion.cpp", "LoopDataPrefetch.cpp", "LoopDistribute.cpp", "LoopFuse.cpp", "LoopIdiomRecognize.cpp", "LoopInstSimplify.cpp", "LoopInterchange.cpp", "LoopLoadElimination.cpp", "LoopPassManager.cpp", "LoopPredication.cpp", "LoopRerollPass.cpp", "LoopRotation.cpp", "LoopSimplifyCFG.cpp", "LoopStrengthReduce.cpp", "LoopUnrollPass.cpp", "LoopUnrollAndJamPass.cpp", "LoopUnswitch.cpp", "LoopVersioningLICM.cpp", "LowerAtomic.cpp", "LowerExpectIntrinsic.cpp", "LowerGuardIntrinsic.cpp", "LowerWidenableCondition.cpp", "MakeGuardsExplicit.cpp", "MemCpyOptimizer.cpp", "MergeICmps.cpp", "MergedLoadStoreMotion.cpp", "NaryReassociate.cpp", "NewGVN.cpp", "PartiallyInlineLibCalls.cpp", "PlaceSafepoints.cpp", "Reassociate.cpp", "Reg2Mem.cpp", "RewriteStatepointsForGC.cpp", "SCCP.cpp", "SROA.cpp", "Scalar.cpp", "Scalarizer.cpp", "SeparateConstOffsetFromGEP.cpp", "SimpleLoopUnswitch.cpp", "SimplifyCFGPass.cpp", "Sink.cpp", "SpeculativeExecution.cpp", "SpeculateAroundPHIs.cpp", "StraightLineStrengthReduce.cpp", "StructurizeCFG.cpp", "TailRecursionElimination.cpp", "WarnMissedTransforms.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "/include/llvm/Transforms/Scalar", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Scalar")
-    ctx = ctx.enter_directory(ctx, "IPO")
-    ctx.add_llvm_library(ctx, "LLVMipo", "AlwaysInliner.cpp", "ArgumentPromotion.cpp", "Attributor.cpp", "BarrierNoopPass.cpp", "BlockExtractor.cpp", "CalledValuePropagation.cpp", "ConstantMerge.cpp", "CrossDSOCFI.cpp", "DeadArgumentElimination.cpp", "ElimAvailExtern.cpp", "ExtractGV.cpp", "ForceFunctionAttrs.cpp", "FunctionAttrs.cpp", "FunctionImport.cpp", "GlobalDCE.cpp", "GlobalOpt.cpp", "GlobalSplit.cpp", "HotColdSplitting.cpp", "IPConstantPropagation.cpp", "IPO.cpp", "InferFunctionAttrs.cpp", "InlineSimple.cpp", "Inliner.cpp", "Internalize.cpp", "LoopExtractor.cpp", "LowerTypeTests.cpp", "MergeFunctions.cpp", "PartialInlining.cpp", "PassManagerBuilder.cpp", "PruneEH.cpp", "SampleProfile.cpp", "SCCP.cpp", "StripDeadPrototypes.cpp", "StripSymbols.cpp", "SyntheticCountsPropagation.cpp", "ThinLTOBitcodeWriter.cpp", "WholeProgramDevirt.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "/include/llvm/Transforms/IPO", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "IPO")
-    ctx = ctx.enter_directory(ctx, "Vectorize")
-    ctx.add_llvm_library(ctx, "LLVMVectorize", "LoadStoreVectorizer.cpp", "LoopVectorizationLegality.cpp", "LoopVectorize.cpp", "SLPVectorizer.cpp", "Vectorize.cpp", "VPlan.cpp", "VPlanHCFGBuilder.cpp", "VPlanHCFGTransforms.cpp", "VPlanPredicator.cpp", "VPlanSLP.cpp", "VPlanVerifier.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Vectorize")
-    ctx = ctx.enter_directory(ctx, "Hello")
+    ctx.add_llvm_library(ctx, "LLVMInstCombine", "InstructionCombining.cpp", "InstCombineAddSub.cpp", "InstCombineAtomicRMW.cpp", "InstCombineAndOrXor.cpp", "InstCombineCalls.cpp", "InstCombineCasts.cpp", "InstCombineCompares.cpp", "InstCombineLoadStoreAlloca.cpp", "InstCombineMulDivRem.cpp", "InstCombinePHI.cpp", "InstCombineSelect.cpp", "InstCombineShifts.cpp", "InstCombineSimplifyDemanded.cpp", "InstCombineVectorOps.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "/root/include/llvm/Transforms/InstCombine", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Scalar")
+    ctx.add_llvm_library(ctx, "LLVMScalarOpts", "ADCE.cpp", "AlignmentFromAssumptions.cpp", "BDCE.cpp", "CallSiteSplitting.cpp", "ConstantHoisting.cpp", "ConstantProp.cpp", "CorrelatedValuePropagation.cpp", "DCE.cpp", "DeadStoreElimination.cpp", "DivRemPairs.cpp", "EarlyCSE.cpp", "FlattenCFGPass.cpp", "Float2Int.cpp", "GuardWidening.cpp", "GVN.cpp", "GVNHoist.cpp", "GVNSink.cpp", "IVUsersPrinter.cpp", "InductiveRangeCheckElimination.cpp", "IndVarSimplify.cpp", "InferAddressSpaces.cpp", "InstSimplifyPass.cpp", "JumpThreading.cpp", "LICM.cpp", "LoopAccessAnalysisPrinter.cpp", "LoopSink.cpp", "LoopDeletion.cpp", "LoopDataPrefetch.cpp", "LoopDistribute.cpp", "LoopFuse.cpp", "LoopIdiomRecognize.cpp", "LoopInstSimplify.cpp", "LoopInterchange.cpp", "LoopLoadElimination.cpp", "LoopPassManager.cpp", "LoopPredication.cpp", "LoopRerollPass.cpp", "LoopRotation.cpp", "LoopSimplifyCFG.cpp", "LoopStrengthReduce.cpp", "LoopUnrollPass.cpp", "LoopUnrollAndJamPass.cpp", "LoopUnswitch.cpp", "LoopVersioningLICM.cpp", "LowerAtomic.cpp", "LowerExpectIntrinsic.cpp", "LowerGuardIntrinsic.cpp", "LowerWidenableCondition.cpp", "MakeGuardsExplicit.cpp", "MemCpyOptimizer.cpp", "MergeICmps.cpp", "MergedLoadStoreMotion.cpp", "NaryReassociate.cpp", "NewGVN.cpp", "PartiallyInlineLibCalls.cpp", "PlaceSafepoints.cpp", "Reassociate.cpp", "Reg2Mem.cpp", "RewriteStatepointsForGC.cpp", "SCCP.cpp", "SROA.cpp", "Scalar.cpp", "Scalarizer.cpp", "SeparateConstOffsetFromGEP.cpp", "SimpleLoopUnswitch.cpp", "SimplifyCFGPass.cpp", "Sink.cpp", "SpeculativeExecution.cpp", "SpeculateAroundPHIs.cpp", "StraightLineStrengthReduce.cpp", "StructurizeCFG.cpp", "TailRecursionElimination.cpp", "WarnMissedTransforms.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "/root/include/llvm/Transforms/Scalar", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "IPO")
+    ctx.add_llvm_library(ctx, "LLVMipo", "AlwaysInliner.cpp", "ArgumentPromotion.cpp", "Attributor.cpp", "BarrierNoopPass.cpp", "BlockExtractor.cpp", "CalledValuePropagation.cpp", "ConstantMerge.cpp", "CrossDSOCFI.cpp", "DeadArgumentElimination.cpp", "ElimAvailExtern.cpp", "ExtractGV.cpp", "ForceFunctionAttrs.cpp", "FunctionAttrs.cpp", "FunctionImport.cpp", "GlobalDCE.cpp", "GlobalOpt.cpp", "GlobalSplit.cpp", "HotColdSplitting.cpp", "IPConstantPropagation.cpp", "IPO.cpp", "InferFunctionAttrs.cpp", "InlineSimple.cpp", "Inliner.cpp", "Internalize.cpp", "LoopExtractor.cpp", "LowerTypeTests.cpp", "MergeFunctions.cpp", "PartialInlining.cpp", "PassManagerBuilder.cpp", "PruneEH.cpp", "SampleProfile.cpp", "SCCP.cpp", "StripDeadPrototypes.cpp", "StripSymbols.cpp", "SyntheticCountsPropagation.cpp", "ThinLTOBitcodeWriter.cpp", "WholeProgramDevirt.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "/root/include/llvm/Transforms/IPO", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Vectorize")
+    ctx.add_llvm_library(ctx, "LLVMVectorize", "LoadStoreVectorizer.cpp", "LoopVectorizationLegality.cpp", "LoopVectorize.cpp", "SLPVectorizer.cpp", "Vectorize.cpp", "VPlan.cpp", "VPlanHCFGBuilder.cpp", "VPlanHCFGTransforms.cpp", "VPlanPredicator.cpp", "VPlanSLP.cpp", "VPlanVerifier.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Hello")
     ctx.add_llvm_library(ctx, "LLVMHello", "MODULE", "BUILDTREE_ONLY", "Hello.cpp", "DEPENDS", "intrinsics_gen", "PLUGIN_TOOL", "opt")
-    ctx = ctx.exit_directory(ctx, "Hello")
-    ctx = ctx.enter_directory(ctx, "ObjCARC")
-    ctx.add_llvm_library(ctx, "LLVMObjCARCOpts", "ObjCARC.cpp", "ObjCARCOpts.cpp", "ObjCARCExpand.cpp", "ObjCARCAPElim.cpp", "ObjCARCContract.cpp", "DependencyAnalysis.cpp", "ProvenanceAnalysis.cpp", "ProvenanceAnalysisEvaluator.cpp", "PtrState.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Transforms", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "ObjCARC")
-    ctx = ctx.enter_directory(ctx, "Coroutines")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "ObjCARC")
+    ctx.add_llvm_library(ctx, "LLVMObjCARCOpts", "ObjCARC.cpp", "ObjCARCOpts.cpp", "ObjCARCExpand.cpp", "ObjCARCAPElim.cpp", "ObjCARCContract.cpp", "DependencyAnalysis.cpp", "ProvenanceAnalysis.cpp", "ProvenanceAnalysisEvaluator.cpp", "PtrState.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Transforms", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Coroutines")
     ctx.add_llvm_library(ctx, "LLVMCoroutines", "Coroutines.cpp", "CoroCleanup.cpp", "CoroEarly.cpp", "CoroElide.cpp", "CoroFrame.cpp", "CoroSplit.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Coroutines")
-    ctx = ctx.exit_directory(ctx, "Transforms")
-    ctx = ctx.enter_directory(ctx, "Linker")
-    ctx.add_llvm_library(ctx, "LLVMLinker", "IRMover.cpp", "LinkModules.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Linker", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Linker")
-    ctx = ctx.enter_directory(ctx, "Analysis")
-    ctx.add_llvm_library(ctx, "LLVMAnalysis", "AliasAnalysis.cpp", "AliasAnalysisEvaluator.cpp", "AliasAnalysisSummary.cpp", "AliasSetTracker.cpp", "Analysis.cpp", "AssumptionCache.cpp", "BasicAliasAnalysis.cpp", "BlockFrequencyInfo.cpp", "BlockFrequencyInfoImpl.cpp", "BranchProbabilityInfo.cpp", "CFG.cpp", "CFGPrinter.cpp", "CFLAndersAliasAnalysis.cpp", "CFLSteensAliasAnalysis.cpp", "CGSCCPassManager.cpp", "CallGraph.cpp", "CallGraphSCCPass.cpp", "CallPrinter.cpp", "CaptureTracking.cpp", "CmpInstAnalysis.cpp", "CostModel.cpp", "CodeMetrics.cpp", "ConstantFolding.cpp", "Delinearization.cpp", "DemandedBits.cpp", "DependenceAnalysis.cpp", "DivergenceAnalysis.cpp", "DomPrinter.cpp", "DomTreeUpdater.cpp", "DominanceFrontier.cpp", "EHPersonalities.cpp", "GlobalsModRef.cpp", "GuardUtils.cpp", "IVDescriptors.cpp", "IVUsers.cpp", "IndirectCallPromotionAnalysis.cpp", "InlineCost.cpp", "InstCount.cpp", "InstructionPrecedenceTracking.cpp", "InstructionSimplify.cpp", "Interval.cpp", "IntervalPartition.cpp", "IteratedDominanceFrontier.cpp", "LazyBranchProbabilityInfo.cpp", "LazyBlockFrequencyInfo.cpp", "LazyCallGraph.cpp", "LazyValueInfo.cpp", "LegacyDivergenceAnalysis.cpp", "Lint.cpp", "Loads.cpp", "LoopAccessAnalysis.cpp", "LoopAnalysisManager.cpp", "LoopUnrollAnalyzer.cpp", "LoopInfo.cpp", "LoopPass.cpp", "MemDepPrinter.cpp", "MemDerefPrinter.cpp", "MemoryBuiltins.cpp", "MemoryDependenceAnalysis.cpp", "MemoryLocation.cpp", "MemorySSA.cpp", "MemorySSAUpdater.cpp", "ModuleDebugInfoPrinter.cpp", "ModuleSummaryAnalysis.cpp", "MustExecute.cpp", "ObjCARCAliasAnalysis.cpp", "ObjCARCAnalysisUtils.cpp", "ObjCARCInstKind.cpp", "OptimizationRemarkEmitter.cpp", "OrderedBasicBlock.cpp", "OrderedInstructions.cpp", "PHITransAddr.cpp", "PhiValues.cpp", "PostDominators.cpp", "ProfileSummaryInfo.cpp", "PtrUseVisitor.cpp", "RegionInfo.cpp", "RegionPass.cpp", "RegionPrinter.cpp", "ScalarEvolution.cpp", "ScalarEvolutionAliasAnalysis.cpp", "ScalarEvolutionExpander.cpp", "ScalarEvolutionNormalization.cpp", "StackSafetyAnalysis.cpp", "SyncDependenceAnalysis.cpp", "SyntheticCountsUtils.cpp", "TargetLibraryInfo.cpp", "TargetTransformInfo.cpp", "Trace.cpp", "TypeBasedAliasAnalysis.cpp", "TypeMetadataUtils.cpp", "ScopedNoAliasAA.cpp", "ValueLattice.cpp", "ValueLatticeUtils.cpp", "ValueTracking.cpp", "VectorUtils.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Analysis", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Analysis")
-    ctx = ctx.enter_directory(ctx, "LTO")
-    ctx.add_llvm_library(ctx, "LLVMLTO", "Caching.cpp", "LTO.cpp", "LTOBackend.cpp", "LTOModule.cpp", "LTOCodeGenerator.cpp", "SummaryBasedOptimizations.cpp", "UpdateCompilerUsed.cpp", "ThinLTOCodeGenerator.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/LTO", "DEPENDS", "intrinsics_gen", "llvm_vcsrevision_h")
-    ctx = ctx.exit_directory(ctx, "LTO")
-    ctx = ctx.enter_directory(ctx, "MC")
-    ctx.add_llvm_library(ctx, "LLVMMC", "ConstantPools.cpp", "ELFObjectWriter.cpp", "MCAsmBackend.cpp", "MCAsmInfo.cpp", "MCAsmInfoCOFF.cpp", "MCAsmInfoDarwin.cpp", "MCAsmInfoELF.cpp", "MCAsmInfoWasm.cpp", "MCAsmMacro.cpp", "MCAsmStreamer.cpp", "MCAssembler.cpp", "MCCodeEmitter.cpp", "MCCodePadder.cpp", "MCCodeView.cpp", "MCContext.cpp", "MCDwarf.cpp", "MCELFObjectTargetWriter.cpp", "MCELFStreamer.cpp", "MCExpr.cpp", "MCFragment.cpp", "MCInst.cpp", "MCInstPrinter.cpp", "MCInstrAnalysis.cpp", "MCInstrDesc.cpp", "MCLabel.cpp", "MCLinkerOptimizationHint.cpp", "MCMachOStreamer.cpp", "MCMachObjectTargetWriter.cpp", "MCNullStreamer.cpp", "MCObjectFileInfo.cpp", "MCObjectStreamer.cpp", "MCObjectWriter.cpp", "MCRegisterInfo.cpp", "MCSchedule.cpp", "MCSection.cpp", "MCSectionCOFF.cpp", "MCSectionELF.cpp", "MCSectionMachO.cpp", "MCSectionWasm.cpp", "MCStreamer.cpp", "MCSubtargetInfo.cpp", "MCSymbol.cpp", "MCSymbolELF.cpp", "MCTargetOptions.cpp", "MCValue.cpp", "MCWasmObjectTargetWriter.cpp", "MCWasmStreamer.cpp", "MCWin64EH.cpp", "MCWinCOFFStreamer.cpp", "MCWinEH.cpp", "MachObjectWriter.cpp", "StringTableBuilder.cpp", "SubtargetFeature.cpp", "WasmObjectWriter.cpp", "WinCOFFObjectWriter.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/MC")
-    ctx = ctx.enter_directory(ctx, "MCParser")
-    ctx.add_llvm_library(ctx, "LLVMMCParser", "AsmLexer.cpp", "AsmParser.cpp", "COFFAsmParser.cpp", "DarwinAsmParser.cpp", "ELFAsmParser.cpp", "MCAsmLexer.cpp", "MCAsmParser.cpp", "MCAsmParserExtension.cpp", "MCTargetAsmParser.cpp", "WasmAsmParser.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/MC/MCParser")
-    ctx = ctx.exit_directory(ctx, "MCParser")
-    ctx = ctx.enter_directory(ctx, "MCDisassembler")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Linker")
+    ctx.add_llvm_library(ctx, "LLVMLinker", "IRMover.cpp", "LinkModules.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Linker", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Analysis")
+    ctx.add_llvm_library(ctx, "LLVMAnalysis", "AliasAnalysis.cpp", "AliasAnalysisEvaluator.cpp", "AliasAnalysisSummary.cpp", "AliasSetTracker.cpp", "Analysis.cpp", "AssumptionCache.cpp", "BasicAliasAnalysis.cpp", "BlockFrequencyInfo.cpp", "BlockFrequencyInfoImpl.cpp", "BranchProbabilityInfo.cpp", "CFG.cpp", "CFGPrinter.cpp", "CFLAndersAliasAnalysis.cpp", "CFLSteensAliasAnalysis.cpp", "CGSCCPassManager.cpp", "CallGraph.cpp", "CallGraphSCCPass.cpp", "CallPrinter.cpp", "CaptureTracking.cpp", "CmpInstAnalysis.cpp", "CostModel.cpp", "CodeMetrics.cpp", "ConstantFolding.cpp", "Delinearization.cpp", "DemandedBits.cpp", "DependenceAnalysis.cpp", "DivergenceAnalysis.cpp", "DomPrinter.cpp", "DomTreeUpdater.cpp", "DominanceFrontier.cpp", "EHPersonalities.cpp", "GlobalsModRef.cpp", "GuardUtils.cpp", "IVDescriptors.cpp", "IVUsers.cpp", "IndirectCallPromotionAnalysis.cpp", "InlineCost.cpp", "InstCount.cpp", "InstructionPrecedenceTracking.cpp", "InstructionSimplify.cpp", "Interval.cpp", "IntervalPartition.cpp", "IteratedDominanceFrontier.cpp", "LazyBranchProbabilityInfo.cpp", "LazyBlockFrequencyInfo.cpp", "LazyCallGraph.cpp", "LazyValueInfo.cpp", "LegacyDivergenceAnalysis.cpp", "Lint.cpp", "Loads.cpp", "LoopAccessAnalysis.cpp", "LoopAnalysisManager.cpp", "LoopUnrollAnalyzer.cpp", "LoopInfo.cpp", "LoopPass.cpp", "MemDepPrinter.cpp", "MemDerefPrinter.cpp", "MemoryBuiltins.cpp", "MemoryDependenceAnalysis.cpp", "MemoryLocation.cpp", "MemorySSA.cpp", "MemorySSAUpdater.cpp", "ModuleDebugInfoPrinter.cpp", "ModuleSummaryAnalysis.cpp", "MustExecute.cpp", "ObjCARCAliasAnalysis.cpp", "ObjCARCAnalysisUtils.cpp", "ObjCARCInstKind.cpp", "OptimizationRemarkEmitter.cpp", "OrderedBasicBlock.cpp", "OrderedInstructions.cpp", "PHITransAddr.cpp", "PhiValues.cpp", "PostDominators.cpp", "ProfileSummaryInfo.cpp", "PtrUseVisitor.cpp", "RegionInfo.cpp", "RegionPass.cpp", "RegionPrinter.cpp", "ScalarEvolution.cpp", "ScalarEvolutionAliasAnalysis.cpp", "ScalarEvolutionExpander.cpp", "ScalarEvolutionNormalization.cpp", "StackSafetyAnalysis.cpp", "SyncDependenceAnalysis.cpp", "SyntheticCountsUtils.cpp", "TargetLibraryInfo.cpp", "TargetTransformInfo.cpp", "Trace.cpp", "TypeBasedAliasAnalysis.cpp", "TypeMetadataUtils.cpp", "ScopedNoAliasAA.cpp", "ValueLattice.cpp", "ValueLatticeUtils.cpp", "ValueTracking.cpp", "VectorUtils.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Analysis", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "LTO")
+    ctx.add_llvm_library(ctx, "LLVMLTO", "Caching.cpp", "LTO.cpp", "LTOBackend.cpp", "LTOModule.cpp", "LTOCodeGenerator.cpp", "SummaryBasedOptimizations.cpp", "UpdateCompilerUsed.cpp", "ThinLTOCodeGenerator.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/LTO", "DEPENDS", "intrinsics_gen", "llvm_vcsrevision_h")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MC")
+    ctx.add_llvm_library(ctx, "LLVMMC", "ConstantPools.cpp", "ELFObjectWriter.cpp", "MCAsmBackend.cpp", "MCAsmInfo.cpp", "MCAsmInfoCOFF.cpp", "MCAsmInfoDarwin.cpp", "MCAsmInfoELF.cpp", "MCAsmInfoWasm.cpp", "MCAsmMacro.cpp", "MCAsmStreamer.cpp", "MCAssembler.cpp", "MCCodeEmitter.cpp", "MCCodePadder.cpp", "MCCodeView.cpp", "MCContext.cpp", "MCDwarf.cpp", "MCELFObjectTargetWriter.cpp", "MCELFStreamer.cpp", "MCExpr.cpp", "MCFragment.cpp", "MCInst.cpp", "MCInstPrinter.cpp", "MCInstrAnalysis.cpp", "MCInstrDesc.cpp", "MCLabel.cpp", "MCLinkerOptimizationHint.cpp", "MCMachOStreamer.cpp", "MCMachObjectTargetWriter.cpp", "MCNullStreamer.cpp", "MCObjectFileInfo.cpp", "MCObjectStreamer.cpp", "MCObjectWriter.cpp", "MCRegisterInfo.cpp", "MCSchedule.cpp", "MCSection.cpp", "MCSectionCOFF.cpp", "MCSectionELF.cpp", "MCSectionMachO.cpp", "MCSectionWasm.cpp", "MCStreamer.cpp", "MCSubtargetInfo.cpp", "MCSymbol.cpp", "MCSymbolELF.cpp", "MCTargetOptions.cpp", "MCValue.cpp", "MCWasmObjectTargetWriter.cpp", "MCWasmStreamer.cpp", "MCWin64EH.cpp", "MCWinCOFFStreamer.cpp", "MCWinEH.cpp", "MachObjectWriter.cpp", "StringTableBuilder.cpp", "SubtargetFeature.cpp", "WasmObjectWriter.cpp", "WinCOFFObjectWriter.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/MC")
+    ctx = ctx.push_directory(ctx, "MCParser")
+    ctx.add_llvm_library(ctx, "LLVMMCParser", "AsmLexer.cpp", "AsmParser.cpp", "COFFAsmParser.cpp", "DarwinAsmParser.cpp", "ELFAsmParser.cpp", "MCAsmLexer.cpp", "MCAsmParser.cpp", "MCAsmParserExtension.cpp", "MCTargetAsmParser.cpp", "WasmAsmParser.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/MC/MCParser")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCDisassembler")
     ctx.add_llvm_library(ctx, "LLVMMCDisassembler", "Disassembler.cpp", "MCDisassembler.cpp", "MCExternalSymbolizer.cpp", "MCRelocationInfo.cpp", "MCSymbolizer.cpp")
-    ctx = ctx.exit_directory(ctx, "MCDisassembler")
-    ctx = ctx.exit_directory(ctx, "MC")
-    ctx = ctx.enter_directory(ctx, "MCA")
-    ctx.add_llvm_library(ctx, "LLVMMCA", "Context.cpp", "HWEventListener.cpp", "HardwareUnits/HardwareUnit.cpp", "HardwareUnits/LSUnit.cpp", "HardwareUnits/RegisterFile.cpp", "HardwareUnits/ResourceManager.cpp", "HardwareUnits/RetireControlUnit.cpp", "HardwareUnits/Scheduler.cpp", "InstrBuilder.cpp", "Instruction.cpp", "Pipeline.cpp", "Stages/DispatchStage.cpp", "Stages/EntryStage.cpp", "Stages/ExecuteStage.cpp", "Stages/InstructionTables.cpp", "Stages/MicroOpQueueStage.cpp", "Stages/RetireStage.cpp", "Stages/Stage.cpp", "Support.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/MCA")
-    ctx = ctx.exit_directory(ctx, "MCA")
-    ctx = ctx.enter_directory(ctx, "Object")
-    ctx.add_llvm_library(ctx, "LLVMObject", "Archive.cpp", "ArchiveWriter.cpp", "Binary.cpp", "COFFImportFile.cpp", "COFFModuleDefinition.cpp", "COFFObjectFile.cpp", "Decompressor.cpp", "ELF.cpp", "ELFObjectFile.cpp", "Error.cpp", "IRObjectFile.cpp", "IRSymtab.cpp", "MachOObjectFile.cpp", "MachOUniversal.cpp", "Minidump.cpp", "ModuleSymbolTable.cpp", "Object.cpp", "ObjectFile.cpp", "RecordStreamer.cpp", "RelocationResolver.cpp", "SymbolicFile.cpp", "SymbolSize.cpp", "WasmObjectFile.cpp", "WindowsResource.cpp", "XCOFFObjectFile.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Object", "DEPENDS", "intrinsics_gen", "llvm_vcsrevision_h")
-    ctx = ctx.exit_directory(ctx, "Object")
-    ctx = ctx.enter_directory(ctx, "ObjectYAML")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCA")
+    ctx.add_llvm_library(ctx, "LLVMMCA", "Context.cpp", "HWEventListener.cpp", "HardwareUnits/HardwareUnit.cpp", "HardwareUnits/LSUnit.cpp", "HardwareUnits/RegisterFile.cpp", "HardwareUnits/ResourceManager.cpp", "HardwareUnits/RetireControlUnit.cpp", "HardwareUnits/Scheduler.cpp", "InstrBuilder.cpp", "Instruction.cpp", "Pipeline.cpp", "Stages/DispatchStage.cpp", "Stages/EntryStage.cpp", "Stages/ExecuteStage.cpp", "Stages/InstructionTables.cpp", "Stages/MicroOpQueueStage.cpp", "Stages/RetireStage.cpp", "Stages/Stage.cpp", "Support.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/MCA")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Object")
+    ctx.add_llvm_library(ctx, "LLVMObject", "Archive.cpp", "ArchiveWriter.cpp", "Binary.cpp", "COFFImportFile.cpp", "COFFModuleDefinition.cpp", "COFFObjectFile.cpp", "Decompressor.cpp", "ELF.cpp", "ELFObjectFile.cpp", "Error.cpp", "IRObjectFile.cpp", "IRSymtab.cpp", "MachOObjectFile.cpp", "MachOUniversal.cpp", "Minidump.cpp", "ModuleSymbolTable.cpp", "Object.cpp", "ObjectFile.cpp", "RecordStreamer.cpp", "RelocationResolver.cpp", "SymbolicFile.cpp", "SymbolSize.cpp", "WasmObjectFile.cpp", "WindowsResource.cpp", "XCOFFObjectFile.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Object", "DEPENDS", "intrinsics_gen", "llvm_vcsrevision_h")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "ObjectYAML")
     ctx.add_llvm_library(ctx, "LLVMObjectYAML", "CodeViewYAMLDebugSections.cpp", "CodeViewYAMLSymbols.cpp", "CodeViewYAMLTypeHashing.cpp", "CodeViewYAMLTypes.cpp", "COFFYAML.cpp", "DWARFEmitter.cpp", "DWARFVisitor.cpp", "DWARFYAML.cpp", "ELFYAML.cpp", "MachOYAML.cpp", "ObjectYAML.cpp", "MinidumpYAML.cpp", "WasmYAML.cpp", "XCOFFYAML.cpp", "YAML.cpp")
-    ctx = ctx.exit_directory(ctx, "ObjectYAML")
-    ctx = ctx.enter_directory(ctx, "Option")
-    ctx.add_llvm_library(ctx, "LLVMOption", "Arg.cpp", "ArgList.cpp", "Option.cpp", "OptTable.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Option")
-    ctx = ctx.exit_directory(ctx, "Option")
-    ctx = ctx.enter_directory(ctx, "Remarks")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Option")
+    ctx.add_llvm_library(ctx, "LLVMOption", "Arg.cpp", "ArgList.cpp", "Option.cpp", "OptTable.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Option")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Remarks")
     ctx.add_llvm_library(ctx, "LLVMRemarks", "Remark.cpp", "RemarkParser.cpp", "RemarkStringTable.cpp", "YAMLRemarkParser.cpp", "YAMLRemarkSerializer.cpp")
-    ctx = ctx.exit_directory(ctx, "Remarks")
-    ctx = ctx.enter_directory(ctx, "DebugInfo")
-    ctx = ctx.enter_directory(ctx, "DWARF")
-    ctx.add_llvm_library(ctx, "LLVMDebugInfoDWARF", "DWARFAbbreviationDeclaration.cpp", "DWARFAddressRange.cpp", "DWARFAcceleratorTable.cpp", "DWARFCompileUnit.cpp", "DWARFContext.cpp", "DWARFDataExtractor.cpp", "DWARFDebugAbbrev.cpp", "DWARFDebugAddr.cpp", "DWARFDebugArangeSet.cpp", "DWARFDebugAranges.cpp", "DWARFDebugFrame.cpp", "DWARFDebugInfoEntry.cpp", "DWARFDebugLine.cpp", "DWARFDebugLoc.cpp", "DWARFDebugMacro.cpp", "DWARFDebugPubTable.cpp", "DWARFDebugRangeList.cpp", "DWARFDebugRnglists.cpp", "DWARFDie.cpp", "DWARFExpression.cpp", "DWARFFormValue.cpp", "DWARFGdbIndex.cpp", "DWARFListTable.cpp", "DWARFTypeUnit.cpp", "DWARFUnitIndex.cpp", "DWARFUnit.cpp", "DWARFVerifier.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/DebugInfo/DWARF", "/include/llvm/DebugInfo")
-    ctx = ctx.exit_directory(ctx, "DWARF")
-    ctx = ctx.enter_directory(ctx, "MSF")
-    ctx.add_llvm_library(ctx, "LLVMDebugInfoMSF", "MappedBlockStream.cpp", "MSFBuilder.cpp", "MSFCommon.cpp", "MSFError.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/DebugInfo/MSF")
-    ctx = ctx.exit_directory(ctx, "MSF")
-    ctx = ctx.enter_directory(ctx, "CodeView")
-    ctx.add_llvm_library(ctx, "LLVMDebugInfoCodeView", "AppendingTypeTableBuilder.cpp", "CodeViewError.cpp", "CodeViewRecordIO.cpp", "ContinuationRecordBuilder.cpp", "CVSymbolVisitor.cpp", "CVTypeVisitor.cpp", "DebugChecksumsSubsection.cpp", "DebugCrossExSubsection.cpp", "DebugCrossImpSubsection.cpp", "DebugFrameDataSubsection.cpp", "DebugInlineeLinesSubsection.cpp", "DebugLinesSubsection.cpp", "DebugStringTableSubsection.cpp", "DebugSubsection.cpp", "DebugSubsectionRecord.cpp", "DebugSubsectionVisitor.cpp", "DebugSymbolRVASubsection.cpp", "DebugSymbolsSubsection.cpp", "EnumTables.cpp", "Formatters.cpp", "GlobalTypeTableBuilder.cpp", "LazyRandomTypeCollection.cpp", "Line.cpp", "MergingTypeTableBuilder.cpp", "RecordName.cpp", "RecordSerialization.cpp", "SimpleTypeSerializer.cpp", "StringsAndChecksums.cpp", "SymbolDumper.cpp", "SymbolRecordHelpers.cpp", "SymbolRecordMapping.cpp", "SymbolSerializer.cpp", "TypeDumpVisitor.cpp", "TypeIndex.cpp", "TypeIndexDiscovery.cpp", "TypeHashing.cpp", "TypeRecordHelpers.cpp", "TypeRecordMapping.cpp", "TypeStreamMerger.cpp", "TypeTableCollection.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/DebugInfo/CodeView")
-    ctx = ctx.exit_directory(ctx, "CodeView")
-    ctx = ctx.enter_directory(ctx, "PDB")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "DebugInfo")
+    ctx = ctx.push_directory(ctx, "DWARF")
+    ctx.add_llvm_library(ctx, "LLVMDebugInfoDWARF", "DWARFAbbreviationDeclaration.cpp", "DWARFAddressRange.cpp", "DWARFAcceleratorTable.cpp", "DWARFCompileUnit.cpp", "DWARFContext.cpp", "DWARFDataExtractor.cpp", "DWARFDebugAbbrev.cpp", "DWARFDebugAddr.cpp", "DWARFDebugArangeSet.cpp", "DWARFDebugAranges.cpp", "DWARFDebugFrame.cpp", "DWARFDebugInfoEntry.cpp", "DWARFDebugLine.cpp", "DWARFDebugLoc.cpp", "DWARFDebugMacro.cpp", "DWARFDebugPubTable.cpp", "DWARFDebugRangeList.cpp", "DWARFDebugRnglists.cpp", "DWARFDie.cpp", "DWARFExpression.cpp", "DWARFFormValue.cpp", "DWARFGdbIndex.cpp", "DWARFListTable.cpp", "DWARFTypeUnit.cpp", "DWARFUnitIndex.cpp", "DWARFUnit.cpp", "DWARFVerifier.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/DebugInfo/DWARF", "/root/include/llvm/DebugInfo")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MSF")
+    ctx.add_llvm_library(ctx, "LLVMDebugInfoMSF", "MappedBlockStream.cpp", "MSFBuilder.cpp", "MSFCommon.cpp", "MSFError.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/DebugInfo/MSF")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "CodeView")
+    ctx.add_llvm_library(ctx, "LLVMDebugInfoCodeView", "AppendingTypeTableBuilder.cpp", "CodeViewError.cpp", "CodeViewRecordIO.cpp", "ContinuationRecordBuilder.cpp", "CVSymbolVisitor.cpp", "CVTypeVisitor.cpp", "DebugChecksumsSubsection.cpp", "DebugCrossExSubsection.cpp", "DebugCrossImpSubsection.cpp", "DebugFrameDataSubsection.cpp", "DebugInlineeLinesSubsection.cpp", "DebugLinesSubsection.cpp", "DebugStringTableSubsection.cpp", "DebugSubsection.cpp", "DebugSubsectionRecord.cpp", "DebugSubsectionVisitor.cpp", "DebugSymbolRVASubsection.cpp", "DebugSymbolsSubsection.cpp", "EnumTables.cpp", "Formatters.cpp", "GlobalTypeTableBuilder.cpp", "LazyRandomTypeCollection.cpp", "Line.cpp", "MergingTypeTableBuilder.cpp", "RecordName.cpp", "RecordSerialization.cpp", "SimpleTypeSerializer.cpp", "StringsAndChecksums.cpp", "SymbolDumper.cpp", "SymbolRecordHelpers.cpp", "SymbolRecordMapping.cpp", "SymbolSerializer.cpp", "TypeDumpVisitor.cpp", "TypeIndex.cpp", "TypeIndexDiscovery.cpp", "TypeHashing.cpp", "TypeRecordHelpers.cpp", "TypeRecordMapping.cpp", "TypeStreamMerger.cpp", "TypeTableCollection.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/DebugInfo/CodeView")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "PDB")
     ctx.add_llvm_library(ctx, "LLVMDebugInfoPDB", "GenericError.cpp", "IPDBSourceFile.cpp", "PDB.cpp", "PDBContext.cpp", "PDBExtras.cpp", "PDBInterfaceAnchors.cpp", "PDBSymbol.cpp", "PDBSymbolAnnotation.cpp", "PDBSymbolBlock.cpp", "PDBSymbolCompiland.cpp", "PDBSymbolCompilandDetails.cpp", "PDBSymbolCompilandEnv.cpp", "PDBSymbolCustom.cpp", "PDBSymbolData.cpp", "PDBSymbolExe.cpp", "PDBSymbolFunc.cpp", "PDBSymbolFuncDebugEnd.cpp", "PDBSymbolFuncDebugStart.cpp", "PDBSymbolLabel.cpp", "PDBSymbolPublicSymbol.cpp", "PDBSymbolThunk.cpp", "PDBSymbolTypeArray.cpp", "PDBSymbolTypeBaseClass.cpp", "PDBSymbolTypeBuiltin.cpp", "PDBSymbolTypeCustom.cpp", "PDBSymbolTypeDimension.cpp", "PDBSymbolTypeEnum.cpp", "PDBSymbolTypeFriend.cpp", "PDBSymbolTypeFunctionArg.cpp", "PDBSymbolTypeFunctionSig.cpp", "PDBSymbolTypeManaged.cpp", "PDBSymbolTypePointer.cpp", "PDBSymbolTypeTypedef.cpp", "PDBSymbolTypeUDT.cpp", "PDBSymbolTypeVTable.cpp", "PDBSymbolTypeVTableShape.cpp", "PDBSymbolUnknown.cpp", "PDBSymbolUsingNamespace.cpp", "PDBSymDumper.cpp", "UDTLayout.cpp", "", "ADDITIONAL_HEADER_DIRS", "")
-    ctx = ctx.exit_directory(ctx, "PDB")
-    ctx = ctx.enter_directory(ctx, "Symbolize")
-    ctx.add_llvm_library(ctx, "LLVMSymbolize", "DIPrinter.cpp", "SymbolizableObjectFile.cpp", "Symbolize.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/DebugInfo/Symbolize")
-    ctx = ctx.exit_directory(ctx, "Symbolize")
-    ctx = ctx.exit_directory(ctx, "DebugInfo")
-    ctx = ctx.enter_directory(ctx, "ExecutionEngine")
-    ctx.add_llvm_library(ctx, "LLVMExecutionEngine", "ExecutionEngine.cpp", "ExecutionEngineBindings.cpp", "GDBRegistrationListener.cpp", "SectionMemoryManager.cpp", "TargetSelect.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/ExecutionEngine", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.enter_directory(ctx, "Interpreter")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Symbolize")
+    ctx.add_llvm_library(ctx, "LLVMSymbolize", "DIPrinter.cpp", "SymbolizableObjectFile.cpp", "Symbolize.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/DebugInfo/Symbolize")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "ExecutionEngine")
+    ctx.add_llvm_library(ctx, "LLVMExecutionEngine", "ExecutionEngine.cpp", "ExecutionEngineBindings.cpp", "GDBRegistrationListener.cpp", "SectionMemoryManager.cpp", "TargetSelect.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/ExecutionEngine", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.push_directory(ctx, "Interpreter")
     ctx.add_llvm_library(ctx, "LLVMInterpreter", "Execution.cpp", "ExternalFunctions.cpp", "Interpreter.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Interpreter")
-    ctx = ctx.enter_directory(ctx, "JITLink")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "JITLink")
     ctx.add_llvm_library(ctx, "LLVMJITLink", "JITLink.cpp", "JITLinkGeneric.cpp", "EHFrameSupport.cpp", "MachO.cpp", "MachO_x86_64.cpp", "MachOAtomGraphBuilder.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "JITLink")
-    ctx = ctx.enter_directory(ctx, "MCJIT")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCJIT")
     ctx.add_llvm_library(ctx, "LLVMMCJIT", "MCJIT.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "MCJIT")
-    ctx = ctx.enter_directory(ctx, "Orc")
-    ctx.add_llvm_library(ctx, "LLVMOrcJIT", "CompileOnDemandLayer.cpp", "CompileUtils.cpp", "Core.cpp", "ExecutionUtils.cpp", "IndirectionUtils.cpp", "IRCompileLayer.cpp", "IRTransformLayer.cpp", "JITTargetMachineBuilder.cpp", "LazyReexports.cpp", "Legacy.cpp", "Layer.cpp", "LLJIT.cpp", "NullResolver.cpp", "ObjectLinkingLayer.cpp", "ObjectTransformLayer.cpp", "OrcABISupport.cpp", "OrcCBindings.cpp", "OrcError.cpp", "OrcMCJITReplacement.cpp", "RPCUtils.cpp", "RTDyldObjectLinkingLayer.cpp", "ThreadSafeModule.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/ExecutionEngine/Orc", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Orc")
-    ctx = ctx.enter_directory(ctx, "RuntimeDyld")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Orc")
+    ctx.add_llvm_library(ctx, "LLVMOrcJIT", "CompileOnDemandLayer.cpp", "CompileUtils.cpp", "Core.cpp", "ExecutionUtils.cpp", "IndirectionUtils.cpp", "IRCompileLayer.cpp", "IRTransformLayer.cpp", "JITTargetMachineBuilder.cpp", "LazyReexports.cpp", "Legacy.cpp", "Layer.cpp", "LLJIT.cpp", "NullResolver.cpp", "ObjectLinkingLayer.cpp", "ObjectTransformLayer.cpp", "OrcABISupport.cpp", "OrcCBindings.cpp", "OrcError.cpp", "OrcMCJITReplacement.cpp", "RPCUtils.cpp", "RTDyldObjectLinkingLayer.cpp", "ThreadSafeModule.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/ExecutionEngine/Orc", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "RuntimeDyld")
     ctx.add_llvm_library(ctx, "LLVMRuntimeDyld", "JITSymbol.cpp", "RTDyldMemoryManager.cpp", "RuntimeDyld.cpp", "RuntimeDyldChecker.cpp", "RuntimeDyldCOFF.cpp", "RuntimeDyldELF.cpp", "RuntimeDyldMachO.cpp", "Targets/RuntimeDyldELFMips.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "RuntimeDyld")
-    ctx = ctx.exit_directory(ctx, "ExecutionEngine")
-    ctx = ctx.enter_directory(ctx, "Target")
-    ctx.add_llvm_library(ctx, "LLVMTarget", "Target.cpp", "TargetIntrinsicInfo.cpp", "TargetLoweringObjectFile.cpp", "TargetMachine.cpp", "TargetMachineC.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Target")
-    ctx = ctx.exit_directory(ctx, "Target")
-    ctx = ctx.enter_directory(ctx, "AsmParser")
-    ctx.add_llvm_library(ctx, "LLVMAsmParser", "LLLexer.cpp", "LLParser.cpp", "Parser.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Analysis", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "AsmParser")
-    ctx = ctx.enter_directory(ctx, "LineEditor")
-    ctx.add_llvm_library(ctx, "LLVMLineEditor", "LineEditor.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/LineEditor", "LINK_LIBS", "LLVMSupport", "")
-    ctx = ctx.exit_directory(ctx, "LineEditor")
-    ctx = ctx.enter_directory(ctx, "ProfileData")
-    ctx.add_llvm_library(ctx, "LLVMProfileData", "GCOV.cpp", "InstrProf.cpp", "InstrProfReader.cpp", "InstrProfWriter.cpp", "ProfileSummaryBuilder.cpp", "SampleProf.cpp", "SampleProfReader.cpp", "SampleProfWriter.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/ProfileData", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.enter_directory(ctx, "Coverage")
-    ctx.add_llvm_library(ctx, "LLVMCoverage", "CoverageMapping.cpp", "CoverageMappingWriter.cpp", "CoverageMappingReader.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/ProfileData/Coverage", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Coverage")
-    ctx = ctx.exit_directory(ctx, "ProfileData")
-    ctx = ctx.enter_directory(ctx, "Passes")
-    ctx.add_llvm_library(ctx, "LLVMPasses", "PassBuilder.cpp", "PassPlugin.cpp", "StandardInstrumentations.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Passes", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.exit_directory(ctx, "Passes")
-    ctx = ctx.enter_directory(ctx, "TextAPI")
-    ctx.add_llvm_library(ctx, "LLVMTextAPI", "ELF/ELFStub.cpp", "ELF/TBEHandler.cpp", "MachO/Architecture.cpp", "MachO/ArchitectureSet.cpp", "MachO/InterfaceFile.cpp", "MachO/PackedVersion.cpp", "MachO/Symbol.cpp", "MachO/TextStub.cpp", "MachO/TextStubCommon.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/TextAPI")
-    ctx = ctx.exit_directory(ctx, "TextAPI")
-    ctx = ctx.enter_directory(ctx, "ToolDrivers")
-    ctx = ctx.enter_directory(ctx, "llvm-dlltool")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Target")
+    ctx.add_llvm_library(ctx, "LLVMTarget", "Target.cpp", "TargetIntrinsicInfo.cpp", "TargetLoweringObjectFile.cpp", "TargetMachine.cpp", "TargetMachineC.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Target")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "AsmParser")
+    ctx.add_llvm_library(ctx, "LLVMAsmParser", "LLLexer.cpp", "LLParser.cpp", "Parser.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Analysis", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "LineEditor")
+    ctx.add_llvm_library(ctx, "LLVMLineEditor", "LineEditor.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/LineEditor", "LINK_LIBS", "LLVMSupport", "")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "ProfileData")
+    ctx.add_llvm_library(ctx, "LLVMProfileData", "GCOV.cpp", "InstrProf.cpp", "InstrProfReader.cpp", "InstrProfWriter.cpp", "ProfileSummaryBuilder.cpp", "SampleProf.cpp", "SampleProfReader.cpp", "SampleProfWriter.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/ProfileData", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.push_directory(ctx, "Coverage")
+    ctx.add_llvm_library(ctx, "LLVMCoverage", "CoverageMapping.cpp", "CoverageMappingWriter.cpp", "CoverageMappingReader.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/ProfileData/Coverage", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Passes")
+    ctx.add_llvm_library(ctx, "LLVMPasses", "PassBuilder.cpp", "PassPlugin.cpp", "StandardInstrumentations.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Passes", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "TextAPI")
+    ctx.add_llvm_library(ctx, "LLVMTextAPI", "ELF/ELFStub.cpp", "ELF/TBEHandler.cpp", "MachO/Architecture.cpp", "MachO/ArchitectureSet.cpp", "MachO/InterfaceFile.cpp", "MachO/PackedVersion.cpp", "MachO/Symbol.cpp", "MachO/TextStub.cpp", "MachO/TextStubCommon.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/TextAPI")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "ToolDrivers")
+    ctx = ctx.push_directory(ctx, "llvm-dlltool")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "Options.td")
     ctx.tablegen(ctx, "LLVM", "Options.inc", "-gen-opt-parser-defs")
     ctx.add_public_tablegen_target(ctx, "DllOptionsTableGen")
     ctx.add_llvm_library(ctx, "LLVMDlltoolDriver", "DlltoolDriver.cpp")
-    ctx = ctx.exit_directory(ctx, "llvm-dlltool")
-    ctx = ctx.enter_directory(ctx, "llvm-lib")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "llvm-lib")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "BinaryFormat", "BitReader", "Object", "Option", "Support")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "Options.td")
     ctx.tablegen(ctx, "LLVM", "Options.inc", "-gen-opt-parser-defs")
     ctx.add_public_tablegen_target(ctx, "LibOptionsTableGen")
     ctx.add_llvm_library(ctx, "LLVMLibDriver", "LibDriver.cpp")
-    ctx = ctx.exit_directory(ctx, "llvm-lib")
-    ctx = ctx.exit_directory(ctx, "ToolDrivers")
-    ctx = ctx.enter_directory(ctx, "XRay")
-    ctx.add_llvm_library(ctx, "LLVMXRay", "BlockIndexer.cpp", "BlockPrinter.cpp", "BlockVerifier.cpp", "FDRRecordProducer.cpp", "FDRRecords.cpp", "FDRTraceExpander.cpp", "FDRTraceWriter.cpp", "FileHeaderReader.cpp", "InstrumentationMap.cpp", "LogBuilderConsumer.cpp", "Profile.cpp", "RecordInitializer.cpp", "RecordPrinter.cpp", "Trace.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/ADT", "/include/llvm/XRay", "DEPENDS", "LLVMSupport", "LLVMObject", "LINK_LIBS", "LLVMSupport", "LLVMObject")
-    ctx = ctx.exit_directory(ctx, "XRay")
-    ctx = ctx.enter_directory(ctx, "Testing")
-    ctx = ctx.enter_directory(ctx, "Support")
-    ctx.add_llvm_library(ctx, "LLVMTestingSupport", "Annotations.cpp", "Error.cpp", "SupportHelpers.cpp", "BUILDTREE_ONLY", "ADDITIONAL_HEADER_DIRS", "/include/llvm/Testing/Support", "LINK_COMPONENTS", "Support")
-    ctx = ctx.exit_directory(ctx, "Support")
-    ctx = ctx.exit_directory(ctx, "Testing")
-    ctx = ctx.enter_directory(ctx, "WindowsManifest")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "XRay")
+    ctx.add_llvm_library(ctx, "LLVMXRay", "BlockIndexer.cpp", "BlockPrinter.cpp", "BlockVerifier.cpp", "FDRRecordProducer.cpp", "FDRRecords.cpp", "FDRTraceExpander.cpp", "FDRTraceWriter.cpp", "FileHeaderReader.cpp", "InstrumentationMap.cpp", "LogBuilderConsumer.cpp", "Profile.cpp", "RecordInitializer.cpp", "RecordPrinter.cpp", "Trace.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/ADT", "/root/include/llvm/XRay", "DEPENDS", "LLVMSupport", "LLVMObject", "LINK_LIBS", "LLVMSupport", "LLVMObject")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Testing")
+    ctx = ctx.push_directory(ctx, "Support")
+    ctx.add_llvm_library(ctx, "LLVMTestingSupport", "Annotations.cpp", "Error.cpp", "SupportHelpers.cpp", "BUILDTREE_ONLY", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/Testing/Support", "LINK_COMPONENTS", "Support")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "WindowsManifest")
     ctx.set(ctx, "system_libs")
-    ctx.add_llvm_library(ctx, "LLVMWindowsManifest", "WindowsManifestMerger.cpp", "ADDITIONAL_HEADER_DIRS", "/include/llvm/WindowsManifest", "", "LINK_LIBS", "")
-    ctx = ctx.exit_directory(ctx, "WindowsManifest")
-    ctx = ctx.exit_directory(ctx, "lib")
-    ctx = ctx.exit_directory(ctx, "")
-    ctx = ctx.enter_directory(ctx, "lib/Target/X86")
+    ctx.add_llvm_library(ctx, "LLVMWindowsManifest", "WindowsManifestMerger.cpp", "ADDITIONAL_HEADER_DIRS", "/root/include/llvm/WindowsManifest", "", "LINK_LIBS", "")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib/Target/X86")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "X86.td")
     ctx.tablegen(ctx, "LLVM", "X86GenAsmMatcher.inc", "-gen-asm-matcher")
     ctx.tablegen(ctx, "LLVM", "X86GenAsmWriter.inc", "-gen-asm-writer")
@@ -319,24 +319,24 @@
     ctx.tablegen(ctx, "LLVM", "X86GenSubtargetInfo.inc", "-gen-subtarget")
     ctx.add_public_tablegen_target(ctx, "X86CommonTableGen")
     ctx.set(ctx, "sources", "X86AsmPrinter.cpp", "X86CallFrameOptimization.cpp", "X86CallingConv.cpp", "X86CallLowering.cpp", "X86CmovConversion.cpp", "X86CondBrFolding.cpp", "X86DomainReassignment.cpp", "X86DiscriminateMemOps.cpp", "X86ExpandPseudo.cpp", "X86FastISel.cpp", "X86FixupBWInsts.cpp", "X86FixupLEAs.cpp", "X86AvoidStoreForwardingBlocks.cpp", "X86FixupSetCC.cpp", "X86FlagsCopyLowering.cpp", "X86FloatingPoint.cpp", "X86FrameLowering.cpp", "X86InstructionSelector.cpp", "X86ISelDAGToDAG.cpp", "X86ISelLowering.cpp", "X86IndirectBranchTracking.cpp", "X86InterleavedAccess.cpp", "X86InsertPrefetch.cpp", "X86InstrFMA3Info.cpp", "X86InstrFoldTables.cpp", "X86InstrInfo.cpp", "X86EvexToVex.cpp", "X86LegalizerInfo.cpp", "X86MCInstLower.cpp", "X86MachineFunctionInfo.cpp", "X86MacroFusion.cpp", "X86OptimizeLEAs.cpp", "X86PadShortFunction.cpp", "X86RegisterBankInfo.cpp", "X86RegisterInfo.cpp", "X86RetpolineThunks.cpp", "X86SelectionDAGInfo.cpp", "X86ShuffleDecodeConstantPool.cpp", "X86SpeculativeLoadHardening.cpp", "X86Subtarget.cpp", "X86TargetMachine.cpp", "X86TargetObjectFile.cpp", "X86TargetTransformInfo.cpp", "X86VZeroUpper.cpp", "X86WinAllocaExpander.cpp", "X86WinEHState.cpp")
-    ctx.add_llvm_target(ctx, "X86CodeGen", "")
-    ctx = ctx.enter_directory(ctx, "AsmParser")
+    ctx.add_llvm_target(ctx, "X86CodeGen", "X86AsmPrinter.cpp", "X86CallFrameOptimization.cpp", "X86CallingConv.cpp", "X86CallLowering.cpp", "X86CmovConversion.cpp", "X86CondBrFolding.cpp", "X86DomainReassignment.cpp", "X86DiscriminateMemOps.cpp", "X86ExpandPseudo.cpp", "X86FastISel.cpp", "X86FixupBWInsts.cpp", "X86FixupLEAs.cpp", "X86AvoidStoreForwardingBlocks.cpp", "X86FixupSetCC.cpp", "X86FlagsCopyLowering.cpp", "X86FloatingPoint.cpp", "X86FrameLowering.cpp", "X86InstructionSelector.cpp", "X86ISelDAGToDAG.cpp", "X86ISelLowering.cpp", "X86IndirectBranchTracking.cpp", "X86InterleavedAccess.cpp", "X86InsertPrefetch.cpp", "X86InstrFMA3Info.cpp", "X86InstrFoldTables.cpp", "X86InstrInfo.cpp", "X86EvexToVex.cpp", "X86LegalizerInfo.cpp", "X86MCInstLower.cpp", "X86MachineFunctionInfo.cpp", "X86MacroFusion.cpp", "X86OptimizeLEAs.cpp", "X86PadShortFunction.cpp", "X86RegisterBankInfo.cpp", "X86RegisterInfo.cpp", "X86RetpolineThunks.cpp", "X86SelectionDAGInfo.cpp", "X86ShuffleDecodeConstantPool.cpp", "X86SpeculativeLoadHardening.cpp", "X86Subtarget.cpp", "X86TargetMachine.cpp", "X86TargetObjectFile.cpp", "X86TargetTransformInfo.cpp", "X86VZeroUpper.cpp", "X86WinAllocaExpander.cpp", "X86WinEHState.cpp")
+    ctx = ctx.push_directory(ctx, "AsmParser")
     ctx.add_llvm_library(ctx, "LLVMX86AsmParser", "X86AsmParser.cpp")
-    ctx = ctx.exit_directory(ctx, "AsmParser")
-    ctx = ctx.enter_directory(ctx, "Disassembler")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Disassembler")
     ctx.add_llvm_library(ctx, "LLVMX86Disassembler", "X86Disassembler.cpp", "X86DisassemblerDecoder.cpp")
-    ctx = ctx.exit_directory(ctx, "Disassembler")
-    ctx = ctx.enter_directory(ctx, "MCTargetDesc")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCTargetDesc")
     ctx.add_llvm_library(ctx, "LLVMX86Desc", "X86ATTInstPrinter.cpp", "X86IntelInstPrinter.cpp", "X86InstComments.cpp", "X86InstPrinterCommon.cpp", "X86AsmBackend.cpp", "X86MCTargetDesc.cpp", "X86MCAsmInfo.cpp", "X86MCCodeEmitter.cpp", "X86MachObjectWriter.cpp", "X86ELFObjectWriter.cpp", "X86WinCOFFObjectWriter.cpp", "X86WinCOFFStreamer.cpp", "X86WinCOFFTargetStreamer.cpp")
-    ctx = ctx.exit_directory(ctx, "MCTargetDesc")
-    ctx = ctx.enter_directory(ctx, "TargetInfo")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "TargetInfo")
     ctx.add_llvm_library(ctx, "LLVMX86Info", "X86TargetInfo.cpp")
-    ctx = ctx.exit_directory(ctx, "TargetInfo")
-    ctx = ctx.enter_directory(ctx, "Utils")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Utils")
     ctx.add_llvm_library(ctx, "LLVMX86Utils", "X86ShuffleDecode.cpp")
-    ctx = ctx.exit_directory(ctx, "Utils")
-    ctx = ctx.exit_directory(ctx, "lib/Target/X86")
-    ctx = ctx.enter_directory(ctx, "lib/Target/PowerPC")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib/Target/PowerPC")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "PPC.td")
     ctx.tablegen(ctx, "LLVM", "PPCGenAsmMatcher.inc", "-gen-asm-matcher")
     ctx.tablegen(ctx, "LLVM", "PPCGenAsmWriter.inc", "-gen-asm-writer")
@@ -351,20 +351,20 @@
     ctx.tablegen(ctx, "LLVM", "PPCGenExegesis.inc", "-gen-exegesis")
     ctx.add_public_tablegen_target(ctx, "PowerPCCommonTableGen")
     ctx.add_llvm_target(ctx, "PowerPCCodeGen", "PPCBoolRetToInt.cpp", "PPCAsmPrinter.cpp", "PPCBranchSelector.cpp", "PPCBranchCoalescing.cpp", "PPCCallingConv.cpp", "PPCCCState.cpp", "PPCCTRLoops.cpp", "PPCHazardRecognizers.cpp", "PPCInstrInfo.cpp", "PPCISelDAGToDAG.cpp", "PPCISelLowering.cpp", "PPCEarlyReturn.cpp", "PPCFastISel.cpp", "PPCFrameLowering.cpp", "PPCLoopPreIncPrep.cpp", "PPCMCInstLower.cpp", "PPCMachineFunctionInfo.cpp", "PPCMachineScheduler.cpp", "PPCMIPeephole.cpp", "PPCRegisterInfo.cpp", "PPCQPXLoadSplat.cpp", "PPCSubtarget.cpp", "PPCTargetMachine.cpp", "PPCTargetObjectFile.cpp", "PPCTargetTransformInfo.cpp", "PPCTOCRegDeps.cpp", "PPCTLSDynamicCall.cpp", "PPCVSXCopy.cpp", "PPCReduceCRLogicals.cpp", "PPCVSXFMAMutate.cpp", "PPCVSXSwapRemoval.cpp", "PPCExpandISEL.cpp", "PPCPreEmitPeephole.cpp")
-    ctx = ctx.enter_directory(ctx, "AsmParser")
+    ctx = ctx.push_directory(ctx, "AsmParser")
     ctx.add_llvm_library(ctx, "LLVMPowerPCAsmParser", "PPCAsmParser.cpp")
-    ctx = ctx.exit_directory(ctx, "AsmParser")
-    ctx = ctx.enter_directory(ctx, "Disassembler")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Disassembler")
     ctx.add_llvm_library(ctx, "LLVMPowerPCDisassembler", "PPCDisassembler.cpp")
-    ctx = ctx.exit_directory(ctx, "Disassembler")
-    ctx = ctx.enter_directory(ctx, "MCTargetDesc")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCTargetDesc")
     ctx.add_llvm_library(ctx, "LLVMPowerPCDesc", "PPCAsmBackend.cpp", "PPCInstPrinter.cpp", "PPCMCTargetDesc.cpp", "PPCMCAsmInfo.cpp", "PPCMCCodeEmitter.cpp", "PPCMCExpr.cpp", "PPCPredicates.cpp", "PPCMachObjectWriter.cpp", "PPCELFObjectWriter.cpp")
-    ctx = ctx.exit_directory(ctx, "MCTargetDesc")
-    ctx = ctx.enter_directory(ctx, "TargetInfo")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "TargetInfo")
     ctx.add_llvm_library(ctx, "LLVMPowerPCInfo", "PowerPCTargetInfo.cpp")
-    ctx = ctx.exit_directory(ctx, "TargetInfo")
-    ctx = ctx.exit_directory(ctx, "lib/Target/PowerPC")
-    ctx = ctx.enter_directory(ctx, "lib/Target/ARM")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib/Target/ARM")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "ARM.td")
     ctx.tablegen(ctx, "LLVM", "ARMGenAsmMatcher.inc", "-gen-asm-matcher")
     ctx.tablegen(ctx, "LLVM", "ARMGenAsmWriter.inc", "-gen-asm-writer")
@@ -382,23 +382,23 @@
     ctx.tablegen(ctx, "LLVM", "ARMGenSystemRegister.inc", "-gen-searchable-tables")
     ctx.add_public_tablegen_target(ctx, "ARMCommonTableGen")
     ctx.add_llvm_target(ctx, "ARMCodeGen", "A15SDOptimizer.cpp", "ARMAsmPrinter.cpp", "ARMBaseInstrInfo.cpp", "ARMBaseRegisterInfo.cpp", "ARMCallingConv.cpp", "ARMCallLowering.cpp", "ARMCodeGenPrepare.cpp", "ARMConstantIslandPass.cpp", "ARMConstantPoolValue.cpp", "ARMExpandPseudoInsts.cpp", "ARMFastISel.cpp", "ARMFrameLowering.cpp", "ARMHazardRecognizer.cpp", "ARMInstructionSelector.cpp", "ARMISelDAGToDAG.cpp", "ARMISelLowering.cpp", "ARMInstrInfo.cpp", "ARMLegalizerInfo.cpp", "ARMParallelDSP.cpp", "ARMLoadStoreOptimizer.cpp", "ARMMCInstLower.cpp", "ARMMachineFunctionInfo.cpp", "ARMMacroFusion.cpp", "ARMRegisterInfo.cpp", "ARMOptimizeBarriersPass.cpp", "ARMRegisterBankInfo.cpp", "ARMSelectionDAGInfo.cpp", "ARMSubtarget.cpp", "ARMTargetMachine.cpp", "ARMTargetObjectFile.cpp", "ARMTargetTransformInfo.cpp", "MLxExpansionPass.cpp", "Thumb1FrameLowering.cpp", "Thumb1InstrInfo.cpp", "ThumbRegisterInfo.cpp", "Thumb2ITBlockPass.cpp", "Thumb2InstrInfo.cpp", "Thumb2SizeReduction.cpp", "ARMComputeBlockSize.cpp")
-    ctx = ctx.enter_directory(ctx, "AsmParser")
+    ctx = ctx.push_directory(ctx, "AsmParser")
     ctx.add_llvm_library(ctx, "LLVMARMAsmParser", "ARMAsmParser.cpp")
-    ctx = ctx.exit_directory(ctx, "AsmParser")
-    ctx = ctx.enter_directory(ctx, "Disassembler")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Disassembler")
     ctx.add_llvm_library(ctx, "LLVMARMDisassembler", "ARMDisassembler.cpp")
-    ctx = ctx.exit_directory(ctx, "Disassembler")
-    ctx = ctx.enter_directory(ctx, "MCTargetDesc")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCTargetDesc")
     ctx.add_llvm_library(ctx, "LLVMARMDesc", "ARMAsmBackend.cpp", "ARMELFObjectWriter.cpp", "ARMELFStreamer.cpp", "ARMInstPrinter.cpp", "ARMMachObjectWriter.cpp", "ARMMachORelocationInfo.cpp", "ARMMCAsmInfo.cpp", "ARMMCCodeEmitter.cpp", "ARMMCExpr.cpp", "ARMMCTargetDesc.cpp", "ARMTargetStreamer.cpp", "ARMUnwindOpAsm.cpp", "ARMWinCOFFObjectWriter.cpp", "ARMWinCOFFStreamer.cpp")
-    ctx = ctx.exit_directory(ctx, "MCTargetDesc")
-    ctx = ctx.enter_directory(ctx, "TargetInfo")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "TargetInfo")
     ctx.add_llvm_library(ctx, "LLVMARMInfo", "ARMTargetInfo.cpp")
-    ctx = ctx.exit_directory(ctx, "TargetInfo")
-    ctx = ctx.enter_directory(ctx, "Utils")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Utils")
     ctx.add_llvm_library(ctx, "LLVMARMUtils", "ARMBaseInfo.cpp")
-    ctx = ctx.exit_directory(ctx, "Utils")
-    ctx = ctx.exit_directory(ctx, "lib/Target/ARM")
-    ctx = ctx.enter_directory(ctx, "lib/Target/AArch64")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib/Target/AArch64")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "AArch64.td")
     ctx.tablegen(ctx, "LLVM", "AArch64GenAsmMatcher.inc", "-gen-asm-matcher")
     ctx.tablegen(ctx, "LLVM", "AArch64GenAsmWriter.inc", "-gen-asm-writer")
@@ -418,23 +418,23 @@
     ctx.tablegen(ctx, "LLVM", "AArch64GenExegesis.inc", "-gen-exegesis")
     ctx.add_public_tablegen_target(ctx, "AArch64CommonTableGen")
     ctx.add_llvm_target(ctx, "AArch64CodeGen", "AArch64A57FPLoadBalancing.cpp", "AArch64AdvSIMDScalarPass.cpp", "AArch64AsmPrinter.cpp", "AArch64BranchTargets.cpp", "AArch64CallingConvention.cpp", "AArch64CallLowering.cpp", "AArch64CleanupLocalDynamicTLSPass.cpp", "AArch64CollectLOH.cpp", "AArch64CondBrTuning.cpp", "AArch64ConditionalCompares.cpp", "AArch64DeadRegisterDefinitionsPass.cpp", "AArch64ExpandImm.cpp", "AArch64ExpandPseudoInsts.cpp", "AArch64FalkorHWPFFix.cpp", "AArch64FastISel.cpp", "AArch64A53Fix835769.cpp", "AArch64FrameLowering.cpp", "AArch64CompressJumpTables.cpp", "AArch64ConditionOptimizer.cpp", "AArch64RedundantCopyElimination.cpp", "AArch64ISelDAGToDAG.cpp", "AArch64ISelLowering.cpp", "AArch64InstrInfo.cpp", "AArch64InstructionSelector.cpp", "AArch64LegalizerInfo.cpp", "AArch64LoadStoreOptimizer.cpp", "AArch64MacroFusion.cpp", "AArch64MCInstLower.cpp", "AArch64PreLegalizerCombiner.cpp", "AArch64PromoteConstant.cpp", "AArch64PBQPRegAlloc.cpp", "AArch64RegisterBankInfo.cpp", "AArch64RegisterInfo.cpp", "AArch64SelectionDAGInfo.cpp", "AArch64SpeculationHardening.cpp", "AArch64StorePairSuppress.cpp", "AArch64Subtarget.cpp", "AArch64TargetMachine.cpp", "AArch64TargetObjectFile.cpp", "AArch64TargetTransformInfo.cpp", "AArch64SIMDInstrOpt.cpp", "DEPENDS", "intrinsics_gen")
-    ctx = ctx.enter_directory(ctx, "AsmParser")
+    ctx = ctx.push_directory(ctx, "AsmParser")
     ctx.add_llvm_library(ctx, "LLVMAArch64AsmParser", "AArch64AsmParser.cpp")
-    ctx = ctx.exit_directory(ctx, "AsmParser")
-    ctx = ctx.enter_directory(ctx, "Disassembler")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Disassembler")
     ctx.add_llvm_library(ctx, "LLVMAArch64Disassembler", "AArch64Disassembler.cpp", "AArch64ExternalSymbolizer.cpp")
-    ctx = ctx.exit_directory(ctx, "Disassembler")
-    ctx = ctx.enter_directory(ctx, "MCTargetDesc")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCTargetDesc")
     ctx.add_llvm_library(ctx, "LLVMAArch64Desc", "AArch64AsmBackend.cpp", "AArch64ELFObjectWriter.cpp", "AArch64ELFStreamer.cpp", "AArch64InstPrinter.cpp", "AArch64MCAsmInfo.cpp", "AArch64MCCodeEmitter.cpp", "AArch64MCExpr.cpp", "AArch64MCTargetDesc.cpp", "AArch64MachObjectWriter.cpp", "AArch64TargetStreamer.cpp", "AArch64WinCOFFObjectWriter.cpp", "AArch64WinCOFFStreamer.cpp")
-    ctx = ctx.exit_directory(ctx, "MCTargetDesc")
-    ctx = ctx.enter_directory(ctx, "TargetInfo")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "TargetInfo")
     ctx.add_llvm_library(ctx, "LLVMAArch64Info", "AArch64TargetInfo.cpp")
-    ctx = ctx.exit_directory(ctx, "TargetInfo")
-    ctx = ctx.enter_directory(ctx, "Utils")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Utils")
     ctx.add_llvm_library(ctx, "LLVMAArch64Utils", "AArch64BaseInfo.cpp")
-    ctx = ctx.exit_directory(ctx, "Utils")
-    ctx = ctx.exit_directory(ctx, "lib/Target/AArch64")
-    ctx = ctx.enter_directory(ctx, "lib/Target/Mips")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib/Target/Mips")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "Mips.td")
     ctx.tablegen(ctx, "LLVM", "MipsGenAsmMatcher.inc", "-gen-asm-matcher")
     ctx.tablegen(ctx, "LLVM", "MipsGenAsmWriter.inc", "-gen-asm-writer")
@@ -451,20 +451,20 @@
     ctx.tablegen(ctx, "LLVM", "MipsGenSubtargetInfo.inc", "-gen-subtarget")
     ctx.add_public_tablegen_target(ctx, "MipsCommonTableGen")
     ctx.add_llvm_target(ctx, "MipsCodeGen", "Mips16FrameLowering.cpp", "Mips16HardFloat.cpp", "Mips16HardFloatInfo.cpp", "Mips16InstrInfo.cpp", "Mips16ISelDAGToDAG.cpp", "Mips16ISelLowering.cpp", "Mips16RegisterInfo.cpp", "MipsAnalyzeImmediate.cpp", "MipsAsmPrinter.cpp", "MipsCallLowering.cpp", "MipsCCState.cpp", "MipsConstantIslandPass.cpp", "MipsDelaySlotFiller.cpp", "MipsExpandPseudo.cpp", "MipsFastISel.cpp", "MipsInstrInfo.cpp", "MipsInstructionSelector.cpp", "MipsISelDAGToDAG.cpp", "MipsISelLowering.cpp", "MipsFrameLowering.cpp", "MipsLegalizerInfo.cpp", "MipsBranchExpansion.cpp", "MipsMCInstLower.cpp", "MipsMachineFunction.cpp", "MipsModuleISelDAGToDAG.cpp", "MipsOptimizePICCall.cpp", "MipsOs16.cpp", "MipsPreLegalizerCombiner.cpp", "MipsRegisterBankInfo.cpp", "MipsRegisterInfo.cpp", "MipsSEFrameLowering.cpp", "MipsSEInstrInfo.cpp", "MipsSEISelDAGToDAG.cpp", "MipsSEISelLowering.cpp", "MipsSERegisterInfo.cpp", "MipsSubtarget.cpp", "MipsTargetMachine.cpp", "MipsTargetObjectFile.cpp", "MicroMipsSizeReduction.cpp")
-    ctx = ctx.enter_directory(ctx, "AsmParser")
+    ctx = ctx.push_directory(ctx, "AsmParser")
     ctx.add_llvm_library(ctx, "LLVMMipsAsmParser", "MipsAsmParser.cpp")
-    ctx = ctx.exit_directory(ctx, "AsmParser")
-    ctx = ctx.enter_directory(ctx, "Disassembler")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Disassembler")
     ctx.add_llvm_library(ctx, "LLVMMipsDisassembler", "MipsDisassembler.cpp")
-    ctx = ctx.exit_directory(ctx, "Disassembler")
-    ctx = ctx.enter_directory(ctx, "MCTargetDesc")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "MCTargetDesc")
     ctx.add_llvm_library(ctx, "LLVMMipsDesc", "MipsABIInfo.cpp", "MipsABIFlagsSection.cpp", "MipsAsmBackend.cpp", "MipsELFObjectWriter.cpp", "MipsELFStreamer.cpp", "MipsInstPrinter.cpp", "MipsMCAsmInfo.cpp", "MipsMCCodeEmitter.cpp", "MipsMCExpr.cpp", "MipsMCTargetDesc.cpp", "MipsNaClELFStreamer.cpp", "MipsOptionRecord.cpp", "MipsTargetStreamer.cpp")
-    ctx = ctx.exit_directory(ctx, "MCTargetDesc")
-    ctx = ctx.enter_directory(ctx, "TargetInfo")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "TargetInfo")
     ctx.add_llvm_library(ctx, "LLVMMipsInfo", "MipsTargetInfo.cpp")
-    ctx = ctx.exit_directory(ctx, "TargetInfo")
-    ctx = ctx.exit_directory(ctx, "lib/Target/Mips")
-    ctx = ctx.enter_directory(ctx, "tools/clang")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "tools/clang")
     ctx.set(ctx, "CLANG_RESOURCE_DIR", "", "CACHE", "STRING", "Relative directory from the Clang binary to its resource files.")
     ctx.set(ctx, "C_INCLUDE_DIRS", "", "CACHE", "STRING", "Colon separated list of directories clang will search for headers.")
     ctx.set(ctx, "GCC_INSTALL_PREFIX", "", "CACHE", "PATH", "Directory where gcc is installed.")
@@ -475,9 +475,9 @@
     ctx.set(ctx, "CLANG_DEFAULT_STD_C", "", "CACHE", "STRING", "Default standard to use for C/ObjC code (IDENT from LangStandards.def, empty for platform default)")
     ctx.set(ctx, "CLANG_DEFAULT_STD_CXX", "", "CACHE", "STRING", "Default standard to use for C++/ObjC++ code (IDENT from LangStandards.def, empty for platform default)")
     ctx.set(ctx, "CLANG_DEFAULT_LINKER", "", "CACHE", "STRING", "Default linker to use (linker name or absolute path, empty for platform default)")
-    ctx.set(ctx, "CLANG_DEFAULT_CXX_STDLIB", "", "CACHE", "STRING", "Default C++ stdlib to use (\\\"libstdc++\\\" or \\\"libc++\\\", empty for platform default")
-    ctx.set(ctx, "CLANG_DEFAULT_RTLIB", "", "CACHE", "STRING", "Default runtime library to use (\\\"libgcc\\\" or \\\"compiler-rt\\\", empty for platform default)")
-    ctx.set(ctx, "CLANG_DEFAULT_UNWINDLIB", "", "CACHE", "STRING", "Default unwind library to use (\\\"none\\\" \\\"libgcc\\\" or \\\"libunwind\\\", empty to match runtime library.)")
+    ctx.set(ctx, "CLANG_DEFAULT_CXX_STDLIB", "", "CACHE", "STRING", "Default C++ stdlib to use (\"libstdc++\" or \"libc++\", empty for platform default")
+    ctx.set(ctx, "CLANG_DEFAULT_RTLIB", "", "CACHE", "STRING", "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)")
+    ctx.set(ctx, "CLANG_DEFAULT_UNWINDLIB", "", "CACHE", "STRING", "Default unwind library to use (\"none\" \"libgcc\" or \"libunwind\", empty to match runtime library.)")
     ctx.set(ctx, "CLANG_DEFAULT_OBJCOPY", "objcopy", "CACHE", "STRING", "Default objcopy executable to use.")
     ctx.set(ctx, "CLANG_DEFAULT_OPENMP_RUNTIME", "libomp", "CACHE", "STRING", "Default OpenMP runtime used by -fopenmp.")
     ctx.set(ctx, "CLANG_OPENMP_NVPTX_DEFAULT_ARCH", "sm_35", "CACHE", "STRING", "Default architecture for OpenMP offloading to Nvidia GPUs.")
@@ -486,26 +486,26 @@
     ctx.set(ctx, "CLANG_VENDOR_UTI", "org.llvm.clang", "CACHE", "STRING", "Vendor-specific uti.")
     ctx.set(ctx, "CLANG_PYTHON_BINDINGS_VERSIONS", "", "CACHE", "STRING", "Python versions to install libclang python bindings for")
     ctx.set(ctx, "CLANG_LIBDIR_SUFFIX", "")
-    ctx.set(ctx, "CLANG_SOURCE_DIR", "/tools/clang")
-    ctx.set(ctx, "CLANG_BINARY_DIR", "/tools/clang")
+    ctx.set(ctx, "CLANG_SOURCE_DIR", "/root/tools/clang")
+    ctx.set(ctx, "CLANG_BINARY_DIR", "/root/tools/clang")
     ctx.set(ctx, "CLANG_VERSION", "..")
-    ctx.configure_file(ctx, "/tools/clang/include/clang/Basic/Version.inc.in", "/tools/clang/include/clang/Basic/Version.inc")
+    ctx.configure_file(ctx, "/root/tools/clang/include/clang/Basic/Version.inc.in", "/root/tools/clang/include/clang/Basic/Version.inc")
     ctx.set(ctx, "HOST_LINK_VERSION")
     ctx.set(ctx, "CMAKE_INCLUDE_CURRENT_DIR", "ON")
     ctx.set(ctx, "CLANG_EXECUTABLE_VERSION", "", "CACHE", "STRING", "Major version number that will be appended to the clang executable name")
     ctx.set(ctx, "LIBCLANG_LIBRARY_VERSION", "", "CACHE", "STRING", "Major version number that will be appended to the libclang library")
-    ctx = ctx.enter_directory(ctx, "utils/TableGen")
+    ctx = ctx.push_directory(ctx, "utils/TableGen")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_tablegen(ctx, "clang-tblgen", "CLANG", "ClangASTNodesEmitter.cpp", "ClangAttrEmitter.cpp", "ClangCommentCommandInfoEmitter.cpp", "ClangCommentHTMLNamedCharacterReferenceEmitter.cpp", "ClangCommentHTMLTagsEmitter.cpp", "ClangDataCollectorsEmitter.cpp", "ClangDiagnosticsEmitter.cpp", "ClangOpenCLBuiltinEmitter.cpp", "ClangOptionDocEmitter.cpp", "ClangSACheckersEmitter.cpp", "NeonEmitter.cpp", "TableGen.cpp")
-    ctx = ctx.exit_directory(ctx, "utils/TableGen")
-    ctx = ctx.enter_directory(ctx, "include")
-    ctx = ctx.enter_directory(ctx, "clang")
-    ctx = ctx.enter_directory(ctx, "AST")
-    ctx.clang_tablegen(ctx, "Attrs.inc", "-gen-clang-attr-classes", "-I", "/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrClasses")
-    ctx.clang_tablegen(ctx, "AttrImpl.inc", "-gen-clang-attr-impl", "-I", "/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrImpl")
-    ctx.clang_tablegen(ctx, "AttrTextNodeDump.inc", "-gen-clang-attr-text-node-dump", "-I", "/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrTextDump")
-    ctx.clang_tablegen(ctx, "AttrNodeTraverse.inc", "-gen-clang-attr-node-traverse", "-I", "/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrTraverse")
-    ctx.clang_tablegen(ctx, "AttrVisitor.inc", "-gen-clang-attr-ast-visitor", "-I", "/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrVisitor")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "include")
+    ctx = ctx.push_directory(ctx, "clang")
+    ctx = ctx.push_directory(ctx, "AST")
+    ctx.clang_tablegen(ctx, "Attrs.inc", "-gen-clang-attr-classes", "-I", "/root/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrClasses")
+    ctx.clang_tablegen(ctx, "AttrImpl.inc", "-gen-clang-attr-impl", "-I", "/root/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrImpl")
+    ctx.clang_tablegen(ctx, "AttrTextNodeDump.inc", "-gen-clang-attr-text-node-dump", "-I", "/root/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrTextDump")
+    ctx.clang_tablegen(ctx, "AttrNodeTraverse.inc", "-gen-clang-attr-node-traverse", "-I", "/root/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrTraverse")
+    ctx.clang_tablegen(ctx, "AttrVisitor.inc", "-gen-clang-attr-ast-visitor", "-I", "/root/tools/clang/include/clang/AST/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrVisitor")
     ctx.clang_tablegen(ctx, "StmtNodes.inc", "-gen-clang-stmt-nodes", "SOURCE", "../Basic/StmtNodes.td", "TARGET", "ClangStmtNodes")
     ctx.clang_tablegen(ctx, "DeclNodes.inc", "-gen-clang-decl-nodes", "SOURCE", "../Basic/DeclNodes.td", "TARGET", "ClangDeclNodes")
     ctx.clang_tablegen(ctx, "CommentNodes.inc", "-gen-clang-comment-nodes", "SOURCE", "../Basic/CommentNodes.td", "TARGET", "ClangCommentNodes")
@@ -515,8 +515,8 @@
     ctx.clang_tablegen(ctx, "CommentCommandInfo.inc", "-gen-clang-comment-command-info", "SOURCE", "CommentCommands.td", "TARGET", "ClangCommentCommandInfo")
     ctx.clang_tablegen(ctx, "CommentCommandList.inc", "-gen-clang-comment-command-list", "SOURCE", "CommentCommands.td", "TARGET", "ClangCommentCommandList")
     ctx.clang_tablegen(ctx, "StmtDataCollectors.inc", "-gen-clang-data-collectors", "SOURCE", "StmtDataCollectors.td", "TARGET", "StmtDataCollectors")
-    ctx = ctx.exit_directory(ctx, "AST")
-    ctx = ctx.enter_directory(ctx, "Basic")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Basic")
     ctx.clang_diag_gen(ctx, "Analysis")
     ctx.clang_diag_gen(ctx, "AST")
     ctx.clang_diag_gen(ctx, "Comment")
@@ -531,215 +531,216 @@
     ctx.clang_diag_gen(ctx, "Serialization")
     ctx.clang_tablegen(ctx, "DiagnosticGroups.inc", "-gen-clang-diag-groups", "SOURCE", "Diagnostic.td", "TARGET", "ClangDiagnosticGroups")
     ctx.clang_tablegen(ctx, "DiagnosticIndexName.inc", "-gen-clang-diags-index-name", "SOURCE", "Diagnostic.td", "TARGET", "ClangDiagnosticIndexName")
-    ctx.clang_tablegen(ctx, "AttrList.inc", "-gen-clang-attr-list", "-I", "/tools/clang/include/clang/Basic/../../", "SOURCE", "Attr.td", "TARGET", "ClangAttrList")
-    ctx.clang_tablegen(ctx, "AttrSubMatchRulesList.inc", "-gen-clang-attr-subject-match-rule-list", "-I", "/tools/clang/include/clang/Basic/../../", "SOURCE", "Attr.td", "TARGET", "ClangAttrSubjectMatchRuleList")
-    ctx.clang_tablegen(ctx, "AttrHasAttributeImpl.inc", "-gen-clang-attr-has-attribute-impl", "-I", "/tools/clang/include/clang/Basic/../../", "SOURCE", "Attr.td", "TARGET", "ClangAttrHasAttributeImpl")
-    ctx.clang_tablegen(ctx, "OpenCLBuiltins.inc", "-I", "/tools/clang/include/clang/Basic/../../", "-gen-clang-opencl-builtins", "SOURCE", "OpenCLBuiltins.td", "TARGET", "ClangOpenCLBuiltinsImpl")
+    ctx.clang_tablegen(ctx, "AttrList.inc", "-gen-clang-attr-list", "-I", "/root/tools/clang/include/clang/Basic/../../", "SOURCE", "Attr.td", "TARGET", "ClangAttrList")
+    ctx.clang_tablegen(ctx, "AttrSubMatchRulesList.inc", "-gen-clang-attr-subject-match-rule-list", "-I", "/root/tools/clang/include/clang/Basic/../../", "SOURCE", "Attr.td", "TARGET", "ClangAttrSubjectMatchRuleList")
+    ctx.clang_tablegen(ctx, "AttrHasAttributeImpl.inc", "-gen-clang-attr-has-attribute-impl", "-I", "/root/tools/clang/include/clang/Basic/../../", "SOURCE", "Attr.td", "TARGET", "ClangAttrHasAttributeImpl")
+    ctx.clang_tablegen(ctx, "OpenCLBuiltins.inc", "-I", "/root/tools/clang/include/clang/Basic/../../", "-gen-clang-opencl-builtins", "SOURCE", "OpenCLBuiltins.td", "TARGET", "ClangOpenCLBuiltinsImpl")
     ctx.clang_tablegen(ctx, "arm_neon.inc", "-gen-arm-neon-sema", "SOURCE", "arm_neon.td", "TARGET", "ClangARMNeon")
     ctx.clang_tablegen(ctx, "arm_fp16.inc", "-gen-arm-neon-sema", "SOURCE", "arm_fp16.td", "TARGET", "ClangARMFP16")
-    ctx = ctx.exit_directory(ctx, "Basic")
-    ctx = ctx.enter_directory(ctx, "Driver")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Driver")
     ctx.set(ctx, "LLVM_TARGET_DEFINITIONS", "Options.td")
     ctx.tablegen(ctx, "LLVM", "Options.inc", "-gen-opt-parser-defs")
     ctx.add_public_tablegen_target(ctx, "ClangDriverOptions")
-    ctx = ctx.exit_directory(ctx, "Driver")
-    ctx = ctx.enter_directory(ctx, "Parse")
-    ctx.clang_tablegen(ctx, "AttrParserStringSwitches.inc", "-gen-clang-attr-parser-string-switches", "-I", "/tools/clang/include/clang/Parse/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParserStringSwitches")
-    ctx.clang_tablegen(ctx, "AttrSubMatchRulesParserStringSwitches.inc", "-gen-clang-attr-subject-match-rules-parser-string-switches", "-I", "/tools/clang/include/clang/Parse/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrSubMatchRulesParserStringSwitches")
-    ctx = ctx.exit_directory(ctx, "Parse")
-    ctx = ctx.enter_directory(ctx, "Sema")
-    ctx.clang_tablegen(ctx, "AttrTemplateInstantiate.inc", "-gen-clang-attr-template-instantiate", "-I", "/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrTemplateInstantiate")
-    ctx.clang_tablegen(ctx, "AttrParsedAttrList.inc", "-gen-clang-attr-parsed-attr-list", "-I", "/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParsedAttrList")
-    ctx.clang_tablegen(ctx, "AttrParsedAttrKinds.inc", "-gen-clang-attr-parsed-attr-kinds", "-I", "/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParsedAttrKinds")
-    ctx.clang_tablegen(ctx, "AttrSpellingListIndex.inc", "-gen-clang-attr-spelling-index", "-I", "/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrSpellingListIndex")
-    ctx.clang_tablegen(ctx, "AttrParsedAttrImpl.inc", "-gen-clang-attr-parsed-attr-impl", "-I", "/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParsedAttrImpl")
-    ctx = ctx.exit_directory(ctx, "Sema")
-    ctx = ctx.enter_directory(ctx, "Serialization")
-    ctx.clang_tablegen(ctx, "AttrPCHRead.inc", "-gen-clang-attr-pch-read", "-I", "/tools/clang/include/clang/Serialization/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrPCHRead")
-    ctx.clang_tablegen(ctx, "AttrPCHWrite.inc", "-gen-clang-attr-pch-write", "-I", "/tools/clang/include/clang/Serialization/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrPCHWrite")
-    ctx = ctx.exit_directory(ctx, "Serialization")
-    ctx = ctx.enter_directory(ctx, "StaticAnalyzer/Checkers")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Parse")
+    ctx.clang_tablegen(ctx, "AttrParserStringSwitches.inc", "-gen-clang-attr-parser-string-switches", "-I", "/root/tools/clang/include/clang/Parse/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParserStringSwitches")
+    ctx.clang_tablegen(ctx, "AttrSubMatchRulesParserStringSwitches.inc", "-gen-clang-attr-subject-match-rules-parser-string-switches", "-I", "/root/tools/clang/include/clang/Parse/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrSubMatchRulesParserStringSwitches")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Sema")
+    ctx.clang_tablegen(ctx, "AttrTemplateInstantiate.inc", "-gen-clang-attr-template-instantiate", "-I", "/root/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrTemplateInstantiate")
+    ctx.clang_tablegen(ctx, "AttrParsedAttrList.inc", "-gen-clang-attr-parsed-attr-list", "-I", "/root/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParsedAttrList")
+    ctx.clang_tablegen(ctx, "AttrParsedAttrKinds.inc", "-gen-clang-attr-parsed-attr-kinds", "-I", "/root/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParsedAttrKinds")
+    ctx.clang_tablegen(ctx, "AttrSpellingListIndex.inc", "-gen-clang-attr-spelling-index", "-I", "/root/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrSpellingListIndex")
+    ctx.clang_tablegen(ctx, "AttrParsedAttrImpl.inc", "-gen-clang-attr-parsed-attr-impl", "-I", "/root/tools/clang/include/clang/Sema/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrParsedAttrImpl")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Serialization")
+    ctx.clang_tablegen(ctx, "AttrPCHRead.inc", "-gen-clang-attr-pch-read", "-I", "/root/tools/clang/include/clang/Serialization/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrPCHRead")
+    ctx.clang_tablegen(ctx, "AttrPCHWrite.inc", "-gen-clang-attr-pch-write", "-I", "/root/tools/clang/include/clang/Serialization/../../", "SOURCE", "../Basic/Attr.td", "TARGET", "ClangAttrPCHWrite")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "StaticAnalyzer/Checkers")
     ctx.clang_tablegen(ctx, "Checkers.inc", "-gen-clang-sa-checkers", "SOURCE", "Checkers.td", "TARGET", "ClangSACheckers")
-    ctx = ctx.exit_directory(ctx, "StaticAnalyzer/Checkers")
-    ctx = ctx.exit_directory(ctx, "clang")
-    ctx = ctx.exit_directory(ctx, "include")
-    ctx = ctx.enter_directory(ctx, "lib")
-    ctx = ctx.enter_directory(ctx, "Headers")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "lib")
+    ctx = ctx.push_directory(ctx, "Headers")
     ctx.set(ctx, "files", "adxintrin.h", "altivec.h", "ammintrin.h", "arm_acle.h", "armintr.h", "arm64intr.h", "avx2intrin.h", "avx512bf16intrin.h", "avx512bwintrin.h", "avx512bitalgintrin.h", "avx512vlbitalgintrin.h", "avx512cdintrin.h", "avx512vpopcntdqintrin.h", "avx512dqintrin.h", "avx512erintrin.h", "avx512fintrin.h", "avx512ifmaintrin.h", "avx512ifmavlintrin.h", "avx512pfintrin.h", "avx512vbmiintrin.h", "avx512vbmivlintrin.h", "avx512vbmi2intrin.h", "avx512vlvbmi2intrin.h", "avx512vlbf16intrin.h", "avx512vlbwintrin.h", "avx512vlcdintrin.h", "avx512vldqintrin.h", "avx512vlintrin.h", "avx512vp2intersectintrin.h", "avx512vlvp2intersectintrin.h", "avx512vpopcntdqvlintrin.h", "avx512vnniintrin.h", "avx512vlvnniintrin.h", "avxintrin.h", "bmi2intrin.h", "bmiintrin.h", "__clang_cuda_builtin_vars.h", "__clang_cuda_cmath.h", "__clang_cuda_complex_builtins.h", "__clang_cuda_device_functions.h", "__clang_cuda_intrinsics.h", "__clang_cuda_libdevice_declares.h", "__clang_cuda_math_forward_declares.h", "__clang_cuda_runtime_wrapper.h", "cetintrin.h", "cldemoteintrin.h", "clzerointrin.h", "cpuid.h", "clflushoptintrin.h", "clwbintrin.h", "emmintrin.h", "enqcmdintrin.h", "f16cintrin.h", "float.h", "fma4intrin.h", "fmaintrin.h", "fxsrintrin.h", "gfniintrin.h", "htmintrin.h", "htmxlintrin.h", "ia32intrin.h", "immintrin.h", "intrin.h", "inttypes.h", "invpcidintrin.h", "iso646.h", "limits.h", "lwpintrin.h", "lzcntintrin.h", "mm3dnow.h", "mmintrin.h", "mm_malloc.h", "module.modulemap", "movdirintrin.h", "msa.h", "mwaitxintrin.h", "nmmintrin.h", "opencl-c.h", "pkuintrin.h", "pmmintrin.h", "pconfigintrin.h", "popcntintrin.h", "prfchwintrin.h", "ptwriteintrin.h", "rdseedintrin.h", "rtmintrin.h", "sgxintrin.h", "s390intrin.h", "shaintrin.h", "smmintrin.h", "stdalign.h", "stdarg.h", "stdatomic.h", "stdbool.h", "stddef.h", "__stddef_max_align_t.h", "stdint.h", "stdnoreturn.h", "tbmintrin.h", "tgmath.h", "tmmintrin.h", "unwind.h", "vadefs.h", "vaesintrin.h", "varargs.h", "vecintrin.h", "vpclmulqdqintrin.h", "waitpkgintrin.h", "wbnoinvdintrin.h", "wmmintrin.h", "__wmmintrin_aes.h", "__wmmintrin_pclmul.h", "x86intrin.h", "xmmintrin.h", "xopintrin.h", "xsavecintrin.h", "xsaveintrin.h", "xsaveoptintrin.h", "xsavesintrin.h", "xtestintrin.h")
     ctx.set(ctx, "cuda_wrapper_files", "cuda_wrappers/algorithm", "cuda_wrappers/complex", "cuda_wrappers/new")
     ctx.set(ctx, "ppc_wrapper_files", "ppc_wrappers/mmintrin.h", "ppc_wrappers/xmmintrin.h", "ppc_wrappers/mm_malloc.h", "ppc_wrappers/emmintrin.h")
     ctx.set(ctx, "openmp_wrapper_files", "openmp_wrappers/math.h", "openmp_wrappers/cmath", "openmp_wrappers/__clang_openmp_math.h", "openmp_wrappers/__clang_openmp_math_declares.h")
-    ctx.set(ctx, "output_dir", "/clang//include")
+    ctx.set(ctx, "output_dir", "/clang/../include")
     ctx.set(ctx, "out_files")
     ctx.set(ctx, "generated_files")
-    ctx.set(ctx, "header_install_dir", "lib/clang//include")
-    ctx = ctx.exit_directory(ctx, "Headers")
-    ctx = ctx.enter_directory(ctx, "Basic")
+    ctx.set(ctx, "header_install_dir", "lib/clang/../include")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Basic")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Core", "MC", "Support")
-    ctx.set(ctx, "version_inc", "/tools/clang/lib/Basic/VCSVersion.inc")
+    ctx.set(ctx, "version_inc", "/root/tools/clang/lib/Basic/VCSVersion.inc")
     ctx.set(ctx, "generate_vcs_version_script", "/GenerateVersionFromVCS.cmake")
-    ctx.add_clang_library(ctx, "clangBasic", "Attributes.cpp", "Builtins.cpp", "CharInfo.cpp", "CodeGenOptions.cpp", "Cuda.cpp", "Diagnostic.cpp", "DiagnosticIDs.cpp", "DiagnosticOptions.cpp", "FileManager.cpp", "FileSystemStatCache.cpp", "FixedPoint.cpp", "IdentifierTable.cpp", "LangOptions.cpp", "Module.cpp", "ObjCRuntime.cpp", "OpenMPKinds.cpp", "OperatorPrecedence.cpp", "SanitizerBlacklist.cpp", "SanitizerSpecialCaseList.cpp", "Sanitizers.cpp", "SourceLocation.cpp", "SourceManager.cpp", "TargetInfo.cpp", "Targets.cpp", "Targets/AArch64.cpp", "Targets/AMDGPU.cpp", "Targets/ARC.cpp", "Targets/ARM.cpp", "Targets/AVR.cpp", "Targets/BPF.cpp", "Targets/Hexagon.cpp", "Targets/Lanai.cpp", "Targets/Le64.cpp", "Targets/MSP430.cpp", "Targets/Mips.cpp", "Targets/NVPTX.cpp", "Targets/OSTargets.cpp", "Targets/PNaCl.cpp", "Targets/PPC.cpp", "Targets/RISCV.cpp", "Targets/SPIR.cpp", "Targets/Sparc.cpp", "Targets/SystemZ.cpp", "Targets/TCE.cpp", "Targets/WebAssembly.cpp", "Targets/X86.cpp", "Targets/XCore.cpp", "TokenKinds.cpp", "Version.cpp", "Warnings.cpp", "XRayInstr.cpp", "XRayLists.cpp", "")
-    ctx = ctx.exit_directory(ctx, "Basic")
-    ctx = ctx.enter_directory(ctx, "Lex")
+    ctx.add_clang_library(ctx, "clangBasic", "Attributes.cpp", "Builtins.cpp", "CharInfo.cpp", "CodeGenOptions.cpp", "Cuda.cpp", "Diagnostic.cpp", "DiagnosticIDs.cpp", "DiagnosticOptions.cpp", "FileManager.cpp", "FileSystemStatCache.cpp", "FixedPoint.cpp", "IdentifierTable.cpp", "LangOptions.cpp", "Module.cpp", "ObjCRuntime.cpp", "OpenMPKinds.cpp", "OperatorPrecedence.cpp", "SanitizerBlacklist.cpp", "SanitizerSpecialCaseList.cpp", "Sanitizers.cpp", "SourceLocation.cpp", "SourceManager.cpp", "TargetInfo.cpp", "Targets.cpp", "Targets/AArch64.cpp", "Targets/AMDGPU.cpp", "Targets/ARC.cpp", "Targets/ARM.cpp", "Targets/AVR.cpp", "Targets/BPF.cpp", "Targets/Hexagon.cpp", "Targets/Lanai.cpp", "Targets/Le64.cpp", "Targets/MSP430.cpp", "Targets/Mips.cpp", "Targets/NVPTX.cpp", "Targets/OSTargets.cpp", "Targets/PNaCl.cpp", "Targets/PPC.cpp", "Targets/RISCV.cpp", "Targets/SPIR.cpp", "Targets/Sparc.cpp", "Targets/SystemZ.cpp", "Targets/TCE.cpp", "Targets/WebAssembly.cpp", "Targets/X86.cpp", "Targets/XCore.cpp", "TokenKinds.cpp", "Version.cpp", "Warnings.cpp", "XRayInstr.cpp", "XRayLists.cpp", "/root/tools/clang/lib/Basic/VCSVersion.inc")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Lex")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
     ctx.add_clang_library(ctx, "clangLex", "DependencyDirectivesSourceMinimizer.cpp", "HeaderMap.cpp", "HeaderSearch.cpp", "Lexer.cpp", "LiteralSupport.cpp", "MacroArgs.cpp", "MacroInfo.cpp", "ModuleMap.cpp", "PPCaching.cpp", "PPCallbacks.cpp", "PPConditionalDirectiveRecord.cpp", "PPDirectives.cpp", "PPExpressions.cpp", "PPLexerChange.cpp", "PPMacroExpansion.cpp", "Pragma.cpp", "PreprocessingRecord.cpp", "Preprocessor.cpp", "PreprocessorLexer.cpp", "ScratchBuffer.cpp", "TokenConcatenation.cpp", "TokenLexer.cpp", "LINK_LIBS", "clangBasic")
-    ctx = ctx.exit_directory(ctx, "Lex")
-    ctx = ctx.enter_directory(ctx, "Parse")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Parse")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "MC", "MCParser", "Support")
     ctx.add_clang_library(ctx, "clangParse", "ParseAST.cpp", "ParseCXXInlineMethods.cpp", "ParseDecl.cpp", "ParseDeclCXX.cpp", "ParseExpr.cpp", "ParseExprCXX.cpp", "ParseInit.cpp", "ParseObjc.cpp", "ParseOpenMP.cpp", "ParsePragma.cpp", "ParseStmt.cpp", "ParseStmtAsm.cpp", "ParseTemplate.cpp", "ParseTentative.cpp", "Parser.cpp", "LINK_LIBS", "clangAST", "clangBasic", "clangLex", "clangSema")
-    ctx = ctx.exit_directory(ctx, "Parse")
-    ctx = ctx.enter_directory(ctx, "AST")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "AST")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "BinaryFormat", "Support")
     ctx.add_clang_library(ctx, "clangAST", "APValue.cpp", "ASTConsumer.cpp", "ASTContext.cpp", "ASTDiagnostic.cpp", "ASTDumper.cpp", "ASTImporter.cpp", "ASTImporterLookupTable.cpp", "ASTStructuralEquivalence.cpp", "ASTTypeTraits.cpp", "AttrImpl.cpp", "CXXInheritance.cpp", "Comment.cpp", "CommentBriefParser.cpp", "CommentCommandTraits.cpp", "CommentLexer.cpp", "CommentParser.cpp", "CommentSema.cpp", "ComparisonCategories.cpp", "DataCollection.cpp", "Decl.cpp", "DeclarationName.cpp", "DeclBase.cpp", "DeclCXX.cpp", "DeclFriend.cpp", "DeclGroup.cpp", "DeclObjC.cpp", "DeclOpenMP.cpp", "DeclPrinter.cpp", "DeclTemplate.cpp", "Expr.cpp", "ExprClassification.cpp", "ExprConstant.cpp", "ExprCXX.cpp", "ExprObjC.cpp", "ExternalASTMerger.cpp", "ExternalASTSource.cpp", "FormatString.cpp", "InheritViz.cpp", "ItaniumCXXABI.cpp", "ItaniumMangle.cpp", "JSONNodeDumper.cpp", "Mangle.cpp", "MicrosoftCXXABI.cpp", "MicrosoftMangle.cpp", "NestedNameSpecifier.cpp", "NSAPI.cpp", "ODRHash.cpp", "OSLog.cpp", "OpenMPClause.cpp", "ParentMap.cpp", "PrintfFormatString.cpp", "QualTypeNames.cpp", "RawCommentList.cpp", "RecordLayout.cpp", "RecordLayoutBuilder.cpp", "ScanfFormatString.cpp", "SelectorLocationsKind.cpp", "Stmt.cpp", "StmtCXX.cpp", "StmtIterator.cpp", "StmtObjC.cpp", "StmtOpenMP.cpp", "StmtPrinter.cpp", "StmtProfile.cpp", "StmtViz.cpp", "TemplateBase.cpp", "TemplateName.cpp", "TextNodeDumper.cpp", "Type.cpp", "TypeLoc.cpp", "TypePrinter.cpp", "VTableBuilder.cpp", "VTTBuilder.cpp", "LINK_LIBS", "clangBasic", "clangLex")
-    ctx = ctx.exit_directory(ctx, "AST")
-    ctx = ctx.enter_directory(ctx, "ASTMatchers")
-    ctx = ctx.enter_directory(ctx, "Dynamic")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "ASTMatchers")
+    ctx = ctx.push_directory(ctx, "Dynamic")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
     ctx.add_clang_library(ctx, "clangDynamicASTMatchers", "Diagnostics.cpp", "VariantValue.cpp", "Parser.cpp", "Registry.cpp", "LINK_LIBS", "clangAST", "clangASTMatchers", "clangBasic")
-    ctx = ctx.exit_directory(ctx, "Dynamic")
+    ctx = ctx.pop_directory(ctx)
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
     ctx.add_clang_library(ctx, "clangASTMatchers", "ASTMatchFinder.cpp", "ASTMatchersInternal.cpp", "LINK_LIBS", "clangAST", "clangBasic")
-    ctx = ctx.exit_directory(ctx, "ASTMatchers")
-    ctx = ctx.enter_directory(ctx, "CrossTU")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "CrossTU")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangCrossTU", "CrossTranslationUnit.cpp", "LINK_LIBS", "clangAST", "clangBasic", "clangFrontend", "clangIndex")
-    ctx = ctx.exit_directory(ctx, "CrossTU")
-    ctx = ctx.enter_directory(ctx, "Sema")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Sema")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangSema", "AnalysisBasedWarnings.cpp", "CodeCompleteConsumer.cpp", "DeclSpec.cpp", "DelayedDiagnostic.cpp", "IdentifierResolver.cpp", "JumpDiagnostics.cpp", "MultiplexExternalSemaSource.cpp", "ParsedAttr.cpp", "Scope.cpp", "ScopeInfo.cpp", "Sema.cpp", "SemaAccess.cpp", "SemaAttr.cpp", "SemaCXXScopeSpec.cpp", "SemaCast.cpp", "SemaChecking.cpp", "SemaCodeComplete.cpp", "SemaConsumer.cpp", "SemaCoroutine.cpp", "SemaCUDA.cpp", "SemaDecl.cpp", "SemaDeclAttr.cpp", "SemaDeclCXX.cpp", "SemaDeclObjC.cpp", "SemaExceptionSpec.cpp", "SemaExpr.cpp", "SemaExprCXX.cpp", "SemaExprMember.cpp", "SemaExprObjC.cpp", "SemaFixItUtils.cpp", "SemaInit.cpp", "SemaLambda.cpp", "SemaLookup.cpp", "SemaModule.cpp", "SemaObjCProperty.cpp", "SemaOpenMP.cpp", "SemaOverload.cpp", "SemaPseudoObject.cpp", "SemaStmt.cpp", "SemaStmtAsm.cpp", "SemaStmtAttr.cpp", "SemaTemplate.cpp", "SemaTemplateDeduction.cpp", "SemaTemplateInstantiate.cpp", "SemaTemplateInstantiateDecl.cpp", "SemaTemplateVariadic.cpp", "SemaType.cpp", "TypeLocBuilder.cpp", "LINK_LIBS", "clangAST", "clangAnalysis", "clangBasic", "clangEdit", "clangLex")
-    ctx = ctx.exit_directory(ctx, "Sema")
-    ctx = ctx.enter_directory(ctx, "CodeGen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "CodeGen")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Analysis", "BitReader", "BitWriter", "Core", "Coroutines", "Coverage", "IPO", "IRReader", "AggressiveInstCombine", "InstCombine", "Instrumentation", "LTO", "Linker", "MC", "ObjCARCOpts", "Object", "Passes", "ProfileData", "Remarks", "ScalarOpts", "Support", "Target", "TransformUtils")
     ctx.set(ctx, "codegen_deps", "intrinsics_gen")
-    ctx.add_clang_library(ctx, "clangCodeGen", "BackendUtil.cpp", "CGAtomic.cpp", "CGBlocks.cpp", "CGBuiltin.cpp", "CGCUDANV.cpp", "CGCUDARuntime.cpp", "CGCXX.cpp", "CGCXXABI.cpp", "CGCall.cpp", "CGClass.cpp", "CGCleanup.cpp", "CGCoroutine.cpp", "CGDebugInfo.cpp", "CGDecl.cpp", "CGDeclCXX.cpp", "CGException.cpp", "CGExpr.cpp", "CGExprAgg.cpp", "CGExprCXX.cpp", "CGExprComplex.cpp", "CGExprConstant.cpp", "CGExprScalar.cpp", "CGGPUBuiltin.cpp", "CGLoopInfo.cpp", "CGNonTrivialStruct.cpp", "CGObjC.cpp", "CGObjCGNU.cpp", "CGObjCMac.cpp", "CGObjCRuntime.cpp", "CGOpenCLRuntime.cpp", "CGOpenMPRuntime.cpp", "CGOpenMPRuntimeNVPTX.cpp", "CGRecordLayoutBuilder.cpp", "CGStmt.cpp", "CGStmtOpenMP.cpp", "CGVTT.cpp", "CGVTables.cpp", "CodeGenABITypes.cpp", "CodeGenAction.cpp", "CodeGenFunction.cpp", "CodeGenModule.cpp", "CodeGenPGO.cpp", "CodeGenTBAA.cpp", "CodeGenTypes.cpp", "ConstantInitBuilder.cpp", "CoverageMappingGen.cpp", "ItaniumCXXABI.cpp", "MacroPPCallbacks.cpp", "MicrosoftCXXABI.cpp", "ModuleBuilder.cpp", "ObjectFilePCHContainerOperations.cpp", "PatternInit.cpp", "SanitizerMetadata.cpp", "SwiftCallingConv.cpp", "TargetInfo.cpp", "VarBypassDetector.cpp", "DEPENDS", "", "LINK_LIBS", "clangAnalysis", "clangAST", "clangBasic", "clangFrontend", "clangLex", "clangSerialization")
-    ctx = ctx.exit_directory(ctx, "CodeGen")
-    ctx = ctx.enter_directory(ctx, "Analysis")
+    ctx.add_clang_library(ctx, "clangCodeGen", "BackendUtil.cpp", "CGAtomic.cpp", "CGBlocks.cpp", "CGBuiltin.cpp", "CGCUDANV.cpp", "CGCUDARuntime.cpp", "CGCXX.cpp", "CGCXXABI.cpp", "CGCall.cpp", "CGClass.cpp", "CGCleanup.cpp", "CGCoroutine.cpp", "CGDebugInfo.cpp", "CGDecl.cpp", "CGDeclCXX.cpp", "CGException.cpp", "CGExpr.cpp", "CGExprAgg.cpp", "CGExprCXX.cpp", "CGExprComplex.cpp", "CGExprConstant.cpp", "CGExprScalar.cpp", "CGGPUBuiltin.cpp", "CGLoopInfo.cpp", "CGNonTrivialStruct.cpp", "CGObjC.cpp", "CGObjCGNU.cpp", "CGObjCMac.cpp", "CGObjCRuntime.cpp", "CGOpenCLRuntime.cpp", "CGOpenMPRuntime.cpp", "CGOpenMPRuntimeNVPTX.cpp", "CGRecordLayoutBuilder.cpp", "CGStmt.cpp", "CGStmtOpenMP.cpp", "CGVTT.cpp", "CGVTables.cpp", "CodeGenABITypes.cpp", "CodeGenAction.cpp", "CodeGenFunction.cpp", "CodeGenModule.cpp", "CodeGenPGO.cpp", "CodeGenTBAA.cpp", "CodeGenTypes.cpp", "ConstantInitBuilder.cpp", "CoverageMappingGen.cpp", "ItaniumCXXABI.cpp", "MacroPPCallbacks.cpp", "MicrosoftCXXABI.cpp", "ModuleBuilder.cpp", "ObjectFilePCHContainerOperations.cpp", "PatternInit.cpp", "SanitizerMetadata.cpp", "SwiftCallingConv.cpp", "TargetInfo.cpp", "VarBypassDetector.cpp", "DEPENDS", "intrinsics_gen", "LINK_LIBS", "clangAnalysis", "clangAST", "clangBasic", "clangFrontend", "clangLex", "clangSerialization")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Analysis")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangAnalysis", "AnalysisDeclContext.cpp", "BodyFarm.cpp", "CFG.cpp", "CFGReachabilityAnalysis.cpp", "CFGStmtMap.cpp", "CallGraph.cpp", "CloneDetection.cpp", "CocoaConventions.cpp", "ConstructionContext.cpp", "Consumed.cpp", "CodeInjector.cpp", "Dominators.cpp", "ExprMutationAnalyzer.cpp", "LiveVariables.cpp", "ObjCNoReturn.cpp", "PostOrderCFGView.cpp", "ProgramPoint.cpp", "ReachableCode.cpp", "RetainSummaryManager.cpp", "ThreadSafety.cpp", "ThreadSafetyCommon.cpp", "ThreadSafetyLogical.cpp", "ThreadSafetyTIL.cpp", "UninitializedValues.cpp", "LINK_LIBS", "clangAST", "clangASTMatchers", "clangBasic", "clangLex")
-    ctx = ctx.exit_directory(ctx, "Analysis")
-    ctx = ctx.enter_directory(ctx, "Edit")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Edit")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangEdit", "Commit.cpp", "EditedSource.cpp", "RewriteObjCFoundationAPI.cpp", "LINK_LIBS", "clangAST", "clangBasic", "clangLex")
-    ctx = ctx.exit_directory(ctx, "Edit")
-    ctx = ctx.enter_directory(ctx, "Rewrite")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Rewrite")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangRewrite", "DeltaTree.cpp", "HTMLRewrite.cpp", "RewriteRope.cpp", "Rewriter.cpp", "TokenRewriter.cpp", "LINK_LIBS", "clangBasic", "clangLex")
-    ctx = ctx.exit_directory(ctx, "Rewrite")
-    ctx = ctx.enter_directory(ctx, "Driver")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Driver")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "BinaryFormat", "Option", "Support")
     ctx.add_clang_library(ctx, "clangDriver", "Action.cpp", "Compilation.cpp", "DarwinSDKInfo.cpp", "Distro.cpp", "Driver.cpp", "DriverOptions.cpp", "Job.cpp", "Multilib.cpp", "Phases.cpp", "SanitizerArgs.cpp", "Tool.cpp", "ToolChain.cpp", "ToolChains/Arch/AArch64.cpp", "ToolChains/Arch/ARM.cpp", "ToolChains/Arch/Mips.cpp", "ToolChains/Arch/PPC.cpp", "ToolChains/Arch/RISCV.cpp", "ToolChains/Arch/Sparc.cpp", "ToolChains/Arch/SystemZ.cpp", "ToolChains/Arch/X86.cpp", "ToolChains/Ananas.cpp", "ToolChains/AMDGPU.cpp", "ToolChains/AVR.cpp", "ToolChains/BareMetal.cpp", "ToolChains/Clang.cpp", "ToolChains/CloudABI.cpp", "ToolChains/CommonArgs.cpp", "ToolChains/Contiki.cpp", "ToolChains/CrossWindows.cpp", "ToolChains/Cuda.cpp", "ToolChains/Darwin.cpp", "ToolChains/DragonFly.cpp", "ToolChains/FreeBSD.cpp", "ToolChains/Fuchsia.cpp", "ToolChains/Gnu.cpp", "ToolChains/Haiku.cpp", "ToolChains/HIP.cpp", "ToolChains/Hexagon.cpp", "ToolChains/Hurd.cpp", "ToolChains/Linux.cpp", "ToolChains/MipsLinux.cpp", "ToolChains/MinGW.cpp", "ToolChains/Minix.cpp", "ToolChains/MSP430.cpp", "ToolChains/MSVC.cpp", "ToolChains/Myriad.cpp", "ToolChains/NaCl.cpp", "ToolChains/NetBSD.cpp", "ToolChains/OpenBSD.cpp", "ToolChains/PS4CPU.cpp", "ToolChains/RISCVToolchain.cpp", "ToolChains/Solaris.cpp", "ToolChains/TCE.cpp", "ToolChains/WebAssembly.cpp", "ToolChains/XCore.cpp", "ToolChains/PPCLinux.cpp", "Types.cpp", "XRayArgs.cpp", "DEPENDS", "ClangDriverOptions", "LINK_LIBS", "clangBasic", "")
-    ctx = ctx.exit_directory(ctx, "Driver")
-    ctx = ctx.enter_directory(ctx, "Serialization")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Serialization")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "BitReader", "Support")
     ctx.add_clang_library(ctx, "clangSerialization", "ASTCommon.cpp", "ASTReader.cpp", "ASTReaderDecl.cpp", "ASTReaderStmt.cpp", "ASTWriter.cpp", "ASTWriterDecl.cpp", "ASTWriterStmt.cpp", "GeneratePCH.cpp", "GlobalModuleIndex.cpp", "InMemoryModuleCache.cpp", "Module.cpp", "ModuleFileExtension.cpp", "ModuleManager.cpp", "PCHContainerOperations.cpp", "ADDITIONAL_HEADERS", "ASTCommon.h", "ASTReaderInternals.h", "LINK_LIBS", "clangAST", "clangBasic", "clangLex", "clangSema")
-    ctx = ctx.exit_directory(ctx, "Serialization")
-    ctx = ctx.enter_directory(ctx, "Frontend")
-    ctx = ctx.enter_directory(ctx, "Rewrite")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Frontend")
+    ctx = ctx.push_directory(ctx, "Rewrite")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangRewriteFrontend", "FixItRewriter.cpp", "FrontendActions.cpp", "HTMLPrint.cpp", "InclusionRewriter.cpp", "RewriteMacros.cpp", "RewriteModernObjC.cpp", "RewriteObjC.cpp", "RewriteTest.cpp", "LINK_LIBS", "clangAST", "clangBasic", "clangEdit", "clangFrontend", "clangLex", "clangRewrite", "clangSerialization")
-    ctx = ctx.exit_directory(ctx, "Rewrite")
+    ctx = ctx.pop_directory(ctx)
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "BitReader", "Option", "ProfileData", "Support")
     ctx.set(ctx, "optional_deps", "intrinsics_gen")
-    ctx.add_clang_library(ctx, "clangFrontend", "ASTConsumers.cpp", "ASTMerge.cpp", "ASTUnit.cpp", "ChainedDiagnosticConsumer.cpp", "ChainedIncludesSource.cpp", "CompilerInstance.cpp", "CompilerInvocation.cpp", "CreateInvocationFromCommandLine.cpp", "DependencyFile.cpp", "DependencyGraph.cpp", "DiagnosticRenderer.cpp", "FrontendAction.cpp", "FrontendActions.cpp", "FrontendOptions.cpp", "FrontendTiming.cpp", "HeaderIncludeGen.cpp", "InitHeaderSearch.cpp", "InitPreprocessor.cpp", "LangStandards.cpp", "LayoutOverrideSource.cpp", "LogDiagnosticPrinter.cpp", "ModuleDependencyCollector.cpp", "MultiplexConsumer.cpp", "PrecompiledPreamble.cpp", "PrintPreprocessedOutput.cpp", "SerializedDiagnosticPrinter.cpp", "SerializedDiagnosticReader.cpp", "TestModuleFileExtension.cpp", "TextDiagnostic.cpp", "TextDiagnosticBuffer.cpp", "TextDiagnosticPrinter.cpp", "VerifyDiagnosticConsumer.cpp", "DEPENDS", "ClangDriverOptions", "", "LINK_LIBS", "clangAST", "clangBasic", "clangDriver", "clangEdit", "clangLex", "clangParse", "clangSema", "clangSerialization")
-    ctx = ctx.exit_directory(ctx, "Frontend")
-    ctx = ctx.enter_directory(ctx, "FrontendTool")
+    ctx.add_clang_library(ctx, "clangFrontend", "ASTConsumers.cpp", "ASTMerge.cpp", "ASTUnit.cpp", "ChainedDiagnosticConsumer.cpp", "ChainedIncludesSource.cpp", "CompilerInstance.cpp", "CompilerInvocation.cpp", "CreateInvocationFromCommandLine.cpp", "DependencyFile.cpp", "DependencyGraph.cpp", "DiagnosticRenderer.cpp", "FrontendAction.cpp", "FrontendActions.cpp", "FrontendOptions.cpp", "FrontendTiming.cpp", "HeaderIncludeGen.cpp", "InitHeaderSearch.cpp", "InitPreprocessor.cpp", "LangStandards.cpp", "LayoutOverrideSource.cpp", "LogDiagnosticPrinter.cpp", "ModuleDependencyCollector.cpp", "MultiplexConsumer.cpp", "PrecompiledPreamble.cpp", "PrintPreprocessedOutput.cpp", "SerializedDiagnosticPrinter.cpp", "SerializedDiagnosticReader.cpp", "TestModuleFileExtension.cpp", "TextDiagnostic.cpp", "TextDiagnosticBuffer.cpp", "TextDiagnosticPrinter.cpp", "VerifyDiagnosticConsumer.cpp", "DEPENDS", "ClangDriverOptions", "intrinsics_gen", "LINK_LIBS", "clangAST", "clangBasic", "clangDriver", "clangEdit", "clangLex", "clangParse", "clangSema", "clangSerialization")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "FrontendTool")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Option", "Support")
     ctx.set(ctx, "link_libs", "clangBasic", "clangCodeGen", "clangDriver", "clangFrontend", "clangRewriteFrontend")
-    ctx.add_clang_library(ctx, "clangFrontendTool", "ExecuteCompilerInvocation.cpp", "DEPENDS", "ClangDriverOptions", "LINK_LIBS", "")
-    ctx = ctx.exit_directory(ctx, "FrontendTool")
-    ctx = ctx.enter_directory(ctx, "Tooling")
+    ctx.add_clang_library(ctx, "clangFrontendTool", "ExecuteCompilerInvocation.cpp", "DEPENDS", "ClangDriverOptions", "LINK_LIBS", "clangBasic", "clangCodeGen", "clangDriver", "clangFrontend", "clangRewriteFrontend")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Tooling")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Option", "Support")
-    ctx = ctx.enter_directory(ctx, "Core")
+    ctx = ctx.push_directory(ctx, "Core")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
     ctx.add_clang_library(ctx, "clangToolingCore", "Diagnostic.cpp", "Lookup.cpp", "Replacement.cpp", "LINK_LIBS", "clangAST", "clangBasic", "clangLex", "clangRewrite")
-    ctx = ctx.exit_directory(ctx, "Core")
-    ctx = ctx.enter_directory(ctx, "Inclusions")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Inclusions")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
     ctx.add_clang_library(ctx, "clangToolingInclusions", "HeaderIncludes.cpp", "IncludeStyle.cpp", "LINK_LIBS", "clangBasic", "clangLex", "clangRewrite", "clangToolingCore")
-    ctx = ctx.exit_directory(ctx, "Inclusions")
-    ctx = ctx.enter_directory(ctx, "Refactoring")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Refactoring")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangToolingRefactoring", "ASTSelection.cpp", "ASTSelectionRequirements.cpp", "AtomicChange.cpp", "Extract/Extract.cpp", "Extract/SourceExtraction.cpp", "RangeSelector.cpp", "RefactoringActions.cpp", "Rename/RenamingAction.cpp", "Rename/SymbolOccurrences.cpp", "Rename/USRFinder.cpp", "Rename/USRFindingAction.cpp", "Rename/USRLocFinder.cpp", "SourceCode.cpp", "Stencil.cpp", "Transformer.cpp", "LINK_LIBS", "clangAST", "clangASTMatchers", "clangBasic", "clangFormat", "clangIndex", "clangLex", "clangRewrite", "clangToolingCore")
-    ctx = ctx.exit_directory(ctx, "Refactoring")
-    ctx = ctx.enter_directory(ctx, "ASTDiff")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "ASTDiff")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangToolingASTDiff", "ASTDiff.cpp", "LINK_LIBS", "clangBasic", "clangAST", "clangLex")
-    ctx = ctx.exit_directory(ctx, "ASTDiff")
-    ctx = ctx.enter_directory(ctx, "Syntax")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Syntax")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
     ctx.add_clang_library(ctx, "clangToolingSyntax", "Tokens.cpp", "LINK_LIBS", "clangBasic", "clangFrontend", "clangLex")
-    ctx = ctx.exit_directory(ctx, "Syntax")
+    ctx = ctx.pop_directory(ctx)
     ctx.add_clang_library(ctx, "clangTooling", "AllTUsExecution.cpp", "ArgumentsAdjusters.cpp", "CommonOptionsParser.cpp", "CompilationDatabase.cpp", "Execution.cpp", "FileMatchTrie.cpp", "FixIt.cpp", "InterpolatingCompilationDatabase.cpp", "JSONCompilationDatabase.cpp", "Refactoring.cpp", "RefactoringCallbacks.cpp", "StandaloneExecution.cpp", "Tooling.cpp", "DEPENDS", "ClangDriverOptions", "LINK_LIBS", "clangAST", "clangASTMatchers", "clangBasic", "clangDriver", "clangFormat", "clangFrontend", "clangLex", "clangRewrite", "clangSerialization", "clangToolingCore")
-    ctx = ctx.exit_directory(ctx, "Tooling")
-    ctx = ctx.enter_directory(ctx, "Index")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Index")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Core", "Support")
     ctx.add_clang_library(ctx, "clangIndex", "CodegenNameGenerator.cpp", "CommentToXML.cpp", "FileIndexRecord.cpp", "IndexBody.cpp", "IndexDecl.cpp", "IndexingAction.cpp", "IndexingContext.cpp", "IndexSymbol.cpp", "IndexTypeSourceInfo.cpp", "USRGeneration.cpp", "ADDITIONAL_HEADERS", "IndexingContext.h", "SimpleFormatContext.h", "LINK_LIBS", "clangAST", "clangBasic", "clangFormat", "clangFrontend", "clangLex", "clangRewrite", "clangSerialization", "clangToolingCore")
-    ctx = ctx.exit_directory(ctx, "Index")
-    ctx = ctx.enter_directory(ctx, "Format")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "Format")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
     ctx.add_clang_library(ctx, "clangFormat", "AffectedRangeManager.cpp", "BreakableToken.cpp", "ContinuationIndenter.cpp", "Format.cpp", "FormatToken.cpp", "FormatTokenLexer.cpp", "NamespaceEndCommentsFixer.cpp", "SortJavaScriptImports.cpp", "TokenAnalyzer.cpp", "TokenAnnotator.cpp", "UnwrappedLineFormatter.cpp", "UnwrappedLineParser.cpp", "UsingDeclarationsSorter.cpp", "WhitespaceManager.cpp", "LINK_LIBS", "clangBasic", "clangLex", "clangToolingCore", "clangToolingInclusions")
-    ctx = ctx.exit_directory(ctx, "Format")
-    ctx = ctx.exit_directory(ctx, "lib")
-    ctx = ctx.enter_directory(ctx, "tools")
-    ctx = ctx.enter_directory(ctx, "diagtool")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "tools")
+    ctx = ctx.push_directory(ctx, "diagtool")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
-    ctx = ctx.exit_directory(ctx, "diagtool")
-    ctx = ctx.enter_directory(ctx, "driver")
-    ctx.set(ctx, "LLVM_LINK_COMPONENTS", "", "Analysis", "CodeGen", "Core", "IPO", "AggressiveInstCombine", "InstCombine", "Instrumentation", "MC", "MCParser", "ObjCARCOpts", "Option", "ScalarOpts", "Support", "TransformUtils", "Vectorize")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "driver")
+    ctx.set(ctx, "LLVM_LINK_COMPONENTS", "all", "Analysis", "CodeGen", "Core", "IPO", "AggressiveInstCombine", "InstCombine", "Instrumentation", "MC", "MCParser", "ObjCARCOpts", "Option", "ScalarOpts", "Support", "TransformUtils", "Vectorize")
     ctx.set(ctx, "TOOL_INFO_PLIST", "Info.plist", "CACHE", "STRING", "Plist name")
-    ctx = ctx.exit_directory(ctx, "driver")
-    ctx = ctx.enter_directory(ctx, "clang-diff")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "clang-diff")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Support")
-    ctx = ctx.exit_directory(ctx, "clang-diff")
-    ctx = ctx.enter_directory(ctx, "clang-format")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "clang-format")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
     ctx.set(ctx, "CLANG_FORMAT_LIB_DEPS", "clangBasic", "clangFormat", "clangRewrite", "clangToolingCore")
-    ctx = ctx.exit_directory(ctx, "clang-format")
-    ctx = ctx.enter_directory(ctx, "clang-fuzzer")
-    ctx.set(ctx, "LLVM_LINK_COMPONENTS", "", "FuzzMutate")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "clang-fuzzer")
+    ctx.set(ctx, "LLVM_LINK_COMPONENTS", "all", "FuzzMutate")
     ctx.set(ctx, "CXX_FLAGS_NOFUZZ", "")
     ctx.set(ctx, "DUMMY_MAIN", "DummyClangFuzzer.cpp")
     ctx.set(ctx, "LLVM_OPTIONAL_SOURCES", "ClangFuzzer.cpp", "DummyClangFuzzer.cpp", "ExampleClangProtoFuzzer.cpp", "ExampleClangLoopProtoFuzzer.cpp", "ExampleClangLLVMProtoFuzzer.cpp")
-    ctx = ctx.enter_directory(ctx, "handle-cxx")
-    ctx.set(ctx, "LLVM_LINK_COMPONENTS", "", "Support")
+    ctx = ctx.push_directory(ctx, "handle-cxx")
+    ctx.set(ctx, "LLVM_LINK_COMPONENTS", "all", "Support")
     ctx.add_clang_library(ctx, "clangHandleCXX", "handle_cxx.cpp", "LINK_LIBS", "clangBasic", "clangCodeGen", "clangFrontend", "clangLex", "clangSerialization", "clangTooling")
-    ctx = ctx.exit_directory(ctx, "handle-cxx")
-    ctx = ctx.enter_directory(ctx, "handle-llvm")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "handle-llvm")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Analysis", "CodeGen", "Core", "ExecutionEngine", "IPO", "IRReader", "MC", "MCJIT", "Object", "RuntimeDyld", "SelectionDAG", "Support", "Target", "TransformUtils", "native")
     ctx.set(ctx, "handle_llvm_deps", "intrinsics_gen")
-    ctx.add_clang_library(ctx, "clangHandleLLVM", "handle_llvm.cpp", "DEPENDS", "")
-    ctx = ctx.exit_directory(ctx, "handle-llvm")
-    ctx = ctx.exit_directory(ctx, "clang-fuzzer")
-    ctx = ctx.enter_directory(ctx, "clang-import-test")
+    ctx.add_clang_library(ctx, "clangHandleLLVM", "handle_llvm.cpp", "DEPENDS", "intrinsics_gen")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "clang-import-test")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Core", "Support")
     ctx.set(ctx, "CLANG_IMPORT_TEST_LIB_DEPS", "clangAST", "clangBasic", "clangCodeGen", "clangDriver", "clangFrontend", "clangLex", "clangParse", "clangSerialization")
-    ctx = ctx.exit_directory(ctx, "clang-import-test")
-    ctx = ctx.enter_directory(ctx, "clang-offload-bundler")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "clang-offload-bundler")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "BitWriter", "Core", "Object", "Support")
     ctx.set(ctx, "CLANG_OFFLOAD_BUNDLER_LIB_DEPS", "clangBasic")
-    ctx = ctx.exit_directory(ctx, "clang-offload-bundler")
-    ctx = ctx.enter_directory(ctx, "c-index-test")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "c-index-test")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "support")
-    ctx = ctx.exit_directory(ctx, "c-index-test")
-    ctx = ctx.enter_directory(ctx, "clang-rename")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "clang-rename")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Option", "Support")
-    ctx = ctx.exit_directory(ctx, "clang-rename")
-    ctx = ctx.enter_directory(ctx, "clang-refactor")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "clang-refactor")
     ctx.set(ctx, "LLVM_LINK_COMPONENTS", "Option", "Support")
-    ctx = ctx.exit_directory(ctx, "clang-refactor")
-    ctx = ctx.enter_directory(ctx, "libclang")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "libclang")
     ctx.set(ctx, "SOURCES", "ARCMigrate.cpp", "BuildSystem.cpp", "CIndex.cpp", "CIndexCXX.cpp", "CIndexCodeCompletion.cpp", "CIndexDiagnostic.cpp", "CIndexHigh.cpp", "CIndexInclusionStack.cpp", "CIndexUSRs.cpp", "CIndexer.cpp", "CXComment.cpp", "CXCursor.cpp", "CXIndexDataConsumer.cpp", "CXCompilationDatabase.cpp", "CXLoadedDiagnostic.cpp", "CXSourceLocation.cpp", "CXStoredDiagnostic.cpp", "CXString.cpp", "CXType.cpp", "Indexing.cpp", "ADDITIONAL_HEADERS", "CIndexDiagnostic.h", "CIndexer.h", "CXCursor.h", "CXLoadedDiagnostic.h", "CXSourceLocation.h", "CXString.h", "CXTranslationUnit.h", "CXType.h", "Index_Internal.h", "../../include/clang-c/Index.h")
     ctx.set(ctx, "LIBS", "clangAST", "clangBasic", "clangDriver", "clangFrontend", "clangIndex", "clangLex", "clangSema", "clangSerialization", "clangTooling")
-    ctx.set(ctx, "LLVM_EXPORTED_SYMBOL_FILE", "/tools/clang/tools/libclang/libclang.exports")
-    ctx.add_clang_library(ctx, "libclang", "", "", "OUTPUT_NAME", "", "", "DEPENDS", "clang-resource-headers", "LINK_LIBS", "", "LINK_COMPONENTS", "", "Core", "Support")
-    ctx = ctx.exit_directory(ctx, "libclang")
-    ctx = ctx.exit_directory(ctx, "tools")
-    ctx = ctx.enter_directory(ctx, "runtime")
+    ctx.set(ctx, "LLVM_EXPORTED_SYMBOL_FILE", "/root/tools/clang/tools/libclang/libclang.exports")
+    ctx.add_clang_library(ctx, "libclang", "", "", "OUTPUT_NAME", "", "ARCMigrate.cpp", "BuildSystem.cpp", "CIndex.cpp", "CIndexCXX.cpp", "CIndexCodeCompletion.cpp", "CIndexDiagnostic.cpp", "CIndexHigh.cpp", "CIndexInclusionStack.cpp", "CIndexUSRs.cpp", "CIndexer.cpp", "CXComment.cpp", "CXCursor.cpp", "CXIndexDataConsumer.cpp", "CXCompilationDatabase.cpp", "CXLoadedDiagnostic.cpp", "CXSourceLocation.cpp", "CXStoredDiagnostic.cpp", "CXString.cpp", "CXType.cpp", "Indexing.cpp", "ADDITIONAL_HEADERS", "CIndexDiagnostic.h", "CIndexer.h", "CXCursor.h", "CXLoadedDiagnostic.h", "CXSourceLocation.h", "CXString.h", "CXTranslationUnit.h", "CXType.h", "Index_Internal.h", "../../include/clang-c/Index.h", "DEPENDS", "clang-resource-headers", "LINK_LIBS", "clangAST", "clangBasic", "clangDriver", "clangFrontend", "clangIndex", "clangLex", "clangSema", "clangSerialization", "clangTooling", "LINK_COMPONENTS", "all", "Core", "Support")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "runtime")
     ctx.set(ctx, "known_subdirs", "libcxx")
     ctx.set(ctx, "COMPILER_RT_SRC_ROOT", "/projects/compiler-rt")
-    ctx = ctx.exit_directory(ctx, "runtime")
-    ctx = ctx.enter_directory(ctx, "utils/hmaptool")
+    ctx = ctx.pop_directory(ctx)
+    ctx = ctx.push_directory(ctx, "utils/hmaptool")
     ctx.set(ctx, "CLANG_HMAPTOOL", "hmaptool")
-    ctx = ctx.exit_directory(ctx, "utils/hmaptool")
-    ctx.configure_file(ctx, "/tools/clang/include/clang/Config/config.h.cmake", "/tools/clang/include/clang/Config/config.h")
-    ctx = ctx.exit_directory(ctx, "tools/clang")
+    ctx = ctx.pop_directory(ctx)
+    ctx.configure_file(ctx, "/root/tools/clang/include/clang/Config/config.h.cmake", "/root/tools/clang/include/clang/Config/config.h")
+    ctx = ctx.pop_directory(ctx)
+    return ctx
diff --git a/tools/build_rules/llvm/generated_llvm_build_deps.bzl b/tools/build_rules/llvm/generated_llvm_build_deps.bzl
deleted file mode 100644
index 9bcd359..0000000
--- a/tools/build_rules/llvm/generated_llvm_build_deps.bzl
+++ /dev/null
@@ -1,661 +0,0 @@
-LLVM_BUILD_DEPS = {
-    "AArch64AsmParser": [
-        "AArch64Desc",
-        "AArch64Info",
-        "AArch64Utils",
-        "MC",
-        "MCParser",
-        "Support",
-    ],
-    "AArch64CodeGen": [
-        "AArch64Desc",
-        "AArch64Info",
-        "AArch64Utils",
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "GlobalISel",
-    ],
-    "AArch64Desc": ["AArch64Info", "AArch64Utils", "MC", "Support"],
-    "AArch64Disassembler": [
-        "AArch64Desc",
-        "AArch64Info",
-        "AArch64Utils",
-        "MC",
-        "MCDisassembler",
-        "Support",
-    ],
-    "AArch64Info": ["Support"],
-    "AArch64Utils": ["Support"],
-    "AMDGPUAsmParser": [
-        "MC",
-        "MCParser",
-        "AMDGPUDesc",
-        "AMDGPUInfo",
-        "AMDGPUUtils",
-        "Support",
-    ],
-    "AMDGPUCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "IPO",
-        "MC",
-        "AMDGPUDesc",
-        "AMDGPUInfo",
-        "AMDGPUUtils",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-        "Vectorize",
-        "GlobalISel",
-        "BinaryFormat",
-        "MIRParser",
-    ],
-    "AMDGPUDesc": [
-        "Core",
-        "MC",
-        "AMDGPUInfo",
-        "AMDGPUUtils",
-        "Support",
-        "BinaryFormat",
-    ],
-    "AMDGPUDisassembler": [
-        "AMDGPUDesc",
-        "AMDGPUInfo",
-        "AMDGPUUtils",
-        "MC",
-        "MCDisassembler",
-        "Support",
-    ],
-    "AMDGPUInfo": ["Support"],
-    "AMDGPUUtils": ["Core", "MC", "BinaryFormat", "Support"],
-    "ARCCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-        "ARCDesc",
-        "ARCInfo",
-    ],
-    "ARCDesc": ["MC", "Support", "ARCInfo"],
-    "ARCDisassembler": ["MCDisassembler", "Support", "ARCInfo"],
-    "ARCInfo": ["Support"],
-    "ARMAsmParser": [
-        "ARMDesc",
-        "ARMInfo",
-        "MC",
-        "MCParser",
-        "Support",
-        "ARMUtils",
-    ],
-    "ARMCodeGen": [
-        "ARMDesc",
-        "ARMInfo",
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "GlobalISel",
-        "ARMUtils",
-        "TransformUtils",
-    ],
-    "ARMDesc": ["ARMInfo", "ARMUtils", "MC", "MCDisassembler", "Support"],
-    "ARMDisassembler": [
-        "ARMDesc",
-        "ARMInfo",
-        "MCDisassembler",
-        "Support",
-        "ARMUtils",
-    ],
-    "ARMInfo": ["Support"],
-    "ARMUtils": ["Support"],
-    "AVRAsmParser": ["MC", "MCParser", "AVRDesc", "AVRInfo", "Support"],
-    "AVRCodeGen": [
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "AVRDesc",
-        "AVRInfo",
-        "SelectionDAG",
-        "Support",
-        "Target",
-    ],
-    "AVRDesc": ["MC", "AVRInfo", "Support"],
-    "AVRDisassembler": ["MCDisassembler", "AVRInfo", "Support"],
-    "AVRInfo": ["MC", "Support"],
-    "AggressiveInstCombine": ["Analysis", "Core", "Support", "TransformUtils"],
-    "Analysis": ["BinaryFormat", "Core", "Object", "ProfileData", "Support"],
-    "AsmParser": ["BinaryFormat", "Core", "Support"],
-    "AsmPrinter": [
-        "Analysis",
-        "BinaryFormat",
-        "CodeGen",
-        "Core",
-        "DebugInfoCodeView",
-        "DebugInfoDWARF",
-        "DebugInfoMSF",
-        "MC",
-        "MCParser",
-        "Remarks",
-        "Support",
-        "Target",
-    ],
-    "BPFAsmParser": ["MC", "MCParser", "BPFDesc", "BPFInfo", "Support"],
-    "BPFCodeGen": [
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "BPFDesc",
-        "BPFInfo",
-        "SelectionDAG",
-        "Support",
-        "Target",
-    ],
-    "BPFDesc": ["MC", "BPFInfo", "Support"],
-    "BPFDisassembler": ["MCDisassembler", "BPFInfo", "Support"],
-    "BPFInfo": ["Support"],
-    "BinaryFormat": ["Support"],
-    "BitReader": ["Core", "Support"],
-    "BitWriter": ["Analysis", "Core", "MC", "Object", "Support"],
-    "CFIVerify": [
-        "DebugInfoDWARF",
-        "MC",
-        "MCDisassembler",
-        "MCParser",
-        "Support",
-        "Symbolize",
-    ],
-    "CodeGen": [
-        "Analysis",
-        "BitReader",
-        "BitWriter",
-        "Core",
-        "MC",
-        "ProfileData",
-        "Scalar",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "Core": ["BinaryFormat", "Remarks", "Support"],
-    "Coroutines": [
-        "Analysis",
-        "Core",
-        "IPO",
-        "Scalar",
-        "Support",
-        "TransformUtils",
-    ],
-    "Coverage": ["Core", "Object", "ProfileData", "Support"],
-    "DebugInfoCodeView": ["Support", "DebugInfoMSF"],
-    "DebugInfoDWARF": ["BinaryFormat", "Object", "MC", "Support"],
-    "DebugInfoMSF": ["Support"],
-    "DebugInfoPDB": ["Object", "Support", "DebugInfoCodeView", "DebugInfoMSF"],
-    "DlltoolDriver": ["Object", "Option", "Support"],
-    "ExecutionEngine": [
-        "Core",
-        "MC",
-        "Object",
-        "RuntimeDyld",
-        "Support",
-        "Target",
-    ],
-    "Exegesis": [
-        "CodeGen",
-        "ExecutionEngine",
-        "MC",
-        "MCDisassembler",
-        "MCJIT",
-        "Object",
-        "ObjectYAML",
-        "Support",
-    ],
-    "ExegesisAArch64": ["AArch64"],
-    "ExegesisPowerPC": ["PowerPC"],
-    "ExegesisX86": ["X86"],
-    "FuzzMutate": [
-        "Analysis",
-        "BitReader",
-        "BitWriter",
-        "Core",
-        "Scalar",
-        "Support",
-        "Target",
-    ],
-    "GlobalISel": [
-        "Analysis",
-        "CodeGen",
-        "Core",
-        "MC",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "HexagonAsmParser": [
-        "MC",
-        "MCParser",
-        "Support",
-        "HexagonDesc",
-        "HexagonInfo",
-    ],
-    "HexagonCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "HexagonAsmParser",
-        "HexagonDesc",
-        "HexagonInfo",
-        "IPO",
-        "MC",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "HexagonDesc": ["HexagonInfo", "MC", "Support"],
-    "HexagonDisassembler": [
-        "HexagonDesc",
-        "HexagonInfo",
-        "MC",
-        "MCDisassembler",
-        "Support",
-    ],
-    "HexagonInfo": ["Support"],
-    "IPO": [
-        "AggressiveInstCombine",
-        "Analysis",
-        "BitReader",
-        "BitWriter",
-        "Core",
-        "InstCombine",
-        "IRReader",
-        "Linker",
-        "Object",
-        "ProfileData",
-        "Scalar",
-        "Support",
-        "TransformUtils",
-        "Vectorize",
-        "Instrumentation",
-    ],
-    "IRReader": ["AsmParser", "BitReader", "Core", "Support"],
-    "InstCombine": ["Analysis", "Core", "Support", "TransformUtils"],
-    "Instrumentation": [
-        "Analysis",
-        "Core",
-        "MC",
-        "Support",
-        "TransformUtils",
-        "ProfileData",
-    ],
-    "Interpreter": ["CodeGen", "Core", "ExecutionEngine", "Support"],
-    "JITLink": ["BinaryFormat", "Object", "Support"],
-    "LTO": [
-        "AggressiveInstCombine",
-        "Analysis",
-        "BitReader",
-        "BitWriter",
-        "CodeGen",
-        "Core",
-        "IPO",
-        "InstCombine",
-        "Linker",
-        "MC",
-        "ObjCARC",
-        "Object",
-        "Passes",
-        "Remarks",
-        "Scalar",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "LanaiAsmParser": ["MC", "MCParser", "Support", "LanaiDesc", "LanaiInfo"],
-    "LanaiCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "LanaiAsmParser",
-        "LanaiDesc",
-        "LanaiInfo",
-        "MC",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "LanaiDesc": ["LanaiInfo", "MC", "MCDisassembler", "Support"],
-    "LanaiDisassembler": [
-        "LanaiDesc",
-        "LanaiInfo",
-        "MC",
-        "MCDisassembler",
-        "Support",
-    ],
-    "LanaiInfo": ["Support"],
-    "LibDriver": ["BinaryFormat", "BitReader", "Object", "Option", "Support"],
-    "LineEditor": ["Support"],
-    "Linker": ["Core", "Support", "TransformUtils"],
-    "MC": ["Support", "BinaryFormat", "DebugInfoCodeView"],
-    "MCA": ["MC", "Support"],
-    "MCDisassembler": ["MC", "Support"],
-    "MCJIT": [
-        "Core",
-        "ExecutionEngine",
-        "Object",
-        "RuntimeDyld",
-        "Support",
-        "Target",
-    ],
-    "MCParser": ["MC", "Support"],
-    "MIRParser": [
-        "AsmParser",
-        "BinaryFormat",
-        "CodeGen",
-        "Core",
-        "MC",
-        "Support",
-        "Target",
-    ],
-    "MSP430AsmParser": ["MC", "MCParser", "MSP430Desc", "MSP430Info", "Support"],
-    "MSP430CodeGen": [
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "MSP430Desc",
-        "MSP430Info",
-        "SelectionDAG",
-        "Support",
-        "Target",
-    ],
-    "MSP430Desc": ["MC", "MSP430Info", "Support"],
-    "MSP430Disassembler": ["MCDisassembler", "MSP430Info", "Support"],
-    "MSP430Info": ["Support"],
-    "MipsAsmParser": ["MC", "MCParser", "MipsDesc", "MipsInfo", "Support"],
-    "MipsCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "MipsDesc",
-        "MipsInfo",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "GlobalISel",
-    ],
-    "MipsDesc": ["MC", "MipsInfo", "Support"],
-    "MipsDisassembler": ["MCDisassembler", "MipsInfo", "Support"],
-    "MipsInfo": ["Support"],
-    "NVPTXCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "IPO",
-        "MC",
-        "NVPTXDesc",
-        "NVPTXInfo",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-        "Vectorize",
-    ],
-    "NVPTXDesc": ["MC", "NVPTXInfo", "Support"],
-    "NVPTXInfo": ["Support"],
-    "ObjCARC": ["Analysis", "Core", "Support", "TransformUtils"],
-    "Object": ["BitReader", "Core", "MC", "BinaryFormat", "MCParser", "Support"],
-    "ObjectYAML": ["Object", "Support", "DebugInfoCodeView"],
-    "Option": ["Support"],
-    "OrcJIT": [
-        "Core",
-        "ExecutionEngine",
-        "JITLink",
-        "Object",
-        "MC",
-        "RuntimeDyld",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "Passes": [
-        "AggressiveInstCombine",
-        "Analysis",
-        "CodeGen",
-        "Core",
-        "IPO",
-        "InstCombine",
-        "Scalar",
-        "Support",
-        "Target",
-        "TransformUtils",
-        "Vectorize",
-        "Instrumentation",
-    ],
-    "PowerPCAsmParser": [
-        "MC",
-        "MCParser",
-        "PowerPCDesc",
-        "PowerPCInfo",
-        "Support",
-    ],
-    "PowerPCCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "PowerPCDesc",
-        "PowerPCInfo",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "PowerPCDesc": ["MC", "PowerPCInfo", "Support"],
-    "PowerPCDisassembler": ["MCDisassembler", "PowerPCInfo", "Support"],
-    "PowerPCInfo": ["Support"],
-    "ProfileData": ["Core", "Support"],
-    "RISCVAsmParser": [
-        "MC",
-        "MCParser",
-        "RISCVDesc",
-        "RISCVInfo",
-        "RISCVUtils",
-        "Support",
-    ],
-    "RISCVCodeGen": [
-        "AsmPrinter",
-        "Core",
-        "CodeGen",
-        "MC",
-        "RISCVDesc",
-        "RISCVInfo",
-        "RISCVUtils",
-        "SelectionDAG",
-        "Support",
-        "Target",
-    ],
-    "RISCVDesc": ["MC", "RISCVInfo", "RISCVUtils", "Support"],
-    "RISCVDisassembler": ["MCDisassembler", "RISCVInfo", "Support"],
-    "RISCVInfo": ["Support"],
-    "RISCVUtils": ["Support"],
-    "Remarks": ["Support"],
-    "RuntimeDyld": ["MC", "Object", "Support"],
-    "Scalar": [
-        "AggressiveInstCombine",
-        "Analysis",
-        "Core",
-        "InstCombine",
-        "Support",
-        "TransformUtils",
-    ],
-    "SelectionDAG": [
-        "Analysis",
-        "CodeGen",
-        "Core",
-        "MC",
-        "Support",
-        "Target",
-        "TransformUtils",
-    ],
-    "SparcAsmParser": ["MC", "MCParser", "SparcDesc", "SparcInfo", "Support"],
-    "SparcCodeGen": [
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "SelectionDAG",
-        "SparcDesc",
-        "SparcInfo",
-        "Support",
-        "Target",
-    ],
-    "SparcDesc": ["MC", "SparcInfo", "Support"],
-    "SparcDisassembler": ["MCDisassembler", "SparcInfo", "Support"],
-    "SparcInfo": ["Support"],
-    "Support": ["Demangle"],
-    "Symbolize": [
-        "DebugInfoDWARF",
-        "DebugInfoPDB",
-        "Object",
-        "Support",
-        "Demangle",
-    ],
-    "SystemZAsmParser": [
-        "MC",
-        "MCParser",
-        "Support",
-        "SystemZDesc",
-        "SystemZInfo",
-    ],
-    "SystemZCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "SystemZDesc",
-        "SystemZInfo",
-        "Target",
-    ],
-    "SystemZDesc": ["MC", "Support", "SystemZInfo"],
-    "SystemZDisassembler": [
-        "MC",
-        "MCDisassembler",
-        "Support",
-        "SystemZDesc",
-        "SystemZInfo",
-    ],
-    "SystemZInfo": ["Support"],
-    "TableGen": ["Support"],
-    "Target": ["Analysis", "Core", "MC", "Support"],
-    "TestingSupport": ["Support"],
-    "TextAPI": ["Support", "BinaryFormat"],
-    "TransformUtils": ["Analysis", "Core", "Support"],
-    "Vectorize": ["Analysis", "Core", "Support", "TransformUtils"],
-    "WebAssemblyAsmParser": ["MC", "MCParser", "WebAssemblyInfo", "Support"],
-    "WebAssemblyCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "BinaryFormat",
-        "CodeGen",
-        "Core",
-        "MC",
-        "Scalar",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-        "WebAssemblyDesc",
-        "WebAssemblyInfo",
-    ],
-    "WebAssemblyDesc": ["MC", "Support", "WebAssemblyInfo"],
-    "WebAssemblyDisassembler": [
-        "WebAssemblyDesc",
-        "MCDisassembler",
-        "WebAssemblyInfo",
-        "Support",
-    ],
-    "WebAssemblyInfo": ["Support"],
-    "WindowsManifest": ["Support"],
-    "X86AsmParser": ["MC", "MCParser", "Support", "X86Desc", "X86Info"],
-    "X86CodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "X86Desc",
-        "X86Info",
-        "X86Utils",
-        "GlobalISel",
-        "ProfileData",
-    ],
-    "X86Desc": [
-        "MC",
-        "MCDisassembler",
-        "Object",
-        "Support",
-        "X86Info",
-        "X86Utils",
-    ],
-    "X86Disassembler": ["MCDisassembler", "Support", "X86Info"],
-    "X86Info": ["Support"],
-    "X86Utils": ["Support"],
-    "XCoreCodeGen": [
-        "Analysis",
-        "AsmPrinter",
-        "CodeGen",
-        "Core",
-        "MC",
-        "SelectionDAG",
-        "Support",
-        "Target",
-        "TransformUtils",
-        "XCoreDesc",
-        "XCoreInfo",
-    ],
-    "XCoreDesc": ["MC", "Support", "XCoreInfo"],
-    "XCoreDisassembler": ["MCDisassembler", "Support", "XCoreInfo"],
-    "XCoreInfo": ["Support"],
-    "XRay": ["Support", "Object"],
-    "gtest": ["Support"],
-    "gtest_main": ["gtest"],
-}
diff --git a/tools/build_rules/llvm/generated_llvm_build_targets.bzl b/tools/build_rules/llvm/generated_llvm_build_targets.bzl
new file mode 100644
index 0000000..f65578d
--- /dev/null
+++ b/tools/build_rules/llvm/generated_llvm_build_targets.bzl
@@ -0,0 +1,230 @@
+def generated_llvm_build_targets(ctx):
+    ctx.group(ctx, name = "Miscellaneous", parent = "$ROOT")
+    ctx.group(ctx, name = "Bindings", parent = "$ROOT")
+    ctx.group(ctx, name = "Docs", parent = "$ROOT")
+    ctx.group(ctx, name = "Examples", parent = "$ROOT")
+    ctx.group(ctx, name = "Libraries", parent = "$ROOT")
+    ctx.library(ctx, name = "Analysis", parent = "Libraries", required_libraries = ["BinaryFormat", "Core", "Object", "ProfileData", "Support"])
+    ctx.library(ctx, parent = "Libraries", required_libraries = ["BinaryFormat", "Core", "Support"], name = "AsmParser")
+    ctx.group(ctx, name = "Bitcode", parent = "Libraries")
+    ctx.library(ctx, name = "BitReader", parent = "Bitcode", required_libraries = ["Core", "Support"])
+    ctx.library(ctx, required_libraries = ["Analysis", "Core", "MC", "Object", "Support"], name = "BitWriter", parent = "Bitcode")
+    ctx.library(ctx, name = "CodeGen", parent = "Libraries", required_libraries = ["Analysis", "BitReader", "BitWriter", "Core", "MC", "ProfileData", "Scalar", "Support", "Target", "TransformUtils"])
+    ctx.library(ctx, name = "AsmPrinter", parent = "Libraries", required_libraries = ["Analysis", "BinaryFormat", "CodeGen", "Core", "DebugInfoCodeView", "DebugInfoDWARF", "DebugInfoMSF", "MC", "MCParser", "Remarks", "Support", "Target"])
+    ctx.library(ctx, name = "SelectionDAG", parent = "CodeGen", required_libraries = ["Analysis", "CodeGen", "Core", "MC", "Support", "Target", "TransformUtils"])
+    ctx.library(ctx, name = "MIRParser", parent = "CodeGen", required_libraries = ["AsmParser", "BinaryFormat", "CodeGen", "Core", "MC", "Support", "Target"])
+    ctx.library(ctx, name = "GlobalISel", parent = "CodeGen", required_libraries = ["Analysis", "CodeGen", "Core", "MC", "Support", "Target", "TransformUtils"])
+    ctx.group(ctx, name = "DebugInfo", parent = "$ROOT")
+    ctx.library(ctx, name = "DebugInfoDWARF", parent = "DebugInfo", required_libraries = ["BinaryFormat", "Object", "MC", "Support"])
+    ctx.library(ctx, required_libraries = ["Support"], name = "DebugInfoMSF", parent = "DebugInfo")
+    ctx.library(ctx, name = "DebugInfoCodeView", parent = "DebugInfo", required_libraries = ["Support", "DebugInfoMSF"])
+    ctx.library(ctx, name = "DebugInfoPDB", parent = "DebugInfo", required_libraries = ["Object", "Support", "DebugInfoCodeView", "DebugInfoMSF"])
+    ctx.library(ctx, name = "Symbolize", parent = "DebugInfo", required_libraries = ["DebugInfoDWARF", "DebugInfoPDB", "Object", "Support", "Demangle"])
+    ctx.library(ctx, parent = "Libraries", name = "Demangle")
+    ctx.library(ctx, name = "ExecutionEngine", parent = "Libraries", required_libraries = ["Core", "MC", "Object", "RuntimeDyld", "Support", "Target"])
+    ctx.library(ctx, name = "Interpreter", parent = "ExecutionEngine", required_libraries = ["CodeGen", "Core", "ExecutionEngine", "Support"])
+    ctx.library(ctx, parent = "ExecutionEngine", required_libraries = ["Core", "ExecutionEngine", "Object", "RuntimeDyld", "Support", "Target"], name = "MCJIT")
+    ctx.library(ctx, name = "JITLink", parent = "ExecutionEngine", required_libraries = ["BinaryFormat", "Object", "Support"])
+    ctx.library(ctx, name = "RuntimeDyld", parent = "ExecutionEngine", required_libraries = ["MC", "Object", "Support"])
+    ctx.optional_library(ctx, required_libraries = ["CodeGen", "Core", "DebugInfoDWARF", "Support", "Object", "ExecutionEngine"], name = "IntelJITEvents", parent = "ExecutionEngine")
+    ctx.optional_library(ctx, parent = "ExecutionEngine", required_libraries = ["DebugInfoDWARF", "Support", "Object", "ExecutionEngine"], name = "OProfileJIT")
+    ctx.library(ctx, name = "OrcJIT", parent = "ExecutionEngine", required_libraries = ["Core", "ExecutionEngine", "JITLink", "Object", "MC", "RuntimeDyld", "Support", "Target", "TransformUtils"])
+    ctx.optional_library(ctx, parent = "ExecutionEngine", required_libraries = ["CodeGen", "Core", "DebugInfoDWARF", "ExecutionEngine", "Object", "Support"], name = "PerfJITEvents")
+    ctx.library(ctx, required_libraries = ["Analysis", "BitReader", "BitWriter", "Core", "Scalar", "Support", "Target"], name = "FuzzMutate", parent = "Libraries")
+    ctx.library(ctx, required_libraries = ["Support"], name = "LineEditor", parent = "Libraries")
+    ctx.library(ctx, required_libraries = ["Core", "Support", "TransformUtils"], name = "Linker", parent = "Libraries")
+    ctx.library(ctx, name = "Core", parent = "Libraries", required_libraries = ["BinaryFormat", "Remarks", "Support"])
+    ctx.library(ctx, parent = "Libraries", required_libraries = ["AsmParser", "BitReader", "Core", "Support"], name = "IRReader")
+    ctx.library(ctx, name = "LTO", parent = "Libraries", required_libraries = ["AggressiveInstCombine", "Analysis", "BitReader", "BitWriter", "CodeGen", "Core", "IPO", "InstCombine", "Linker", "MC", "ObjCARC", "Object", "Passes", "Remarks", "Scalar", "Support", "Target", "TransformUtils"])
+    ctx.library(ctx, parent = "Libraries", required_libraries = ["Support", "BinaryFormat", "DebugInfoCodeView"], name = "MC")
+    ctx.library(ctx, name = "MCDisassembler", parent = "MC", required_libraries = ["MC", "Support"])
+    ctx.library(ctx, name = "MCParser", parent = "MC", required_libraries = ["MC", "Support"])
+    ctx.library(ctx, required_libraries = ["MC", "Support"], name = "MCA", parent = "Libraries")
+    ctx.library(ctx, name = "Object", parent = "Libraries", required_libraries = ["BitReader", "Core", "MC", "BinaryFormat", "MCParser", "Support"])
+    ctx.library(ctx, name = "BinaryFormat", parent = "Libraries", required_libraries = ["Support"])
+    ctx.library(ctx, required_libraries = ["Object", "Support", "DebugInfoCodeView"], name = "ObjectYAML", parent = "Libraries")
+    ctx.library(ctx, name = "Option", parent = "Libraries", required_libraries = ["Support"])
+    ctx.library(ctx, name = "Remarks", parent = "Libraries", required_libraries = ["Support"])
+    ctx.library(ctx, name = "Passes", parent = "Libraries", required_libraries = ["AggressiveInstCombine", "Analysis", "CodeGen", "Core", "IPO", "InstCombine", "Scalar", "Support", "Target", "TransformUtils", "Vectorize", "Instrumentation"])
+    ctx.library(ctx, required_libraries = ["Core", "Support"], name = "ProfileData", parent = "Libraries")
+    ctx.library(ctx, name = "Coverage", parent = "ProfileData", required_libraries = ["Core", "Object", "ProfileData", "Support"])
+    ctx.library(ctx, name = "Support", parent = "Libraries", required_libraries = ["Demangle"])
+    ctx.library(ctx, name = "TableGen", parent = "Libraries", required_libraries = ["Support"])
+    ctx.library(ctx, required_libraries = ["Support", "BinaryFormat"], name = "TextAPI", parent = "Libraries")
+    ctx.library_group(ctx, parent = "Libraries", name = "Engine")
+    ctx.library_group(ctx, name = "Native", parent = "Libraries")
+    ctx.library_group(ctx, name = "NativeCodeGen", parent = "Libraries")
+    ctx.library(ctx, parent = "Libraries", required_libraries = ["Analysis", "Core", "MC", "Support"], name = "Target")
+    ctx.library_group(ctx, name = "all-targets", parent = "Libraries")
+    ctx.target_group(ctx, name = "AMDGPU", parent = "Target")
+    ctx.library(ctx, parent = "AMDGPU", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "IPO", "MC", "AMDGPUDesc", "AMDGPUInfo", "AMDGPUUtils", "Scalar", "SelectionDAG", "Support", "Target", "TransformUtils", "Vectorize", "GlobalISel", "BinaryFormat", "MIRParser"], add_to_library_groups = ["AMDGPU"], name = "AMDGPUCodeGen")
+    ctx.library(ctx, name = "AMDGPUAsmParser", parent = "AMDGPU", required_libraries = ["MC", "MCParser", "AMDGPUDesc", "AMDGPUInfo", "AMDGPUUtils", "Support"], add_to_library_groups = ["AMDGPU"])
+    ctx.library(ctx, required_libraries = ["AMDGPUDesc", "AMDGPUInfo", "AMDGPUUtils", "MC", "MCDisassembler", "Support"], add_to_library_groups = ["AMDGPU"], name = "AMDGPUDisassembler", parent = "AMDGPU")
+    ctx.library(ctx, name = "AMDGPUDesc", parent = "AMDGPU", required_libraries = ["Core", "MC", "AMDGPUInfo", "AMDGPUUtils", "Support", "BinaryFormat"], add_to_library_groups = ["AMDGPU"])
+    ctx.library(ctx, name = "AMDGPUInfo", parent = "AMDGPU", required_libraries = ["Support"], add_to_library_groups = ["AMDGPU"])
+    ctx.library(ctx, name = "AMDGPUUtils", parent = "AMDGPU", required_libraries = ["Core", "MC", "BinaryFormat", "Support"], add_to_library_groups = ["AMDGPU"])
+    ctx.library(ctx, name = "ARCCodeGen", parent = "ARC", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "SelectionDAG", "Support", "Target", "TransformUtils", "ARCDesc", "ARCInfo"], add_to_library_groups = ["ARC"])
+    ctx.target_group(ctx, name = "ARC", parent = "Target")
+    ctx.library(ctx, required_libraries = ["MCDisassembler", "Support", "ARCInfo"], add_to_library_groups = ["ARC"], name = "ARCDisassembler", parent = "ARC")
+    ctx.library(ctx, name = "ARCDesc", parent = "ARC", required_libraries = ["MC", "Support", "ARCInfo"], add_to_library_groups = ["ARC"])
+    ctx.library(ctx, name = "ARCInfo", parent = "ARC", required_libraries = ["Support"], add_to_library_groups = ["ARC"])
+    ctx.target_group(ctx, name = "ARM", parent = "Target")
+    ctx.library(ctx, parent = "ARM", required_libraries = ["ARMDesc", "ARMInfo", "Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "Scalar", "SelectionDAG", "Support", "Target", "GlobalISel", "ARMUtils", "TransformUtils"], add_to_library_groups = ["ARM"], name = "ARMCodeGen")
+    ctx.library(ctx, add_to_library_groups = ["ARM"], name = "ARMAsmParser", parent = "ARM", required_libraries = ["ARMDesc", "ARMInfo", "MC", "MCParser", "Support", "ARMUtils"])
+    ctx.library(ctx, name = "ARMDisassembler", parent = "ARM", required_libraries = ["ARMDesc", "ARMInfo", "MCDisassembler", "Support", "ARMUtils"], add_to_library_groups = ["ARM"])
+    ctx.library(ctx, required_libraries = ["ARMInfo", "ARMUtils", "MC", "MCDisassembler", "Support"], add_to_library_groups = ["ARM"], name = "ARMDesc", parent = "ARM")
+    ctx.library(ctx, name = "ARMInfo", parent = "ARM", required_libraries = ["Support"], add_to_library_groups = ["ARM"])
+    ctx.library(ctx, parent = "ARM", required_libraries = ["Support"], add_to_library_groups = ["ARM"], name = "ARMUtils")
+    ctx.target_group(ctx, parent = "Target", name = "AArch64")
+    ctx.library(ctx, name = "AArch64CodeGen", parent = "AArch64", required_libraries = ["AArch64Desc", "AArch64Info", "AArch64Utils", "Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "Scalar", "SelectionDAG", "Support", "Target", "GlobalISel"], add_to_library_groups = ["AArch64"])
+    ctx.library(ctx, name = "AArch64AsmParser", parent = "AArch64", required_libraries = ["AArch64Desc", "AArch64Info", "AArch64Utils", "MC", "MCParser", "Support"], add_to_library_groups = ["AArch64"])
+    ctx.library(ctx, name = "AArch64Disassembler", parent = "AArch64", required_libraries = ["AArch64Desc", "AArch64Info", "AArch64Utils", "MC", "MCDisassembler", "Support"], add_to_library_groups = ["AArch64"])
+    ctx.library(ctx, name = "AArch64Desc", parent = "AArch64", required_libraries = ["AArch64Info", "AArch64Utils", "MC", "Support"], add_to_library_groups = ["AArch64"])
+    ctx.library(ctx, name = "AArch64Info", parent = "AArch64", required_libraries = ["Support"], add_to_library_groups = ["AArch64"])
+    ctx.library(ctx, name = "AArch64Utils", parent = "AArch64", required_libraries = ["Support"], add_to_library_groups = ["AArch64"])
+    ctx.target_group(ctx, name = "AVR", parent = "Target")
+    ctx.library(ctx, parent = "AVR", required_libraries = ["AsmPrinter", "CodeGen", "Core", "MC", "AVRDesc", "AVRInfo", "SelectionDAG", "Support", "Target"], add_to_library_groups = ["AVR"], name = "AVRCodeGen")
+    ctx.library(ctx, required_libraries = ["MC", "MCParser", "AVRDesc", "AVRInfo", "Support"], add_to_library_groups = ["AVR"], name = "AVRAsmParser", parent = "AVR")
+    ctx.library(ctx, parent = "AVR", required_libraries = ["MCDisassembler", "AVRInfo", "Support"], add_to_library_groups = ["AVR"], name = "AVRDisassembler")
+    ctx.library(ctx, required_libraries = ["MC", "AVRInfo", "Support"], add_to_library_groups = ["AVR"], name = "AVRDesc", parent = "AVR")
+    ctx.library(ctx, name = "AVRInfo", parent = "AVR", required_libraries = ["MC", "Support"], add_to_library_groups = ["AVR"])
+    ctx.target_group(ctx, parent = "Target", name = "BPF")
+    ctx.library(ctx, required_libraries = ["AsmPrinter", "CodeGen", "Core", "MC", "BPFDesc", "BPFInfo", "SelectionDAG", "Support", "Target"], add_to_library_groups = ["BPF"], name = "BPFCodeGen", parent = "BPF")
+    ctx.library(ctx, required_libraries = ["MC", "MCParser", "BPFDesc", "BPFInfo", "Support"], add_to_library_groups = ["BPF"], name = "BPFAsmParser", parent = "BPF")
+    ctx.library(ctx, parent = "BPF", required_libraries = ["MCDisassembler", "BPFInfo", "Support"], add_to_library_groups = ["BPF"], name = "BPFDisassembler")
+    ctx.library(ctx, parent = "BPF", required_libraries = ["MC", "BPFInfo", "Support"], add_to_library_groups = ["BPF"], name = "BPFDesc")
+    ctx.library(ctx, parent = "BPF", required_libraries = ["Support"], add_to_library_groups = ["BPF"], name = "BPFInfo")
+    ctx.target_group(ctx, name = "Lanai", parent = "Target")
+    ctx.library(ctx, name = "LanaiCodeGen", parent = "Lanai", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "LanaiAsmParser", "LanaiDesc", "LanaiInfo", "MC", "SelectionDAG", "Support", "Target", "TransformUtils"], add_to_library_groups = ["Lanai"])
+    ctx.library(ctx, required_libraries = ["MC", "MCParser", "Support", "LanaiDesc", "LanaiInfo"], add_to_library_groups = ["Lanai"], name = "LanaiAsmParser", parent = "Lanai")
+    ctx.library(ctx, name = "LanaiDisassembler", parent = "Lanai", required_libraries = ["LanaiDesc", "LanaiInfo", "MC", "MCDisassembler", "Support"], add_to_library_groups = ["Lanai"])
+    ctx.library(ctx, name = "LanaiDesc", parent = "Lanai", required_libraries = ["LanaiInfo", "MC", "MCDisassembler", "Support"], add_to_library_groups = ["Lanai"])
+    ctx.library(ctx, required_libraries = ["Support"], add_to_library_groups = ["Lanai"], name = "LanaiInfo", parent = "Lanai")
+    ctx.target_group(ctx, name = "Hexagon", parent = "Target")
+    ctx.library(ctx, add_to_library_groups = ["Hexagon"], name = "HexagonCodeGen", parent = "Hexagon", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "HexagonAsmParser", "HexagonDesc", "HexagonInfo", "IPO", "MC", "Scalar", "SelectionDAG", "Support", "Target", "TransformUtils"])
+    ctx.library(ctx, required_libraries = ["MC", "MCParser", "Support", "HexagonDesc", "HexagonInfo"], add_to_library_groups = ["Hexagon"], name = "HexagonAsmParser", parent = "Hexagon")
+    ctx.library(ctx, required_libraries = ["HexagonDesc", "HexagonInfo", "MC", "MCDisassembler", "Support"], add_to_library_groups = ["Hexagon"], name = "HexagonDisassembler", parent = "Hexagon")
+    ctx.library(ctx, parent = "Hexagon", required_libraries = ["HexagonInfo", "MC", "Support"], add_to_library_groups = ["Hexagon"], name = "HexagonDesc")
+    ctx.library(ctx, add_to_library_groups = ["Hexagon"], name = "HexagonInfo", parent = "Hexagon", required_libraries = ["Support"])
+    ctx.target_group(ctx, name = "MSP430", parent = "Target")
+    ctx.library(ctx, name = "MSP430CodeGen", parent = "MSP430", required_libraries = ["AsmPrinter", "CodeGen", "Core", "MC", "MSP430Desc", "MSP430Info", "SelectionDAG", "Support", "Target"], add_to_library_groups = ["MSP430"])
+    ctx.library(ctx, name = "MSP430AsmParser", parent = "MSP430", required_libraries = ["MC", "MCParser", "MSP430Desc", "MSP430Info", "Support"], add_to_library_groups = ["MSP430"])
+    ctx.library(ctx, parent = "MSP430", required_libraries = ["MCDisassembler", "MSP430Info", "Support"], add_to_library_groups = ["MSP430"], name = "MSP430Disassembler")
+    ctx.library(ctx, parent = "MSP430", required_libraries = ["MC", "MSP430Info", "Support"], add_to_library_groups = ["MSP430"], name = "MSP430Desc")
+    ctx.library(ctx, name = "MSP430Info", parent = "MSP430", required_libraries = ["Support"], add_to_library_groups = ["MSP430"])
+    ctx.target_group(ctx, parent = "Target", name = "NVPTX")
+    ctx.library(ctx, add_to_library_groups = ["NVPTX"], name = "NVPTXCodeGen", parent = "NVPTX", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "IPO", "MC", "NVPTXDesc", "NVPTXInfo", "Scalar", "SelectionDAG", "Support", "Target", "TransformUtils", "Vectorize"])
+    ctx.library(ctx, name = "NVPTXDesc", parent = "NVPTX", required_libraries = ["MC", "NVPTXInfo", "Support"], add_to_library_groups = ["NVPTX"])
+    ctx.library(ctx, required_libraries = ["Support"], add_to_library_groups = ["NVPTX"], name = "NVPTXInfo", parent = "NVPTX")
+    ctx.target_group(ctx, name = "Mips", parent = "Target")
+    ctx.library(ctx, name = "MipsCodeGen", parent = "Mips", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "MipsDesc", "MipsInfo", "SelectionDAG", "Support", "Target", "GlobalISel"], add_to_library_groups = ["Mips"])
+    ctx.library(ctx, required_libraries = ["MC", "MCParser", "MipsDesc", "MipsInfo", "Support"], add_to_library_groups = ["Mips"], name = "MipsAsmParser", parent = "Mips")
+    ctx.library(ctx, name = "MipsDisassembler", parent = "Mips", required_libraries = ["MCDisassembler", "MipsInfo", "Support"], add_to_library_groups = ["Mips"])
+    ctx.library(ctx, add_to_library_groups = ["Mips"], name = "MipsDesc", parent = "Mips", required_libraries = ["MC", "MipsInfo", "Support"])
+    ctx.library(ctx, name = "MipsInfo", parent = "Mips", required_libraries = ["Support"], add_to_library_groups = ["Mips"])
+    ctx.target_group(ctx, name = "PowerPC", parent = "Target")
+    ctx.library(ctx, parent = "PowerPC", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "PowerPCDesc", "PowerPCInfo", "Scalar", "SelectionDAG", "Support", "Target", "TransformUtils"], add_to_library_groups = ["PowerPC"], name = "PowerPCCodeGen")
+    ctx.library(ctx, parent = "PowerPC", required_libraries = ["MC", "MCParser", "PowerPCDesc", "PowerPCInfo", "Support"], add_to_library_groups = ["PowerPC"], name = "PowerPCAsmParser")
+    ctx.library(ctx, add_to_library_groups = ["PowerPC"], name = "PowerPCDisassembler", parent = "PowerPC", required_libraries = ["MCDisassembler", "PowerPCInfo", "Support"])
+    ctx.library(ctx, required_libraries = ["MC", "PowerPCInfo", "Support"], add_to_library_groups = ["PowerPC"], name = "PowerPCDesc", parent = "PowerPC")
+    ctx.library(ctx, name = "PowerPCInfo", parent = "PowerPC", required_libraries = ["Support"], add_to_library_groups = ["PowerPC"])
+    ctx.target_group(ctx, parent = "Target", name = "RISCV")
+    ctx.library(ctx, required_libraries = ["AsmPrinter", "Core", "CodeGen", "MC", "RISCVDesc", "RISCVInfo", "RISCVUtils", "SelectionDAG", "Support", "Target"], add_to_library_groups = ["RISCV"], name = "RISCVCodeGen", parent = "RISCV")
+    ctx.library(ctx, add_to_library_groups = ["RISCV"], name = "RISCVAsmParser", parent = "RISCV", required_libraries = ["MC", "MCParser", "RISCVDesc", "RISCVInfo", "RISCVUtils", "Support"])
+    ctx.library(ctx, parent = "RISCV", required_libraries = ["MCDisassembler", "RISCVInfo", "Support"], add_to_library_groups = ["RISCV"], name = "RISCVDisassembler")
+    ctx.library(ctx, name = "RISCVInfo", parent = "RISCV", required_libraries = ["Support"], add_to_library_groups = ["RISCV"])
+    ctx.library(ctx, add_to_library_groups = ["RISCV"], name = "RISCVDesc", parent = "RISCV", required_libraries = ["MC", "RISCVInfo", "RISCVUtils", "Support"])
+    ctx.library(ctx, parent = "RISCV", required_libraries = ["Support"], add_to_library_groups = ["RISCV"], name = "RISCVUtils")
+    ctx.target_group(ctx, name = "Sparc", parent = "Target")
+    ctx.library(ctx, add_to_library_groups = ["Sparc"], name = "SparcCodeGen", parent = "Sparc", required_libraries = ["AsmPrinter", "CodeGen", "Core", "MC", "SelectionDAG", "SparcDesc", "SparcInfo", "Support", "Target"])
+    ctx.library(ctx, name = "SparcAsmParser", parent = "Sparc", required_libraries = ["MC", "MCParser", "SparcDesc", "SparcInfo", "Support"], add_to_library_groups = ["Sparc"])
+    ctx.library(ctx, name = "SparcDisassembler", parent = "Sparc", required_libraries = ["MCDisassembler", "SparcInfo", "Support"], add_to_library_groups = ["Sparc"])
+    ctx.library(ctx, name = "SparcDesc", parent = "Sparc", required_libraries = ["MC", "SparcInfo", "Support"], add_to_library_groups = ["Sparc"])
+    ctx.library(ctx, name = "SparcInfo", parent = "Sparc", required_libraries = ["Support"], add_to_library_groups = ["Sparc"])
+    ctx.target_group(ctx, parent = "Target", name = "SystemZ")
+    ctx.library(ctx, parent = "SystemZ", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "Scalar", "SelectionDAG", "Support", "SystemZDesc", "SystemZInfo", "Target"], add_to_library_groups = ["SystemZ"], name = "SystemZCodeGen")
+    ctx.library(ctx, name = "SystemZAsmParser", parent = "SystemZ", required_libraries = ["MC", "MCParser", "Support", "SystemZDesc", "SystemZInfo"], add_to_library_groups = ["SystemZ"])
+    ctx.library(ctx, required_libraries = ["MC", "MCDisassembler", "Support", "SystemZDesc", "SystemZInfo"], add_to_library_groups = ["SystemZ"], name = "SystemZDisassembler", parent = "SystemZ")
+    ctx.library(ctx, add_to_library_groups = ["SystemZ"], name = "SystemZDesc", parent = "SystemZ", required_libraries = ["MC", "Support", "SystemZInfo"])
+    ctx.library(ctx, required_libraries = ["Support"], add_to_library_groups = ["SystemZ"], name = "SystemZInfo", parent = "SystemZ")
+    ctx.target_group(ctx, parent = "Target", name = "WebAssembly")
+    ctx.library(ctx, add_to_library_groups = ["WebAssembly"], name = "WebAssemblyCodeGen", parent = "WebAssembly", required_libraries = ["Analysis", "AsmPrinter", "BinaryFormat", "CodeGen", "Core", "MC", "Scalar", "SelectionDAG", "Support", "Target", "TransformUtils", "WebAssemblyDesc", "WebAssemblyInfo"])
+    ctx.library(ctx, required_libraries = ["MC", "MCParser", "WebAssemblyInfo", "Support"], add_to_library_groups = ["WebAssembly"], name = "WebAssemblyAsmParser", parent = "WebAssembly")
+    ctx.library(ctx, name = "WebAssemblyDisassembler", parent = "WebAssembly", required_libraries = ["WebAssemblyDesc", "MCDisassembler", "WebAssemblyInfo", "Support"], add_to_library_groups = ["WebAssembly"])
+    ctx.library(ctx, name = "WebAssemblyDesc", parent = "WebAssembly", required_libraries = ["MC", "Support", "WebAssemblyInfo"], add_to_library_groups = ["WebAssembly"])
+    ctx.library(ctx, name = "WebAssemblyInfo", parent = "WebAssembly", required_libraries = ["Support"], add_to_library_groups = ["WebAssembly"])
+    ctx.target_group(ctx, parent = "Target", name = "X86")
+    ctx.library(ctx, add_to_library_groups = ["X86"], name = "X86CodeGen", parent = "X86", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "SelectionDAG", "Support", "Target", "X86Desc", "X86Info", "X86Utils", "GlobalISel", "ProfileData"])
+    ctx.library(ctx, name = "X86AsmParser", parent = "X86", required_libraries = ["MC", "MCParser", "Support", "X86Desc", "X86Info"], add_to_library_groups = ["X86"])
+    ctx.library(ctx, required_libraries = ["MCDisassembler", "Support", "X86Info"], add_to_library_groups = ["X86"], name = "X86Disassembler", parent = "X86")
+    ctx.library(ctx, name = "X86Desc", parent = "X86", required_libraries = ["MC", "MCDisassembler", "Object", "Support", "X86Info", "X86Utils"], add_to_library_groups = ["X86"])
+    ctx.library(ctx, name = "X86Info", parent = "X86", required_libraries = ["Support"], add_to_library_groups = ["X86"])
+    ctx.library(ctx, name = "X86Utils", parent = "X86", required_libraries = ["Support"], add_to_library_groups = ["X86"])
+    ctx.library(ctx, parent = "XCore", required_libraries = ["Analysis", "AsmPrinter", "CodeGen", "Core", "MC", "SelectionDAG", "Support", "Target", "TransformUtils", "XCoreDesc", "XCoreInfo"], add_to_library_groups = ["XCore"], name = "XCoreCodeGen")
+    ctx.target_group(ctx, name = "XCore", parent = "Target")
+    ctx.library(ctx, required_libraries = ["MCDisassembler", "Support", "XCoreInfo"], add_to_library_groups = ["XCore"], name = "XCoreDisassembler", parent = "XCore")
+    ctx.library(ctx, required_libraries = ["MC", "Support", "XCoreInfo"], add_to_library_groups = ["XCore"], name = "XCoreDesc", parent = "XCore")
+    ctx.library(ctx, name = "XCoreInfo", parent = "XCore", required_libraries = ["Support"], add_to_library_groups = ["XCore"])
+    ctx.library(ctx, name = "TestingSupport", parent = "Libraries", required_libraries = ["Support"])
+    ctx.group(ctx, name = "ToolDrivers", parent = "Libraries")
+    ctx.library(ctx, required_libraries = ["Object", "Option", "Support"], name = "DlltoolDriver", parent = "Libraries")
+    ctx.library(ctx, parent = "Libraries", required_libraries = ["BinaryFormat", "BitReader", "Object", "Option", "Support"], name = "LibDriver")
+    ctx.group(ctx, parent = "Libraries", name = "Transforms")
+    ctx.library(ctx, required_libraries = ["Analysis", "Core", "Support", "TransformUtils"], name = "AggressiveInstCombine", parent = "Transforms")
+    ctx.library(ctx, required_libraries = ["Analysis", "Core", "IPO", "Scalar", "Support", "TransformUtils"], name = "Coroutines", parent = "Transforms")
+    ctx.library(ctx, parent = "Transforms", library_name = "ipo", required_libraries = ["AggressiveInstCombine", "Analysis", "BitReader", "BitWriter", "Core", "InstCombine", "IRReader", "Linker", "Object", "ProfileData", "Scalar", "Support", "TransformUtils", "Vectorize", "Instrumentation"], name = "IPO")
+    ctx.library(ctx, name = "InstCombine", parent = "Transforms", required_libraries = ["Analysis", "Core", "Support", "TransformUtils"])
+    ctx.library(ctx, name = "Instrumentation", parent = "Transforms", required_libraries = ["Analysis", "Core", "MC", "Support", "TransformUtils", "ProfileData"])
+    ctx.library(ctx, name = "Scalar", parent = "Transforms", library_name = "ScalarOpts", required_libraries = ["AggressiveInstCombine", "Analysis", "Core", "InstCombine", "Support", "TransformUtils"])
+    ctx.library(ctx, name = "TransformUtils", parent = "Transforms", required_libraries = ["Analysis", "Core", "Support"])
+    ctx.library(ctx, name = "Vectorize", parent = "Transforms", library_name = "Vectorize", required_libraries = ["Analysis", "Core", "Support", "TransformUtils"])
+    ctx.library(ctx, name = "ObjCARC", parent = "Transforms", library_name = "ObjCARCOpts", required_libraries = ["Analysis", "Core", "Support", "TransformUtils"])
+    ctx.library(ctx, name = "WindowsManifest", parent = "Libraries", required_libraries = ["Support"])
+    ctx.library(ctx, name = "XRay", parent = "Libraries", required_libraries = ["Support", "Object"])
+    ctx.group(ctx, name = "Projects", parent = "$ROOT")
+    ctx.group(ctx, parent = "$ROOT", name = "Tools")
+    ctx.tool(ctx, name = "bugpoint", parent = "Tools", required_libraries = ["AsmParser", "BitReader", "BitWriter", "CodeGen", "IRReader", "IPO", "Instrumentation", "Linker", "ObjCARC", "Scalar", "all-targets"])
+    ctx.tool(ctx, name = "dsymutil", parent = "Tools", required_libraries = ["AsmPrinter", "DebugInfoDWARF", "MC", "Object", "Support", "all-targets"])
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["AsmParser", "BitReader", "IRReader", "MIRParser", "TransformUtils", "Scalar", "Vectorize", "all-targets"], name = "llc")
+    ctx.tool(ctx, name = "lli", parent = "Tools", required_libraries = ["AsmParser", "BitReader", "IRReader", "Instrumentation", "Interpreter", "MCJIT", "Native", "NativeCodeGen", "SelectionDAG", "TransformUtils"])
+    ctx.tool(ctx, name = "lli-child-target", parent = "lli")
+    ctx.tool(ctx, name = "llvm-ar", parent = "Tools")
+    ctx.tool(ctx, name = "llvm-as", parent = "Tools", required_libraries = ["AsmParser", "BitWriter"])
+    ctx.tool(ctx, name = "llvm-bcanalyzer", parent = "Tools", required_libraries = ["BitReader"])
+    ctx.tool(ctx, name = "llvm-cat", parent = "Tools", required_libraries = ["AsmParser", "BitReader", "BitWriter"])
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["all-targets", "MC", "MCDisassembler", "MCParser", "Support", "Symbolize"], name = "llvm-cfi-verify")
+    ctx.tool(ctx, name = "llvm-cov", parent = "Tools", required_libraries = ["Coverage", "Support", "Instrumentation"])
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["Object", "Option", "Support"], name = "llvm-cvtres")
+    ctx.tool(ctx, required_libraries = ["AsmParser", "BitReader", "IRReader"], name = "llvm-diff", parent = "Tools")
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["Analysis", "BitReader"], name = "llvm-dis")
+    ctx.tool(ctx, name = "llvm-dwarfdump", parent = "Tools", required_libraries = ["DebugInfoDWARF", "Object"])
+    ctx.tool(ctx, name = "llvm-dwp", parent = "Tools", required_libraries = ["AsmPrinter", "DebugInfoDWARF", "MC", "Object", "Support", "all-targets"])
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["Object", "Support", "TextAPI"], name = "llvm-elfabi")
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["CodeGen", "ExecutionEngine", "MC", "MCJIT", "Native", "NativeCodeGen", "Object", "Support"], name = "llvm-exegesis")
+    ctx.tool(ctx, required_libraries = ["AsmParser", "BitReader", "BitWriter", "IRReader", "IPO"], name = "llvm-extract", parent = "Tools")
+    ctx.tool(ctx, required_libraries = ["AsmParser", "BitReader", "IRReader", "Interpreter", "MCJIT", "NativeCodeGen", "Object", "SelectionDAG", "Native"], name = "llvm-jitlistener", parent = "Tools")
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["JITLink", "BinaryFormat", "MC", "Object", "RuntimeDyld", "Support", "all-targets"], name = "llvm-jitlink")
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["AsmParser", "BitReader", "BitWriter", "IRReader", "Linker", "Object", "TransformUtils", "IPO"], name = "llvm-link")
+    ctx.tool(ctx, required_libraries = ["BitWriter", "Core", "IRReader", "LTO", "Object", "Support", "all-targets"], name = "llvm-lto", parent = "Tools")
+    ctx.tool(ctx, name = "llvm-mc", parent = "Tools", required_libraries = ["MC", "MCDisassembler", "MCParser", "Support", "all-targets"])
+    ctx.tool(ctx, name = "llvm-mca", parent = "Tools", required_libraries = ["MC", "MCA", "MCParser", "Support", "all-targets"])
+    ctx.tool(ctx, name = "llvm-modextract", parent = "Tools", required_libraries = ["BitReader", "BitWriter"])
+    ctx.tool(ctx, name = "llvm-mt", parent = "Tools", required_libraries = ["Option", "Support", "WindowsManifest"])
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["BitReader", "Object"], name = "llvm-nm")
+    ctx.tool(ctx, name = "llvm-objcopy", parent = "Tools", required_libraries = ["Object", "Option", "Support", "MC"])
+    ctx.tool(ctx, required_libraries = ["DebugInfoDWARF", "MC", "MCDisassembler", "MCParser", "Object", "all-targets", "Demangle"], name = "llvm-objdump", parent = "Tools")
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["DebugInfoMSF", "DebugInfoPDB"], name = "llvm-pdbutil")
+    ctx.tool(ctx, name = "llvm-profdata", parent = "Tools", required_libraries = ["ProfileData", "Support"])
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["Option"], name = "llvm-rc")
+    ctx.tool(ctx, required_libraries = ["MC", "Object", "RuntimeDyld", "Support", "all-targets"], name = "llvm-rtdyld", parent = "Tools")
+    ctx.tool(ctx, name = "llvm-size", parent = "Tools", required_libraries = ["Object"])
+    ctx.tool(ctx, name = "llvm-split", parent = "Tools", required_libraries = ["TransformUtils", "BitWriter", "Core", "IRReader", "Support"])
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["Demangle", "Support"], name = "llvm-undname")
+    ctx.tool(ctx, parent = "Tools", required_libraries = ["AsmParser", "BitReader", "BitWriter", "CodeGen", "IRReader", "IPO", "Instrumentation", "Scalar", "ObjCARC", "Passes", "all-targets"], name = "opt")
+    ctx.tool(ctx, name = "verify-uselistorder", parent = "Tools", required_libraries = ["IRReader", "BitWriter", "Support"])
+    ctx.group(ctx, name = "BuildTools", parent = "$ROOT")
+    ctx.group(ctx, parent = "$ROOT", name = "UtilityTools")
+    ctx.build_tool(ctx, name = "tblgen", parent = "BuildTools", required_libraries = ["Support", "TableGen", "MC"])
+    ctx.library(ctx, parent = "Libraries", required_libraries = ["Support"], name = "gtest")
+    ctx.library(ctx, name = "gtest_main", parent = "Libraries", required_libraries = ["gtest"])
+    return ctx
diff --git a/tools/build_rules/llvm/llvm.BUILD b/tools/build_rules/llvm/llvm.BUILD
index e54f69a..17481e9 100644
--- a/tools/build_rules/llvm/llvm.BUILD
+++ b/tools/build_rules/llvm/llvm.BUILD
@@ -20,7 +20,7 @@
     "LLVMCore": {
         "additional_header_dirs": [
             # Layering violation.
-            "/include/llvm/Analysis",
+            "/root/include/llvm/Analysis",
         ],
         "hdrs": glob([
             "include/llvm/*.h",
@@ -136,6 +136,17 @@
     hdrs = ["include/llvm/Support/VCSRevision.h"],
 )
 
+genrule(
+    name = "clang_basic_version_inc_gen",
+    outs = ["tools/clang/lib/Basic/VCSVersion.inc"],
+    cmd = ("printf " +
+           "\"#define CLANG_VERSION 9999.0\n\"" +
+           "\"#define CLANG_VERSION_MAJOR 9999\n\"" +
+           "\"#define CLANG_VERSION_MINOR 0\n\"" +
+           "\"#define CLANG_VERSION_PATCHLEVEL 0\n\"" +
+           "\"#define CLANG_VERSION_STRING \\\"google3-trunk\\\"\n\" > $@"),
+)
+
 load("@io_kythe//tools:build_rules/cc_resources.bzl", "cc_resources")
 
 builtin_headers = glob(
@@ -163,17 +174,19 @@
 )
 
 load("@io_kythe//tools/build_rules/llvm:cmake_defines.bzl", "cmake_defines", "LLVM_TARGETS")
-load("@io_kythe//tools/build_rules/llvm:generated_llvm_build_deps.bzl", "LLVM_BUILD_DEPS")
-load("@io_kythe//tools/build_rules/llvm:llvm.bzl", "make_context")
-load("@io_kythe//tools/build_rules/llvm:generated_cmake_targets.bzl", "generated_cmake_targets")
 
 cc_library(
     name = "all_targets",
     deps = [":LLVM%sCodeGen" % t for t in LLVM_TARGETS],
 )
 
+load("@io_kythe_llvmbzlgen//rules:llvmbuild.bzl", _llvmbuild_context = "make_context")
+load("@io_kythe//tools/build_rules/llvm:generated_llvm_build_targets.bzl", "generated_llvm_build_targets")
+load("@io_kythe//tools/build_rules/llvm:llvm.bzl", "make_context")
+load("@io_kythe//tools/build_rules/llvm:generated_cmake_targets.bzl", "generated_cmake_targets")
+
 generated_cmake_targets(make_context(
     cmake_defines = cmake_defines(),
-    llvm_build_deps = LLVM_BUILD_DEPS,
+    llvmbuildctx = generated_llvm_build_targets(_llvmbuild_context()),
     target_defaults = TARGET_DEFAULTS,
 ))
diff --git a/tools/build_rules/llvm/llvm.bzl b/tools/build_rules/llvm/llvm.bzl
index dd576c5..339b5a1 100644
--- a/tools/build_rules/llvm/llvm.bzl
+++ b/tools/build_rules/llvm/llvm.bzl
@@ -1,25 +1,21 @@
-load("@io_kythe//tools/build_rules/llvm:configure_file.bzl", "configure_file")
+load("@io_kythe_llvmbzlgen//rules:configure_file.bzl", "configure_file")
+load("@io_kythe_llvmbzlgen//rules:llvmbuild.bzl", "llvmbuild")
 load("@bazel_skylib//lib:paths.bzl", "paths")
 load("@bazel_skylib//lib:collections.bzl", "collections")
 
+# CMake paths are all rooted at the fake "/root" path.
+_ROOT_PREFIX = "/root"
+
 def _repo_path(path):
     if native.repository_name() == "@":
         return path
     return paths.join("external", native.repository_name()[1:], path.lstrip("/"))
 
 def _llvm_build_deps(ctx, name):
-    # TODO(shahms): Do this transformation during generation.
-    llvm_to_cmake = {
-        "Scalar": "ScalarOpts",
-        "IPO": "ipo",
-        "ObjCARC": "ObjCARCOpts",
-    }
-    cmake_to_llvm = dict([(v, k) for k, v in llvm_to_cmake.items()])
     name = _replace_prefix(name, "LLVM", "")
-    name = cmake_to_llvm.get(name, name)
     return [
-        ":LLVM" + llvm_to_cmake.get(d, d)
-        for d in ctx._config.llvm_build_deps.get(name, [])
+        ":LLVM" + d
+        for d in llvmbuild.library_dependencies(ctx._config.llvmbuildctx, name)
     ]
 
 def _root_path(ctx):
@@ -27,9 +23,11 @@
 
 def _join_path(root, path):
     """Special handling for absolute paths."""
-    if path.startswith("/"):
-        return paths.normalize(path.lstrip("/"))  # CMake paths are all "rooted" at the workspace.
-    return paths.normalize(paths.join(root.lstrip("/"), path))
+    if path.startswith(_ROOT_PREFIX):
+        return paths.normalize(paths.relativize(path, _ROOT_PREFIX))
+    if root.startswith(_ROOT_PREFIX):
+        root = paths.relativize(root, _ROOT_PREFIX)
+    return paths.normalize(paths.join(root, path))
 
 def _llvm_headers(root):
     root = _replace_prefix(root, "lib/", "include/llvm/")
@@ -292,7 +290,7 @@
     sources.extend(args)
     _add_llvm_library(ctx, "LLVM" + name, *sources)
 
-def _enter_directory(ctx, path):
+def _push_directory(ctx, path):
     ctx._state.append(struct(
         path = path,
         vars = {},
@@ -301,7 +299,7 @@
     ))
     return ctx
 
-def _exit_directory(ctx, path):
+def _pop_directory(ctx):
     gen_hdrs = _current(ctx).gen_hdrs
     if gen_hdrs:
         native.filegroup(
@@ -315,8 +313,8 @@
     return struct(
         _state = [],
         _config = struct(**kwargs),
-        enter_directory = _enter_directory,
-        exit_directory = _exit_directory,
+        push_directory = _push_directory,
+        pop_directory = _pop_directory,
         set = _set_cmake_var,
         configure_file = _configure_file,
         add_llvm_library = _add_llvm_library,