Backslash is a special character according to JSON specification, so we should avoid that when printing a file path with the --statistics option.
Details
Diff Detail
Event Timeline
tools/llvm-dwarfdump/Statistics.cpp | ||
---|---|---|
549 | 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 | ||
---|---|---|
549 | 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! :) |
lgtm, I believe the original llvm-locstats can now land unmodified, which should provide test coverage.
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.