Files
hakorune/tools/de_rust/archive_rust_llvm_backend.sh

31 lines
852 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
SRC_DIR="$ROOT/src/backend/llvm"
DST_DIR="$ROOT/archive/rust-llvm-backend/llvm"
RESTORE_MD="$ROOT/archive/rust-llvm-backend/RESTORE.md"
echo "[info] DeRust Phase0: archive Rust LLVM backend"
if [ ! -d "$SRC_DIR" ]; then
echo "[warn] src/backend/llvm not found; nothing to do" >&2
exit 0
fi
mkdir -p "$(dirname "$DST_DIR")"
git mv "$SRC_DIR" "$DST_DIR"
cat > "$RESTORE_MD" <<'EOF'
# RESTORE — Rust LLVM backend
To restore the archived backend back to the original location:
git mv archive/rust-llvm-backend/llvm src/backend/
Rationale: Python llvmlite is the primary LLVM path. The Rust backend was deprecated and archived as part of the DeRust Phase0.
EOF
echo "[done] Archived to archive/rust-llvm-backend/. Review and commit when ready."