summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-09-20 09:25:11 +0000
committerDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-09-20 09:25:11 +0000
commit9120829063de1885b88a1e274e17026552bbab68 (patch)
tree1c3acce3ccd364341d29f77bf18a142f13c49dd8 /llvm
parent4d69967f44116b4ad4b2810633045ffed119f7c3 (diff)
downloadbcm5719-llvm-9120829063de1885b88a1e274e17026552bbab68.tar.gz
bcm5719-llvm-9120829063de1885b88a1e274e17026552bbab68.zip
[llvm-dwarfdump] Adjust Windows path to be acceptable by JSON
Backslash is a special character according to JSON specification, so we should avoid that when printing a file path with the --statistics option. Differential Revision: https://reviews.llvm.org/D67699 llvm-svn: 372378
Diffstat (limited to 'llvm')
-rw-r--r--llvm/tools/llvm-dwarfdump/Statistics.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp
index 268ab5f79b6..d6bf02b69d1 100644
--- a/llvm/tools/llvm-dwarfdump/Statistics.cpp
+++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp
@@ -5,6 +5,7 @@
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
#include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/JSON.h"
#define DEBUG_TYPE "dwarfdump"
using namespace llvm;
@@ -92,11 +93,11 @@ struct GlobalStats {
unsigned CallSiteParamDIEs = 0;
/// Total byte size of concrete functions. This byte size includes
/// inline functions contained in the concrete functions.
- uint64_t FunctionSize = 0;
+ unsigned FunctionSize = 0;
/// Total byte size of inlined functions. This is the total number of bytes
/// for the top inline functions within concrete functions. This can help
/// tune the inline settings when compiling to match user expectations.
- uint64_t InlineFunctionSize = 0;
+ unsigned InlineFunctionSize = 0;
};
/// Holds accumulated debug location statistics about local variables and
@@ -449,11 +450,7 @@ static void collectStatsRecursive(DWARFDie Die, uint64_t UnitLowPC, std::string
/// Print machine-readable output.
/// The machine-readable format is single-line JSON output.
/// \{
-static void printDatum(raw_ostream &OS, const char *Key, StringRef Value) {
- OS << ",\"" << Key << "\":\"" << Value << '"';
- LLVM_DEBUG(llvm::dbgs() << Key << ": " << Value << '\n');
-}
-static void printDatum(raw_ostream &OS, const char *Key, uint64_t Value) {
+static void printDatum(raw_ostream &OS, const char *Key, json::Value Value) {
OS << ",\"" << Key << "\":" << Value;
LLVM_DEBUG(llvm::dbgs() << Key << ": " << Value << '\n');
}
OpenPOWER on IntegriCloud