Skip to content

Commit

Permalink
Auto merge of #31838 - aochagavia:trans, r=nrc
Browse files Browse the repository at this point in the history
Refactor rustc_trans::save to allow other backends than CSV

r? @nrc

Things done:
* Moved `(.*)Data` structs to an own module, so they can be imported easily (`use data::*`).
* Created a `Dump` trait with callbacks for dumping items.
* Refactored `DumpCsvVisitor` to use an implementor of `Dump` instead of dumping as CSV. Renamed it to `DumpVisitor`.
* Created a `DumpCsv` struct that implements `Dump` and serializes items as CSV.

I tried to extract some of the logic contained in `FmtStr` and `Recorder`, such as normalization of ids (I put it in `DumpVisitor`). I think it makes sense to provide the same information to other implementors of `Dump`, instead of normalizing only for `DumpCsv`. However, there is still some logic related to spans implemented only for `DumpCsv`. I just thought it would be better to merge this as soon as possible, since there are so much changes, and fix this afterwards.
  • Loading branch information
bors committed Mar 15, 2016
2 parents 74dfc1d + 67395d8 commit c66d238
Show file tree
Hide file tree
Showing 6 changed files with 1,459 additions and 1,153 deletions.
Loading

0 comments on commit c66d238

Please sign in to comment.