rust/src/etc/gen-intrinsics
Brian Anderson bda40e2e4a rt: Fix intrinsics bustage
intrinsics.cpp and the file to generate the ll had bitrotted.
2012-02-02 18:10:23 -08:00

28 lines
819 B
Bash
Executable File

#!/bin/sh
# This script generates new definitions for the intrinsics using
# clang. This is not currently in the Makefile to avoid any dependency
# on clang.
for ARCH in i386 x86_64
do
if [ $ARCH = "i386" ]
then
BITS=32
else
BITS=64
fi
clang++ -emit-llvm -S -m$BITS -O3 -Isrc/rt/isaac -Isrc/rt/uthash \
-Isrc/rt/arch/$ARCH -Isrc/rt -fno-stack-protector \
-o src/rt/intrinsics/intrinsics.$ARCH.ll.in \
src/rt/intrinsics/intrinsics.cpp
sed -i .orig \
-e 's/^target datalayout =/; target datalayout =/' \
src/rt/intrinsics/intrinsics.$ARCH.ll.in
sed -i .orig \
-e 's/^target triple = "[^"]*"/target triple = "@CFG_TARGET_TRIPLE@"/' \
src/rt/intrinsics/intrinsics.$ARCH.ll.in
rm src/rt/intrinsics/intrinsics.$ARCH.ll.in.orig
done