[llvm-extract] Add option for recursive extraction
authorKeno Fischer <keno@alumni.harvard.edu>
Thu, 6 Apr 2017 20:51:40 +0000 (20:51 +0000)
committerKeno Fischer <keno@alumni.harvard.edu>
Thu, 6 Apr 2017 20:51:40 +0000 (20:51 +0000)
commit1505de5495bd72b1478d2bf74c6da3c2833f7d55
tree08acf4765002d79108886b6fb3bd5bc43d3f2acc
parent8d4e2768be3aa1e2ecd9c6fec430ab770a5bea6d
[llvm-extract] Add option for recursive extraction

Summary:
Particularly, with --delete, this can be very useful for testing
new optimizations on some hotspots, without having to run it on the whole
application. E.g. as such:
```
llvm-extract app.bc --recursive --rfunc .*hotspot.* > hotspot.bc
llvm-extract app.bc --recursive --delete --rfunc .*hotspot.* > residual.bc
llc -filetype=obj residual.bc > residual.o
llc -filetype=obj hotspot.bc > hotspot.o
cc -o app residual.o hotspot.o
```

Reviewed By: davide
Differential Revision: https://reviews.llvm.org/D31722

llvm-svn: 299706
llvm/test/tools/llvm-extract/recursive.ll [new file with mode: 0644]
llvm/tools/llvm-extract/llvm-extract.cpp