
for arch in ptx ptx_dev arm x86; do 

    C_STUB=architecture.${arch}.stdlib.cpp
    LL_STUB=architecture.${arch}.stdlib.ll
    RESULT=architecture.${arch}.initmod.c

    clang -emit-llvm -S $C_STUB -o -           \
        | grep -v "^target triple"             \
        | grep -v "^target datalayout"         \
        | grep -v "^; ModuleID"                \
        | cat - $LL_STUB                       \
        | llvm-as - -o -                       \
        | python bitcode2cpp.py ${arch}        \
        > $RESULT

done

for arch in ptx ptx_dev arm x86; do 

    C_STUB=architecture.${arch}.stdlib.cpp
    LL_STUB=architecture.${arch}.stdlib.ll
    RESULT=architecture.${arch}.initmod.c
    
    if [[ $arch == "ptx" ]]; then
      LL_STUB="$LL_STUB architecture.x86.stdlib.ll"
    fi
    
    clang -emit-llvm -S $C_STUB -o -           \
        | grep -v "^target triple"             \
        | grep -v "^target datalayout"         \
        | grep -v "^; ModuleID"                \
        | cat - $LL_STUB                       \
        | llvm-as - -o -                       \
        | python bitcode2cpp.py ${arch}        \
        > $RESULT

done
Make PTX host initial module include x86 ll
Make PTX host initial module include x86 ll

Former-commit-id: 67c1ccee504ae9189bfea7cb5bc9bf8517bf852c