using std::vector;
using std::ostream;
-static RegisterPass<PrintModulePass> X("printm", "Print module to stderr");
-static RegisterPass<PrintFunctionPass> Y("print", "Print function to stderr");
+static RegisterPass<PrintModulePass>
+X("printm", "Print module to stderr",PassInfo::Analysis|PassInfo::Optimization);
+static RegisterPass<PrintFunctionPass>
+Y("print","Print function to stderr",PassInfo::Analysis|PassInfo::Optimization);
static void WriteAsOperandInternal(ostream &Out, const Value *V, bool PrintName,
map<const Type *, string> &TypeTable,
(unsigned char)cast<ConstantSInt>(CA->getOperand(i))->getValue() :
(unsigned char)cast<ConstantUInt>(CA->getOperand(i))->getValue();
- if (isprint(C) && C != '"') {
+ if (isprint(C) && C != '"' && C != '\\') {
Out << C;
} else {
Out << '\\'
Out << "<pointer reference without context info>";
}
- } else if (const ConstantExpr *CE=dyn_cast<ConstantExpr>(CV)) {
+ } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
Out << CE->getOpcodeName();
bool isGEP = CE->getOpcode() == Instruction::GetElementPtr;
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)
//
if (RetTy && MTy && !MTy->isVarArg() &&
(!isa<PointerType>(RetTy) ||
- !isa<FunctionType>(cast<PointerType>(RetTy)))) {
+ !isa<FunctionType>(cast<PointerType>(RetTy)->getElementType()))) {
Out << " "; printType(RetTy);
writeOperand(Operand, false);
} else {