[PATCH] D26477: Try to make ScopedPrinter use the new binary blob formatter

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 11:12:43 PST 2016


clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good.



================
Comment at: lib/Support/raw_ostream.cpp:355
 
-raw_ostream &raw_ostream::operator<<(const FormattedHexBytes &FB) {
+raw_ostream &raw_ostream::operator<<(const FormattedBytes &FB) {
+  if (FB.Bytes.empty())
----------------
One thing that I was wondering is can we add an operator to the FormattedBytes class:

```
class FormattedBytes {
public:
    raw_ostream &operator<<(raw_ostream &s);
};
```

And avoid this code being in raw_ostream.cpp? Seems wrong to put the implementation for dumping FormattedBytes into raw_ostream.cpp. Doesn't need to be done with this patch, but I found this not to be very C++.



https://reviews.llvm.org/D26477





More information about the llvm-commits mailing list