Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Commit 347153f

Browse files
authored
Merge pull request #22 from nikomatsakis/patches
extend process.sh to support patch stages
2 parents d525abd + f9c888a commit 347153f

File tree

196 files changed

+201604
-208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+201604
-208
lines changed

futures-rs-test-all/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
rm -f target/debug/all-*
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

helloworld/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

html5ever-2016-08-25/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

hyper.0.5.0/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

inflate-0.1.0/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

issue-32062-equality-relations-complexity/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

issue-32278-big-array-of-strings/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

jld-day15-parser/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

piston-image-0.10.3/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ touch:
66
find . -name '*.rs' | xargs touch
77
clean:
88
cargo clean
9+
patches:
10+
@echo ''

process.sh

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,66 @@
11
#!/bin/bash
22

3-
TIMES_DIR=/home/ncameron/times
4-
SCRIPTS_DIR=/home/ncameron/times-scripts
3+
if [ -z "$TIMES_DIR" ]; then
4+
TIMES_DIR=/home/ncameron/times
5+
fi
6+
if [ -z "$SCRIPTS_DIR" ]; then
7+
SCRIPTS_DIR=/home/ncameron/times-scripts
8+
fi
9+
10+
echo TIMES_DIR=$TIMES_DIR
11+
echo SCRIPTS_DIR=$SCRIPTS_DIR
512

613
START=$(pwd)
714
export CARGO_RUSTC_OPTS="-Ztime-passes -Zinput-stats"
815
export PATH=$RUSTC_DIR/bin:$PATH
916

10-
for dir in *; do
17+
# Check if user provided list of directories;
18+
# else process them all.
19+
if [ "$1" != "" ]; then
20+
DIRS="$@"
21+
else
22+
DIRS="*"
23+
fi
24+
25+
for dir in $DIRS; do
1126
if [[ -d $dir ]]; then
1227
echo "Processing $dir"
1328

29+
cd $START/$dir
30+
PATCHES=($(make patches))
31+
if [ ! "${PATCHES[*]}" ]; then
32+
PATCHES=('')
33+
fi
34+
35+
echo Patches: ${PATCHES[*]}
36+
1437
for i in 0 1 2 3 4 5
1538
do
16-
cd $RUST_DIR
17-
git show HEAD -s >$TIMES_DIR/raw/$dir--$DATE--$i.log
18-
cd $START/$dir
19-
echo "rustc: ./$dir" >>$TIMES_DIR/raw/$dir--$DATE--$i.log
20-
make >>$TIMES_DIR/raw/$dir--$DATE--$i.log
21-
echo "done" >>$TIMES_DIR/raw/$dir--$DATE--$i.log
22-
39+
for PATCH in "${PATCHES[@]}"; do
40+
cd $RUST_DIR
41+
git show HEAD -s >$TIMES_DIR/raw/$dir$PATCH--$DATE--$i.log
42+
cd $START/$dir
43+
echo "rustc: ./$dir" >>$TIMES_DIR/raw/$dir$PATCH--$DATE--$i.log
44+
make all$PATCH >>$TIMES_DIR/raw/$dir$PATCH--$DATE--$i.log
45+
echo "done" >>$TIMES_DIR/raw/$dir$PATCH--$DATE--$i.log
46+
done
2347
make touch >/dev/null
2448
done
2549

2650
make clean >/dev/null
2751

2852
cd $TIMES_DIR
29-
python $SCRIPTS_DIR/process.py $dir $DATE 6
53+
for PATCH in "${PATCHES[@]}"; do
54+
python $SCRIPTS_DIR/process.py "$dir$PATCH" "$DATE" 6
55+
done
56+
3057
for i in 0 1 2 3 4 5
3158
do
32-
git add raw/$dir--$DATE--$i.log
33-
git add raw/orbit-$dir--$DATE--$i.log
34-
git add processed/$dir--$DATE--$i.json
59+
for PATCH in "${PATCHES[@]}"; do
60+
git add "raw/$dir$PATCH--$DATE--$i.log"
61+
git add "raw/orbit-$dir$PATCH--$DATE--$i.log"
62+
git add "processed/$dir$PATCH--$DATE--$i.json"
63+
done
3564
done
3665

3766
cd $START

regex-0.1.80/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target
2+
Cargo.lock
3+
bench-log
4+
.*.swp
5+
wiki
6+
tags

