X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FAsmWriter.cpp;h=8c7b06ba0f17f264409a724303051e88e1dc959f;hb=61b91bc156bb9e3d9017a9e93d567f8dccfa3f68;hp=c1af5e4c8567b98cf6a504062140abfe1821a5e3;hpb=a6275ccdf5e1aa208afde56c498e2b13e16442f0;p=oota-llvm.git diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index c1af5e4c856..8c7b06ba0f1 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -21,6 +21,7 @@ #include "llvm/iPHINode.h" #include "llvm/iOther.h" #include "llvm/SymbolTable.h" +#include "llvm/Support/CFG.h" #include "Support/StringExtras.h" #include "Support/STLExtras.h" #include @@ -271,7 +272,7 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName, (unsigned char)cast(CA->getOperand(i))->getValue() : (unsigned char)cast(CA->getOperand(i))->getValue(); - if (isprint(C) && C != '"') { + if (isprint(C) && C != '"' && C != '\\') { Out << C; } else { Out << '\\' @@ -333,21 +334,25 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName, Out << ""; } - } else if (const ConstantExpr *CE=dyn_cast(CV)) { + } else if (const ConstantExpr *CE = dyn_cast(CV)) { Out << CE->getOpcodeName(); bool isGEP = CE->getOpcode() == Instruction::GetElementPtr; - Out << (isGEP? " (" : " "); + Out << " ("; for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) { printTypeInt(Out, (*OI)->getType(), TypeTable); WriteAsOperandInternal(Out, *OI, PrintName, TypeTable, Table); if (OI+1 != CE->op_end()) - Out << ", "; // ((isGEP && OI == CE->op_begin())? " " : ", "); + Out << ", "; } - if (isGEP) - Out << ")"; + if (CE->getOpcode() == Instruction::Cast) { + Out << " to "; + printTypeInt(Out, CE->getType(), TypeTable); + } + Out << ")"; + } else { Out << ""; } @@ -657,8 +662,7 @@ void AssemblyWriter::printArgument(const Argument *Arg) { // void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { if (BB->hasName()) { // Print out the label if it exists... - Out << "\n" << BB->getName() << ":\t\t\t\t\t;[#uses=" - << BB->use_size() << "]"; // Output # uses + Out << "\n" << BB->getName() << ":"; } else if (!BB->use_empty()) { // Don't print block # of no uses... int Slot = Table.getValSlot(BB); Out << "\n;