diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-22 13:30:27 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-22 13:30:27 -0800 |
commit | 0f11f18845d804425fb3b0858057e367ea349da8 (patch) | |
tree | 5ad5532a3801a5290b51af7a0b1ae4d503e6a859 /lib/Target/CppBackend/CPPBackend.cpp | |
parent | 3d306e31d904a7dea13d757798ad064f794550e2 (diff) |
more debug info
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index c078adacef..73c9c220c2 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -38,7 +38,8 @@ #include <set> using namespace llvm; -#define dump(x, ...) fprintf(stderr, x "\n", __VA_ARGS__) +#define dump(x) fprintf(stderr, x "\n") +#define dumpv(x, ...) fprintf(stderr, x "\n", __VA_ARGS__) #define dumpfail(x) { fprintf(stderr, x "\n"); report_fatal_error("fail"); } #define dumpfailv(x, ...) { fprintf(stderr, x "\n", __VA_ARGS__); report_fatal_error("fail"); } @@ -1153,8 +1154,6 @@ std::string CppWriter::getValueAsParenStr(const Value* V) { // generateInstruction - This member is called for each Instruction in a function. std::string CppWriter::generateInstruction(const Instruction *I) { - dump("generating instruction %s\n", std::string(I->getOpcodeName()).c_str()); - std::string text = "NYI: " + std::string(I->getOpcodeName()); std::string bbname = "NO_BBNAME"; std::string iName(getCppName(I)); @@ -1163,8 +1162,12 @@ std::string CppWriter::generateInstruction(const Instruction *I) { // forward references. So, we get the names of all the operands in advance const unsigned Ops(I->getNumOperands()); std::string* opNames = new std::string[Ops]; - for (unsigned i = 0; i < Ops; i++) + dumpv("Generating instruction %s = %s (%d operands)", iName.c_str(), std::string(I->getOpcodeName()).c_str(), Ops); + + for (unsigned i = 0; i < Ops; i++) { opNames[i] = getOpName(I->getOperand(i)); + dumpv(" op %d: %s", i, opNames[i].c_str()); + } switch (I->getOpcode()) { default: |