(CommandList children: [ (FuncDef name: git_maybe_clone body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:repo) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [76] ) ] spids: [74] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:dir) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [84] ) ] spids: [82] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalNot child: (BoolUnary op_id: BoolUnary_d child: {(DQ ($ VSub_Name "$dir") (/.git))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(git)} {(clone)} {(DQ ($ VSub_Name "$repo"))} {(DQ ($ VSub_Name "$dir"))}) ] spids: [-1 106] ) ] spids: [-1 122] ) ] spids: [71] ) spids: [67 70] ) (FuncDef name: git_checkout_sha body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:repo) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [136] ) ] spids: [134] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:sha) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [144] ) ] spids: [142] ) (C {(cd)} {(DQ ($ VSub_Name "$repo"))}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$sha"))} right: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(HEAD)})] ) left_token: <Left_CommandSub "$("> spids: [168 174] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(git)} {(fetch)} {(origin)} {(master)}) (C {(git)} {(checkout)} {(-f)} {(DQ ($ VSub_Name "$sha"))}) ] spids: [-1 180] ) ] spids: [-1 203] ) (SimpleCommand words: [{(cd)} {(-)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[210])] ) ] spids: [131] ) spids: [127 130] ) (C {(cd)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(dirname)} {($ VSub_Number "$0")})]) left_token: <Left_CommandSub "$("> spids: [219 223] ) (/../..) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ROOT) op: Equal rhs: {(DQ ($ VSub_Name "$PWD"))} spids: [227] ) ] spids: [227] ) (C {(bazel)} {(build)} {(//tools/modules) (Lit_Other ":") (compiler_info)}) (C {(eval)} { (DQ (CommandSubPart command_list: (CommandList children: [ (SimpleCommand redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(bazel-genfiles/tools/modules/compiler_info.txt)} spids: [245] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [244 247] ) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:LLVM_REPO) op: Equal rhs: {(DQ ($ VSub_Name "$ROOT") (/third_party/llvm/llvm))} spids: [251] ) ] spids: [251] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$LLVM_REPO"))}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolUnary op_id: BoolUnary_d child: {(DQ ($ VSub_Name "$LLVM_REPO") (/build))} ) right: (LogicalNot child: (BoolUnary op_id: BoolUnary_h child: {(DQ ($ VSub_Name "$LLVM_REPO") (/build))} ) ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Your checkout has a directory at:"))}) (C {(echo)} {(DQ (" ") ($ VSub_Name "$LLVM_REPO") (/build))}) (C {(echo)} {(DQ ("update_modules expects this to be a symlink that it will overwrite."))}) (C {(echo)} {(DQ ("Please remove this directory if you want update_modules to manage LLVM."))} ) (C {(exit)} {(1)}) ] spids: [-1 291] ) ] spids: [-1 328] ) (C {(.)} {(./tools/modules/versions.sh)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolUnary op_id:BoolUnary_z child:{(DQ ($ VSub_Number "$1"))}) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Number "$1"))} right: {(DQ (--git_only))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Using repository in ") ($ VSub_Name "$LLVM_REPO"))}) (C {(git_maybe_clone)} {(https) (Lit_Other ":") (//github.com/llvm-mirror/llvm)} {(DQ ($ VSub_Name "$LLVM_REPO"))} ) (C {(git_maybe_clone)} {(https) (Lit_Other ":") (//github.com/llvm-mirror/clang)} {(DQ ($ VSub_Name "$LLVM_REPO") (/tools/clang))} ) (C {(rm)} {(-rf)} {(DQ ($ VSub_Name "$LLVM_REPO") (/tools/clang/tools/extra))}) (C {(git_checkout_sha)} {(DQ ($ VSub_Name "$LLVM_REPO"))} {(DQ ($ VSub_Name "$MIN_LLVM_SHA"))} ) (C {(git_checkout_sha)} {(DQ ($ VSub_Name "$LLVM_REPO") (/tools/clang))} {(DQ ($ VSub_Name "$MIN_CLANG_SHA"))} ) ] spids: [-1 360] ) ] spids: [-1 428] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolUnary op_id:BoolUnary_z child:{(DQ ($ VSub_Number "$1"))}) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Number "$1"))} right: {(DQ (--build_only))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(cd)} {(DQ ($ VSub_Name "$LLVM_REPO"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:vbuild_dir) op: Equal rhs: {(DQ (build.) (${ VSub_Name MIN_LLVM_SHA) (.) (${ VSub_Name MIN_CLANG_SHA))} spids: [466] ) ] spids: [466] ) (C {(find)} {(DQ (${ VSub_Name LLVM_REPO))} {(-maxdepth)} {(1)} {(-type)} {(d)} {(KW_Bang "!")} {(-name)} {(DQ (${ VSub_Name vbuild_dir))} {(-name)} {(SQ <"build.*.*">)} {(-exec)} {(rm)} {(-rf)} {(EscapedLiteralPart token:<Lit_EscapedChar "\\{">) (Lit_RBrace "}")} {(EscapedLiteralPart token:<Lit_EscapedChar "\\;">)} ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalNot child: (BoolUnary op_id: BoolUnary_d child: {(DQ ($ VSub_Name "$vbuild_dir"))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$vbuild_dir"))}) (C {(trap)} { (DQ ("rm -rf '") ($ VSub_Name "$LLVM_REPO") (/) ($ VSub_Name "$vbuild_dir") ("'")) } {(ERR)} {(INT)} ) (C {(cd)} {(DQ ($ VSub_Name "$vbuild_dir"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CXX) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(basename)} {(DQ (${ VSub_Name BAZEL_CC))}) (C {(sed)} {(-E)} {(SQ <"s/(cc)?(-.*)?$/++\\2/">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [577 595] ) } spids: [576] ) ] spids: [576] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} { (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ (${ VSub_Name BAZEL_CC))})] ) left_token: <Left_CommandSub "$("> spids: [606 614] ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CXX) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ (${ VSub_Name BAZEL_CC))})] ) left_token: <Left_CommandSub "$("> spids: [624 632] ) (/) (${ VSub_Name CXX) ) } spids: [622] ) ] spids: [622] ) ] spids: [-1 619] ) ] spids: [-1 640] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-x)} {(DQ ($ VSub_Name "$CXX"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CXX) op: Equal rhs: {(DQ ($ VSub_Name "$BAZEL_CC"))} spids: [661] ) ] spids: [661] ) ] spids: [-1 658] ) ] spids: [-1 670] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(uname)})]) left_token: <Left_CommandSub "$("> spids: [677 679] ) } right: {(SQ <Darwin>)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CMAKE_CXX_FLAGS) op: Equal rhs: {(DQ ("-lstdc++"))} spids: [693] ) ] spids: [693] ) ] spids: [-1 690] ) ] spids: [-1 699] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CMAKE_GEN) op: Equal rhs: {(DQ ("Unix Makefiles"))} spids: [702] ) ] spids: [702] ) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(which)} {(ninja)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [714] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [718] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CMAKE_GEN) op: Equal rhs: {(Ninja)} spids: [726] ) ] spids: [726] ) ] spids: [-1 723] ) ] spids: [-1 730] ) (C {(cmake)} {(DQ (-G) ($ VSub_Name "$CMAKE_GEN"))} {(-DCMAKE_INSTALL_PREFIX) (Lit_Other "=") (DQ ($ VSub_Name "$LLVM_REPO") (/build-install)) } {(-DCMAKE_BUILD_TYPE) (Lit_Other "=") (DQ (Release))} {(-DCMAKE_C_COMPILER) (Lit_Other "=") (DQ (${ VSub_Name BAZEL_CC))} {(-DCMAKE_CXX_COMPILER) (Lit_Other "=") (DQ (${ VSub_Name CXX))} {(-DCLANG_BUILD_TOOLS) (Lit_Other "=") (DQ (OFF))} {(-DCLANG_INCLUDE_DOCS) (Lit_Other "=") (DQ (OFF))} {(-DCLANG_INCLUDE_TESTS) (Lit_Other "=") (DQ (OFF))} {(-DLIBCLANG_BUILD_STATIC) (Lit_Other "=") (DQ (ON))} {(-DLLVM_BUILD_TOOLS) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_BUILD_UTILS) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_BUILD_RUNTIME) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_DYLIB_COMPONENTS) (Lit_Other "=") (DQ )} {(-DLLVM_ENABLE_OCAMLDOC) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_INCLUDE_DOCS) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_INCLUDE_EXAMPLES) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_INCLUDE_GO_TESTS) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_INCLUDE_TESTS) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_INCLUDE_TOOLS) (Lit_Other "=") (DQ (ON))} {(-DLLVM_INCLUDE_UTILS) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_TARGETS_TO_BUILD) (Lit_Other "=") (DQ ("X86;PowerPC;ARM;AArch64;Mips"))} {(-DBUILD_SHARED_LIBS) (Lit_Other "=") (DQ (OFF))} {(-DLLVM_BUILD_LLVM_DYLIB) (Lit_Other "=") (DQ (OFF))} {(-DCMAKE_CXX_FLAGS) (Lit_Other "=") (DQ (${ VSub_Name CMAKE_CXX_FLAGS))} {(..)} ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(uname)})]) left_token: <Left_CommandSub "$("> spids: [947 949] ) } right: {(SQ <Darwin>)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cores) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(sysctl)} {(-n)} {(hw.ncpu)})] ) left_token: <Left_CommandSub "$("> spids: [965 971] ) ) } spids: [963] ) ] spids: [963] ) ] spids: [-1 960] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cores) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(nproc)})]) left_token: <Left_CommandSub "$("> spids: [980 982] ) ) } spids: [978] ) ] spids: [978] ) ] spids: [975 986] ) (C {(cmake)} {(--build)} {(.)} {(--)} {(DQ (-j) (${ VSub_Name cores))} {(clangAnalysis)} {(clangAST)} {(clangBasic)} {(clangDriver)} {(clangEdit)} {(clangFrontend)} {(clang-headers)} {(clangLex)} {(clangParse)} {(clangRewrite)} {(clangSema)} {(clangSerialization)} {(clangTooling)} {(LLVMAArch64Info)} {(LLVMARMInfo)} {(LLVMBitReader)} {(LLVMCore)} {(LLVMMC)} {(LLVMMCParser)} {(LLVMMipsInfo)} {(LLVMOption)} {(LLVMBinaryFormat)} {(LLVMPowerPCInfo)} {(LLVMProfileData)} {(LLVMX86Info)} {(clangFormat)} {(clangToolingCore)} ) (C {(cd)} {(..)}) ] spids: [-1 542] ) ] spids: [-1 1076] ) (C {(rm)} {(-f)} {(build)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(uname)})]) left_token: <Left_CommandSub "$("> spids: [1090 1092] ) } right: {(SQ <Darwin>)} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(ln)} {(-sf)} {(DQ ($ VSub_Name "$vbuild_dir"))} {(build)})] spids: [-1 1103] ) ] else_action: [(C {(ln)} {(-sfT)} {(DQ ($ VSub_Name "$vbuild_dir"))} {(build)})] spids: [1117 1131] ) ] spids: [-1 456] ) ] spids: [-1 1133] ) ] )