Backslash is a special character according to JSON specification, so we should avoid that when printing a file path with the --statistics option.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
tools/llvm-dwarfdump/Statistics.cpp | ||
---|---|---|
552 ↗ | (On Diff #220633) | I think '\' needs to be converted to '\\'. Consider using llvm's json::Value(Filename), which should quote things correctly? I believe that can be passed to ostream directly, so you could templat-ize printDatum (getting rid of one of its duplicate definitions) and just pass the Filename json::Value in. |
tools/llvm-dwarfdump/Statistics.cpp | ||
---|---|---|
552 ↗ | (On Diff #220633) | Hmm... I didn't find any spec that says what is the desirable char in that case, but you are right. We can just pass this as a json::Value and it should know how to print that (it actually converts it into '\\'). Thanks! :) |
Comment Actions
lgtm, I believe the original llvm-locstats can now land unmodified, which should provide test coverage.