Bug 198977

Summary: [sparse-llvm] Add option to save output to a named file
Product: Tools Reporter: Dibyendu Majumdar (mobile)
Component: SparseAssignee: Tools-Sparse Virtual Assignee (tools_sparse)
Status: CLOSED CODE_FIX    
Severity: enhancement CC: luc.vanoostenryck, rdunlap
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: N/A Subsystem:
Regression: No Bisected commit-id:

Description Dibyendu Majumdar 2018-03-03 01:36:02 UTC
Currently Sparse-LLVM outputs the generated LLVM bitcode file to stdout. While this works, it means that a) users cannot just run sparse-llvm and get any meaningful help on stdout - instead you get lot of gibberish, and b) it is somewhat unusual behaviour for a 'compiler'. 

I suggest adding a -o option to output to a named file. Additionally keeping with most compiler behaviour, if no option is specified, create 'out.bc' file instead of writing to stdout.

I can submit patches for this if there is agreement on the approach. Please give feedback or let me know if you approve / disapprove.
Comment 1 Randy Dunlap 2018-03-07 17:44:32 UTC
Sounds like a good improvement to me.