Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: tools/pnacl-bcanalyzer/pnacl-bcanalyzer.cpp

Issue 14813032: Make abbreviations explicit in pnacl-freeze/thaw. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Fix typos in CL Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/pnacl-bcanalyzer/pnacl-bcanalyzer.cpp
diff --git a/tools/pnacl-bcanalyzer/pnacl-bcanalyzer.cpp b/tools/pnacl-bcanalyzer/pnacl-bcanalyzer.cpp
index 7c542d79aea1f3b722db112b91008aecb3b76a69..76fe404bfd63c1c22c2c0799659d8edfe41a5593 100644
--- a/tools/pnacl-bcanalyzer/pnacl-bcanalyzer.cpp
+++ b/tools/pnacl-bcanalyzer/pnacl-bcanalyzer.cpp
@@ -45,6 +45,11 @@
#include <map>
using namespace llvm;
+/* To turn on debugging for this file, change value of NACL_DEBUGGING to 1.
+ */
+#define NACL_DEBUGGING 0
+#include "llvm/Bitcode/NaCl/NaClDebugging.h"
+
static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
@@ -325,6 +330,7 @@ static bool Error(const std::string &Err) {
static bool ParseBlock(NaClBitstreamCursor &Stream, unsigned BlockID,
unsigned IndentLevel) {
std::string Indent(IndentLevel*2, ' ');
+ NACL_DEBUG(outs() << Indent << "-> ParseBlock(" << BlockID << ")\n");
jvoung (off chromium) 2013/05/14 23:47:14 Not sure you want to use "outs()" since that will
Karl 2013/05/17 20:52:18 Fixing to use llvm debug.h
uint64_t BlockBitStart = Stream.GetCurrentBitNo();
// Get the statistics for this BlockID.
@@ -339,6 +345,7 @@ static bool ParseBlock(NaClBitstreamCursor &Stream, unsigned BlockID,
return Error("Malformed BlockInfoBlock");
uint64_t BlockBitEnd = Stream.GetCurrentBitNo();
BlockStats.NumBits += BlockBitEnd-BlockBitStart;
+ NACL_DEBUG(outs() << Indent << "<- ParseBlock\n");
return false;
}
@@ -386,6 +393,7 @@ static bool ParseBlock(NaClBitstreamCursor &Stream, unsigned BlockID,
else
outs() << "UnknownBlock" << BlockID << ">\n";
}
+ NACL_DEBUG(outs() << Indent << "<- ParseBlock\n");
return false;
}
@@ -478,6 +486,7 @@ static void PrintSize(uint64_t Bits) {
/// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
static int AnalyzeBitcode() {
+ NACL_DEBUG(outs() << "-> AnalyzeBitcode\n");
// Read the input file.
OwningPtr<MemoryBuffer> MemBuf;
@@ -620,6 +629,7 @@ static int AnalyzeBitcode() {
}
}
+ NACL_DEBUG(outs() << "<- AnalyzeBitcode\n");
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698