regex-0.1.80/.travis.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
language: rust
2+
rust:
3+
- 1.3.0
4+
- stable
5+
- beta
6+
- nightly
7+
sudo: false
8+
script:
9+
- cargo build --verbose
10+
- if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
11+
cargo build --verbose --manifest-path=regex-debug/Cargo.toml;
12+
RUSTFLAGS="-C target-feature=+ssse3" cargo test --verbose --features 'simd-accel pattern';
13+
else
14+
travis_wait cargo test --verbose;
15+
fi
16+
- ./run-shootout-test
17+
- cargo doc --verbose
18+
- cargo test --verbose --manifest-path=regex-syntax/Cargo.toml
19+
- cargo doc --verbose --manifest-path=regex-syntax/Cargo.toml
20+
- if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
21+
(cd regex-capi && cargo build --verbose);
22+
(cd regex-capi/ctest && ./compile && LD_LIBRARY_PATH=../target/debug ./test);
23+
(cd regex-capi/examples && ./compile && LD_LIBRARY_PATH=../target/release ./iter);
24+
(cd bench && travis_wait ./run rust);
25+
(cd bench && travis_wait ./run rust-bytes --no-run);
26+
(cd bench && travis_wait ./run pcre1 --no-run);
27+
(cd bench && travis_wait ./run onig --no-run);
28+
travis_wait cargo test --verbose --manifest-path=regex_macros/Cargo.toml;
29+
fi
30+
addons:
31+
apt:
32+
packages:
33+
- libcurl4-openssl-dev
34+
- libelf-dev
35+
- libdw-dev
36+
- binutils-dev
37+
after_success: |
38+
[ $TRAVIS_BRANCH = master ] &&
39+
[ $TRAVIS_PULL_REQUEST = false ] &&
40+
[ $TRAVIS_RUST_VERSION = nightly ] &&
41+
echo '<meta http-equiv=refresh content=0;url=regex/index.html>' > target/doc/index.html &&
42+
pip install ghp-import --user $USER &&
43+
$HOME/.local/bin/ghp-import -n target/doc &&
44+
git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages &&
45+
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
46+
tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make && make install DESTDIR=../tmp && cd ../.. &&
47+
PATH="./kcov-master/tmp/usr/local/bin:$PATH" ./run-kcov --coveralls-id $TRAVIS_JOB_ID
48+
env:
49+
global:
50+
secure: VvIrYRW/a8FmBA61hn1bDrqWwR92tANOT6PCeLYd9A9ViQrN07PE6uGsnd9iwr8itck10Ctl1mThZYUkK8BDFEmlvSxOFJ/Po5eRe6A1CYuFF40zizJ+3NllVkN20kwoQDe0kxwZVDGO9Yi1icHUrbRPWDfS+1tfobO/UT8Dlng=
51+
notifications:
52+
email:
53+
on_success: never

regex-0.1.80/030-compile_one.diff

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/regex-0.1.80/src/compile.rs b/regex-0.1.80/src/compile.rs
2+
index 9db743f..ef1948e 100644
3+
--- a/regex-0.1.80/src/compile.rs
4+
+++ b/regex-0.1.80/src/compile.rs
5+
@@ -137,6 +137,8 @@ impl Compiler {
6+
}
7+
8+
fn compile_one(mut self, expr: &Expr) -> result::Result<Program, Error> {
9+
+ {} // @030
10+
+
11+
// If we're compiling a forward DFA and we aren't anchored, then
12+
// add a `.*?` before the first capture group.
13+
// Other matching engines handle this by baking the logic into the
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/regex-0.1.80/src/expand.rs b/regex-0.1.80/src/expand.rs
2+
index 9bea703..3b6ae94 100644
3+
--- a/regex-0.1.80/src/expand.rs
4+
+++ b/regex-0.1.80/src/expand.rs
5+
@@ -84,6 +84,7 @@ fn find_cap_ref(mut replacement: &[u8]) -> Option<CaptureRef> {
6+
}
7+
8+
fn is_valid_cap_letter(b: &u8) -> bool {
9+
+ { }
10+
match *b {
11+
b'0' ... b'9' | b'a' ... b'z' | b'A' ... b'Z' | b'_' => true,
12+
_ => false,

regex-0.1.80/050-expand.diff

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/regex-0.1.80/src/expand.rs b/regex-0.1.80/src/expand.rs
2+
index 9bea703..a28b82d 100644
3+
--- a/regex-0.1.80/src/expand.rs
4+
+++ b/regex-0.1.80/src/expand.rs
5+
@@ -5,6 +5,7 @@ use memchr::memchr;
6+
use bytes::Captures;
7+
8+
pub fn expand(caps: &Captures, mut replacement: &[u8], dst: &mut Vec<u8>) {
9+
+ { }
10+
while !replacement.is_empty() {
11+
match memchr(b'$', replacement) {
12+
None => break,

regex-0.1.80/060-Compiler-new.diff

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/regex-0.1.80/src/compile.rs b/regex-0.1.80/src/compile.rs
2+
index 9db743f..fb812ae 100644
3+
--- a/regex-0.1.80/src/compile.rs
4+
+++ b/regex-0.1.80/src/compile.rs
5+
@@ -54,6 +54,7 @@ impl Compiler {
6+
///
7+
/// Various options can be set before calling `compile` on an expression.
8+
pub fn new() -> Self {
9+
+ {}
10+
Compiler {
11+
insts: vec![],
12+
compiled: Program::new(),

regex-0.1.80/060-reverse.diff

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/regex-0.1.80/src/compile.rs b/regex-0.1.80/src/compile.rs
2+
index 9db743f..4e56c2d 100644
3+
--- a/regex-0.1.80/src/compile.rs
4+
+++ b/regex-0.1.80/src/compile.rs
5+
@@ -114,6 +114,7 @@ impl Compiler {
6+
/// When set, the machine returned is suitable for matching text in
7+
/// reverse. In particular, all concatenations are flipped.
8+
pub fn reverse(mut self, yes: bool) -> Self {
9+
+ {}
10+
self.compiled.is_reverse = yes;
11+
self
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/regex-0.1.80/src/freqs.rs b/regex-0.1.80/src/freqs.rs
2+
index 92bafc1..6eb5799 100644
3+
--- a/regex-0.1.80/src/freqs.rs
4+
+++ b/regex-0.1.80/src/freqs.rs
5+
@@ -12,7 +12,7 @@
6+
// edit directly
7+
8+
pub const BYTE_FREQUENCIES: [u8; 256] = [
9+
- 55, // '\x00'
10+
+ 54+1, // '\x00'
11+
52, // '\x01'
12+
51, // '\x02'
13+
50, // '\x03'

regex-0.1.80/080-SparseSet.diff

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/regex-0.1.80/src/sparse.rs b/regex-0.1.80/src/sparse.rs
2+
index 34c05e7..ef5188e 100644
3+
--- a/regex-0.1.80/src/sparse.rs
4+
+++ b/regex-0.1.80/src/sparse.rs
5+
@@ -16,13 +16,13 @@ pub struct SparseSet {
6+
/// Dense contains the instruction pointers in the order in which they
7+
/// were inserted. Accessing elements >= self.size is illegal.
8+
dense: Vec<usize>,
9+
+ /// The number of elements in the set.
10+
+ size: usize,
11+
/// Sparse maps instruction pointers to their location in dense.
12+
///
13+
/// An instruction pointer is in the set if and only if
14+
/// sparse[ip] < size && ip == dense[sparse[ip]].
15+
sparse: Vec<usize>,
16+
- /// The number of elements in the set.
17+
- size: usize,
18+
}
19+
20+
impl SparseSet {

regex-0.1.80/090-Job.diff

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/regex-0.1.80/src/backtrack.rs b/regex-0.1.80/src/backtrack.rs
2+
index 3c06254..4b72fd4 100644
3+
--- a/regex-0.1.80/src/backtrack.rs
4+
+++ b/regex-0.1.80/src/backtrack.rs
5+
@@ -82,8 +82,8 @@ impl Cache {
6+
/// stack to do it.
7+
#[derive(Clone, Copy, Debug)]
8+
enum Job {
9+
- Inst { ip: InstPtr, at: InputAt },
10+
SaveRestore { slot: usize, old_pos: Option<usize> },
11+
+ Inst { ip: InstPtr, at: InputAt },
12+
}
13+
14+
impl<'a, 'm, 'r, 's, I: Input> Bounded<'a, 'm, 'r, 's, I> {

0 commit comments

Comments
 (0)