// Check to see if the type is named.
if (!IgnoreName || isa<OpaqueType>(Ty)) {
std::map<const Type *, std::string>::iterator I = TypeNames.find(Ty);
- if (I != TypeNames.end()) return Out << I->second << " " << NameSoFar;
+ if (I != TypeNames.end()) return Out << I->second << ' ' << NameSoFar;
}
switch (Ty->getTypeID()) {
} else if (!MTy->getNumParams()) {
FunctionInnards << "void";
}
- FunctionInnards << ")";
+ FunctionInnards << ')';
std::string tstr = FunctionInnards.str();
printType(Out, MTy->getReturnType(), tstr);
return Out;
printType(Out, *I, "field" + utostr(Idx++));
Out << ";\n";
}
- return Out << "}";
+ return Out << '}';
}
case Type::PointerTyID: {
std::string TyName = "struct opaque_" + itostr(Count++);
assert(TypeNames.find(Ty) == TypeNames.end());
TypeNames[Ty] = TyName;
- return Out << TyName << " " << NameSoFar;
+ return Out << TyName << ' ' << NameSoFar;
}
default:
assert(0 && "Unhandled case in getTypeProps!");
isString = false;
if (isString) {
- Out << "\"";
+ Out << '\"';
// Keep track of whether the last number was a hexadecimal escape
bool LastWasHex = false;
}
}
}
- Out << "\"";
+ Out << '\"';
} else {
- Out << "{";
+ Out << '{';
if (CPA->getNumOperands()) {
- Out << " ";
+ Out << ' ';
printConstant(cast<Constant>(CPA->getOperand(0)));
for (unsigned i = 1, e = CPA->getNumOperands(); i != e; ++i) {
Out << ", ";
case Instruction::Cast:
Out << "((";
printType(Out, CPV->getType());
- Out << ")";
+ Out << ')';
printConstant(CE->getOperand(0));
- Out << ")";
+ Out << ')';
return;
case Instruction::GetElementPtr:
Out << "))";
return;
case Instruction::Select:
- Out << "(";
+ Out << '(';
printConstant(CE->getOperand(0));
- Out << "?";
+ Out << '?';
printConstant(CE->getOperand(1));
- Out << ":";
+ Out << ':';
printConstant(CE->getOperand(2));
- Out << ")";
+ Out << ')';
return;
case Instruction::Add:
case Instruction::Sub:
case Instruction::SetGE:
case Instruction::Shl:
case Instruction::Shr:
- Out << "(";
+ Out << '(';
printConstant(CE->getOperand(0));
switch (CE->getOpcode()) {
case Instruction::Add: Out << " + "; break;
default: assert(0 && "Illegal opcode here!");
}
printConstant(CE->getOperand(1));
- Out << ")";
+ Out << ')';
return;
default:
switch (CPV->getType()->getTypeID()) {
case Type::BoolTyID:
- Out << (CPV == ConstantBool::False ? "0" : "1"); break;
+ Out << (CPV == ConstantBool::False ? '0' : '1'); break;
case Type::SByteTyID:
case Type::ShortTyID:
Out << cast<ConstantSInt>(CPV)->getValue(); break;
case Type::UShortTyID:
Out << cast<ConstantUInt>(CPV)->getValue(); break;
case Type::UIntTyID:
- Out << cast<ConstantUInt>(CPV)->getValue() << "u"; break;
+ Out << cast<ConstantUInt>(CPV)->getValue() << 'u'; break;
case Type::ULongTyID:
Out << cast<ConstantUInt>(CPV)->getValue() << "ull"; break;
// Because of FP precision problems we must load from a stack allocated
// value that holds the value in hex.
Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double")
- << "*)&FPConstant" << I->second << ")";
+ << "*)&FPConstant" << I->second << ')';
} else {
if (IsNAN(FPC->getValue())) {
// The value is NaN
<< Buffer << "\") /*nan*/ ";
} else if (IsInf(FPC->getValue())) {
// The value is Inf
- if (FPC->getValue() < 0) Out << "-";
+ if (FPC->getValue() < 0) Out << '-';
Out << "LLVM_INF" << (FPC->getType() == Type::FloatTy ? "F" : "")
<< " /*inf*/ ";
} else {
case Type::ArrayTyID:
if (isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV)) {
const ArrayType *AT = cast<ArrayType>(CPV->getType());
- Out << "{";
+ Out << '{';
if (AT->getNumElements()) {
- Out << " ";
+ Out << ' ';
Constant *CZ = Constant::getNullValue(AT->getElementType());
printConstant(CZ);
for (unsigned i = 1, e = AT->getNumElements(); i != e; ++i) {
case Type::StructTyID:
if (isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV)) {
const StructType *ST = cast<StructType>(CPV->getType());
- Out << "{";
+ Out << '{';
if (ST->getNumElements()) {
- Out << " ";
+ Out << ' ';
printConstant(Constant::getNullValue(ST->getElementType(0)));
for (unsigned i = 1, e = ST->getNumElements(); i != e; ++i) {
Out << ", ";
}
Out << " }";
} else {
- Out << "{";
+ Out << '{';
if (CPV->getNumOperands()) {
- Out << " ";
+ Out << ' ';
printConstant(cast<Constant>(CPV->getOperand(0)));
for (unsigned i = 1, e = CPV->getNumOperands(); i != e; ++i) {
Out << ", ";
if (Instruction *I = dyn_cast<Instruction>(Operand))
if (isInlinableInst(*I) && !isDirectAlloca(I)) {
// Should we inline this instruction to build a tree?
- Out << "(";
+ Out << '(';
visit(*I);
- Out << ")";
+ Out << ')';
return;
}
writeOperandInternal(Operand);
if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
- Out << ")";
+ Out << ')';
}
// generateCompilerSpecificCode - This is where we add conditional compilation
assert(0 && "Unknown float type!");
}
- Out << "\n";
+ Out << '\n';
}
TypeNames.insert(std::make_pair(STy, Name));
}
- Out << "\n";
+ Out << '\n';
// Now we can print out typedefs...
Out << "/* Typedefs */\n";
Out << ";\n";
}
- Out << "\n";
+ Out << '\n';
// Keep track of which structures have been printed so far...
std::set<const StructType *> StructPrinted;
std::stringstream FunctionInnards;
// Print out the name...
- FunctionInnards << Mang->getValueName(F) << "(";
+ FunctionInnards << Mang->getValueName(F) << '(';
if (!F->isExternal()) {
if (!F->aempty()) {
} else if (!FT->isVarArg() && FT->getNumParams() == 0) {
FunctionInnards << "void"; // ret() -> ret(void) in C.
}
- FunctionInnards << ")";
+ FunctionInnards << ')';
// Print out the return type and the entire signature for that matter
printType(Out, F->getReturnType(), FunctionInnards.str());
}
}
}
- Out << "\n";
+ Out << '\n';
if (F.hasExternalLinkage() && F.getName() == "main")
printCodeForMain();
Out << " return";
if (I.getNumOperands()) {
- Out << " ";
+ Out << ' ';
writeOperand(I.getOperand(0));
}
Out << ";\n";
switch (I.getOpcode()) {
case Instruction::Add: Out << " + "; break;
case Instruction::Sub: Out << " - "; break;
- case Instruction::Mul: Out << "*"; break;
- case Instruction::Div: Out << "/"; break;
- case Instruction::Rem: Out << "%"; break;
+ case Instruction::Mul: Out << '*'; break;
+ case Instruction::Div: Out << '/'; break;
+ case Instruction::Rem: Out << '%'; break;
case Instruction::And: Out << " & "; break;
case Instruction::Or: Out << " | "; break;
case Instruction::Xor: Out << " ^ "; break;
void CWriter::visitCastInst(CastInst &I) {
if (I.getType() == Type::BoolTy) {
- Out << "(";
+ Out << '(';
writeOperand(I.getOperand(0));
Out << " != 0)";
return;
}
- Out << "(";
+ Out << '(';
printType(Out, I.getType());
- Out << ")";
+ Out << ')';
if (isa<PointerType>(I.getType())&&I.getOperand(0)->getType()->isIntegral() ||
isa<PointerType>(I.getOperand(0)->getType())&&I.getType()->isIntegral()) {
// Avoid "cast to pointer from integer of different size" warnings
abort();
}
writeOperand(&I.getParent()->getParent()->aback());
- Out << ")";
+ Out << ')';
return;
case Intrinsic::vaend:
if (!isa<ConstantPointerNull>(I.getOperand(1))) {
Out << "va_end(*(va_list*)&";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
} else {
Out << "va_end(*(va_list*)0)";
}
Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", ";
Out << "*(va_list*)&";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::returnaddress:
Out << "__builtin_return_address(";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::frameaddress:
Out << "__builtin_frame_address(";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::setjmp:
Out << "setjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::longjmp:
Out << "longjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
Out << ", ";
writeOperand(I.getOperand(2));
- Out << ")";
+ Out << ')';
return;
}
}
printType(Out, CE->getType());
Out << ")(void*)";
printConstant(RF);
- Out << ")";
+ Out << ')';
WroteCallee = true;
}
}
const Type *RetTy = FTy->getReturnType();
if (!WroteCallee) writeOperand(Callee);
- Out << "(";
+ Out << '(';
unsigned NumDeclaredParams = FTy->getNumParams();
if (I.getNumOperands() != 1) {
CallSite::arg_iterator AI = I.op_begin()+1, AE = I.op_end();
if (NumDeclaredParams && (*AI)->getType() != FTy->getParamType(0)) {
- Out << "(";
+ Out << '(';
printType(Out, FTy->getParamType(0));
- Out << ")";
+ Out << ')';
}
writeOperand(*AI);
Out << ", ";
if (ArgNo < NumDeclaredParams &&
(*AI)->getType() != FTy->getParamType(ArgNo)) {
- Out << "(";
+ Out << '(';
printType(Out, FTy->getParamType(ArgNo));
- Out << ")";
+ Out << ')';
}
writeOperand(*AI);
}
}
- Out << ")";
+ Out << ')';
}
void CWriter::visitMallocInst(MallocInst &I) {
}
void CWriter::visitAllocaInst(AllocaInst &I) {
- Out << "(";
+ Out << '(';
printType(Out, I.getType());
Out << ") alloca(sizeof(";
printType(Out, I.getType()->getElementType());
- Out << ")";
+ Out << ')';
if (I.isArrayAllocation()) {
Out << " * " ;
writeOperand(I.getOperand(0));
}
- Out << ")";
+ Out << ')';
}
void CWriter::visitFreeInst(FreeInst &I) {
if (I == E) {
if (!HasImplicitAddress)
- Out << "*"; // Implicit zero first argument: '*x' is equivalent to 'x[0]'
+ Out << '*'; // Implicit zero first argument: '*x' is equivalent to 'x[0]'
writeOperandInternal(Ptr);
return;
writeOperandInternal(Ptr);
if (HasImplicitAddress && (!CI || !CI->isNullValue())) {
- Out << ")";
+ Out << ')';
HasImplicitAddress = false; // HIA is only true if we haven't addressed yet
}
if (isa<StructType>(*I)) {
Out << ".field" << cast<ConstantUInt>(I.getOperand())->getValue();
} else {
- Out << "[";
+ Out << '[';
writeOperand(I.getOperand());
- Out << "]";
+ Out << ']';
}
}
void CWriter::visitLoadInst(LoadInst &I) {
- Out << "*";
+ Out << '*';
if (I.isVolatile()) {
Out << "((volatile ";
printType(Out, I.getOperand(0)->getType());
}
void CWriter::visitStoreInst(StoreInst &I) {
- Out << "*";
+ Out << '*';
if (I.isVolatile()) {
Out << "((volatile ";
printType(Out, I.getPointerOperand()->getType());
}
void CWriter::visitGetElementPtrInst(GetElementPtrInst &I) {
- Out << "&";
+ Out << '&';
printIndexingExpression(I.getPointerOperand(), gep_type_begin(I),
gep_type_end(I));
}
Out << Mang->getValueName(I.getOperand(0));
Out << "; va_arg(*(va_list*)&" << Mang->getValueName(&I) << ", ";
printType(Out, I.getArgType());
- Out << ")";
+ Out << ')';
}
void CWriter::visitVAArgInst(VAArgInst &I) {
// Check to see if the type is named.
if (!IgnoreName || isa<OpaqueType>(Ty)) {
std::map<const Type *, std::string>::iterator I = TypeNames.find(Ty);
- if (I != TypeNames.end()) return Out << I->second << " " << NameSoFar;
+ if (I != TypeNames.end()) return Out << I->second << ' ' << NameSoFar;
}
switch (Ty->getTypeID()) {
} else if (!MTy->getNumParams()) {
FunctionInnards << "void";
}
- FunctionInnards << ")";
+ FunctionInnards << ')';
std::string tstr = FunctionInnards.str();
printType(Out, MTy->getReturnType(), tstr);
return Out;
printType(Out, *I, "field" + utostr(Idx++));
Out << ";\n";
}
- return Out << "}";
+ return Out << '}';
}
case Type::PointerTyID: {
std::string TyName = "struct opaque_" + itostr(Count++);
assert(TypeNames.find(Ty) == TypeNames.end());
TypeNames[Ty] = TyName;
- return Out << TyName << " " << NameSoFar;
+ return Out << TyName << ' ' << NameSoFar;
}
default:
assert(0 && "Unhandled case in getTypeProps!");
isString = false;
if (isString) {
- Out << "\"";
+ Out << '\"';
// Keep track of whether the last number was a hexadecimal escape
bool LastWasHex = false;
}
}
}
- Out << "\"";
+ Out << '\"';
} else {
- Out << "{";
+ Out << '{';
if (CPA->getNumOperands()) {
- Out << " ";
+ Out << ' ';
printConstant(cast<Constant>(CPA->getOperand(0)));
for (unsigned i = 1, e = CPA->getNumOperands(); i != e; ++i) {
Out << ", ";
case Instruction::Cast:
Out << "((";
printType(Out, CPV->getType());
- Out << ")";
+ Out << ')';
printConstant(CE->getOperand(0));
- Out << ")";
+ Out << ')';
return;
case Instruction::GetElementPtr:
Out << "))";
return;
case Instruction::Select:
- Out << "(";
+ Out << '(';
printConstant(CE->getOperand(0));
- Out << "?";
+ Out << '?';
printConstant(CE->getOperand(1));
- Out << ":";
+ Out << ':';
printConstant(CE->getOperand(2));
- Out << ")";
+ Out << ')';
return;
case Instruction::Add:
case Instruction::Sub:
case Instruction::SetGE:
case Instruction::Shl:
case Instruction::Shr:
- Out << "(";
+ Out << '(';
printConstant(CE->getOperand(0));
switch (CE->getOpcode()) {
case Instruction::Add: Out << " + "; break;
default: assert(0 && "Illegal opcode here!");
}
printConstant(CE->getOperand(1));
- Out << ")";
+ Out << ')';
return;
default:
switch (CPV->getType()->getTypeID()) {
case Type::BoolTyID:
- Out << (CPV == ConstantBool::False ? "0" : "1"); break;
+ Out << (CPV == ConstantBool::False ? '0' : '1'); break;
case Type::SByteTyID:
case Type::ShortTyID:
Out << cast<ConstantSInt>(CPV)->getValue(); break;
case Type::UShortTyID:
Out << cast<ConstantUInt>(CPV)->getValue(); break;
case Type::UIntTyID:
- Out << cast<ConstantUInt>(CPV)->getValue() << "u"; break;
+ Out << cast<ConstantUInt>(CPV)->getValue() << 'u'; break;
case Type::ULongTyID:
Out << cast<ConstantUInt>(CPV)->getValue() << "ull"; break;
// Because of FP precision problems we must load from a stack allocated
// value that holds the value in hex.
Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double")
- << "*)&FPConstant" << I->second << ")";
+ << "*)&FPConstant" << I->second << ')';
} else {
if (IsNAN(FPC->getValue())) {
// The value is NaN
<< Buffer << "\") /*nan*/ ";
} else if (IsInf(FPC->getValue())) {
// The value is Inf
- if (FPC->getValue() < 0) Out << "-";
+ if (FPC->getValue() < 0) Out << '-';
Out << "LLVM_INF" << (FPC->getType() == Type::FloatTy ? "F" : "")
<< " /*inf*/ ";
} else {
case Type::ArrayTyID:
if (isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV)) {
const ArrayType *AT = cast<ArrayType>(CPV->getType());
- Out << "{";
+ Out << '{';
if (AT->getNumElements()) {
- Out << " ";
+ Out << ' ';
Constant *CZ = Constant::getNullValue(AT->getElementType());
printConstant(CZ);
for (unsigned i = 1, e = AT->getNumElements(); i != e; ++i) {
case Type::StructTyID:
if (isa<ConstantAggregateZero>(CPV) || isa<UndefValue>(CPV)) {
const StructType *ST = cast<StructType>(CPV->getType());
- Out << "{";
+ Out << '{';
if (ST->getNumElements()) {
- Out << " ";
+ Out << ' ';
printConstant(Constant::getNullValue(ST->getElementType(0)));
for (unsigned i = 1, e = ST->getNumElements(); i != e; ++i) {
Out << ", ";
}
Out << " }";
} else {
- Out << "{";
+ Out << '{';
if (CPV->getNumOperands()) {
- Out << " ";
+ Out << ' ';
printConstant(cast<Constant>(CPV->getOperand(0)));
for (unsigned i = 1, e = CPV->getNumOperands(); i != e; ++i) {
Out << ", ";
if (Instruction *I = dyn_cast<Instruction>(Operand))
if (isInlinableInst(*I) && !isDirectAlloca(I)) {
// Should we inline this instruction to build a tree?
- Out << "(";
+ Out << '(';
visit(*I);
- Out << ")";
+ Out << ')';
return;
}
writeOperandInternal(Operand);
if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
- Out << ")";
+ Out << ')';
}
// generateCompilerSpecificCode - This is where we add conditional compilation
assert(0 && "Unknown float type!");
}
- Out << "\n";
+ Out << '\n';
}
TypeNames.insert(std::make_pair(STy, Name));
}
- Out << "\n";
+ Out << '\n';
// Now we can print out typedefs...
Out << "/* Typedefs */\n";
Out << ";\n";
}
- Out << "\n";
+ Out << '\n';
// Keep track of which structures have been printed so far...
std::set<const StructType *> StructPrinted;
std::stringstream FunctionInnards;
// Print out the name...
- FunctionInnards << Mang->getValueName(F) << "(";
+ FunctionInnards << Mang->getValueName(F) << '(';
if (!F->isExternal()) {
if (!F->aempty()) {
} else if (!FT->isVarArg() && FT->getNumParams() == 0) {
FunctionInnards << "void"; // ret() -> ret(void) in C.
}
- FunctionInnards << ")";
+ FunctionInnards << ')';
// Print out the return type and the entire signature for that matter
printType(Out, F->getReturnType(), FunctionInnards.str());
}
}
}
- Out << "\n";
+ Out << '\n';
if (F.hasExternalLinkage() && F.getName() == "main")
printCodeForMain();
Out << " return";
if (I.getNumOperands()) {
- Out << " ";
+ Out << ' ';
writeOperand(I.getOperand(0));
}
Out << ";\n";
switch (I.getOpcode()) {
case Instruction::Add: Out << " + "; break;
case Instruction::Sub: Out << " - "; break;
- case Instruction::Mul: Out << "*"; break;
- case Instruction::Div: Out << "/"; break;
- case Instruction::Rem: Out << "%"; break;
+ case Instruction::Mul: Out << '*'; break;
+ case Instruction::Div: Out << '/'; break;
+ case Instruction::Rem: Out << '%'; break;
case Instruction::And: Out << " & "; break;
case Instruction::Or: Out << " | "; break;
case Instruction::Xor: Out << " ^ "; break;
void CWriter::visitCastInst(CastInst &I) {
if (I.getType() == Type::BoolTy) {
- Out << "(";
+ Out << '(';
writeOperand(I.getOperand(0));
Out << " != 0)";
return;
}
- Out << "(";
+ Out << '(';
printType(Out, I.getType());
- Out << ")";
+ Out << ')';
if (isa<PointerType>(I.getType())&&I.getOperand(0)->getType()->isIntegral() ||
isa<PointerType>(I.getOperand(0)->getType())&&I.getType()->isIntegral()) {
// Avoid "cast to pointer from integer of different size" warnings
abort();
}
writeOperand(&I.getParent()->getParent()->aback());
- Out << ")";
+ Out << ')';
return;
case Intrinsic::vaend:
if (!isa<ConstantPointerNull>(I.getOperand(1))) {
Out << "va_end(*(va_list*)&";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
} else {
Out << "va_end(*(va_list*)0)";
}
Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", ";
Out << "*(va_list*)&";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::returnaddress:
Out << "__builtin_return_address(";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::frameaddress:
Out << "__builtin_frame_address(";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::setjmp:
Out << "setjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
- Out << ")";
+ Out << ')';
return;
case Intrinsic::longjmp:
Out << "longjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
Out << ", ";
writeOperand(I.getOperand(2));
- Out << ")";
+ Out << ')';
return;
}
}
printType(Out, CE->getType());
Out << ")(void*)";
printConstant(RF);
- Out << ")";
+ Out << ')';
WroteCallee = true;
}
}
const Type *RetTy = FTy->getReturnType();
if (!WroteCallee) writeOperand(Callee);
- Out << "(";
+ Out << '(';
unsigned NumDeclaredParams = FTy->getNumParams();
if (I.getNumOperands() != 1) {
CallSite::arg_iterator AI = I.op_begin()+1, AE = I.op_end();
if (NumDeclaredParams && (*AI)->getType() != FTy->getParamType(0)) {
- Out << "(";
+ Out << '(';
printType(Out, FTy->getParamType(0));
- Out << ")";
+ Out << ')';
}
writeOperand(*AI);
Out << ", ";
if (ArgNo < NumDeclaredParams &&
(*AI)->getType() != FTy->getParamType(ArgNo)) {
- Out << "(";
+ Out << '(';
printType(Out, FTy->getParamType(ArgNo));
- Out << ")";
+ Out << ')';
}
writeOperand(*AI);
}
}
- Out << ")";
+ Out << ')';
}
void CWriter::visitMallocInst(MallocInst &I) {
}
void CWriter::visitAllocaInst(AllocaInst &I) {
- Out << "(";
+ Out << '(';
printType(Out, I.getType());
Out << ") alloca(sizeof(";
printType(Out, I.getType()->getElementType());
- Out << ")";
+ Out << ')';
if (I.isArrayAllocation()) {
Out << " * " ;
writeOperand(I.getOperand(0));
}
- Out << ")";
+ Out << ')';
}
void CWriter::visitFreeInst(FreeInst &I) {
if (I == E) {
if (!HasImplicitAddress)
- Out << "*"; // Implicit zero first argument: '*x' is equivalent to 'x[0]'
+ Out << '*'; // Implicit zero first argument: '*x' is equivalent to 'x[0]'
writeOperandInternal(Ptr);
return;
writeOperandInternal(Ptr);
if (HasImplicitAddress && (!CI || !CI->isNullValue())) {
- Out << ")";
+ Out << ')';
HasImplicitAddress = false; // HIA is only true if we haven't addressed yet
}
if (isa<StructType>(*I)) {
Out << ".field" << cast<ConstantUInt>(I.getOperand())->getValue();
} else {
- Out << "[";
+ Out << '[';
writeOperand(I.getOperand());
- Out << "]";
+ Out << ']';
}
}
void CWriter::visitLoadInst(LoadInst &I) {
- Out << "*";
+ Out << '*';
if (I.isVolatile()) {
Out << "((volatile ";
printType(Out, I.getOperand(0)->getType());
}
void CWriter::visitStoreInst(StoreInst &I) {
- Out << "*";
+ Out << '*';
if (I.isVolatile()) {
Out << "((volatile ";
printType(Out, I.getPointerOperand()->getType());
}
void CWriter::visitGetElementPtrInst(GetElementPtrInst &I) {
- Out << "&";
+ Out << '&';
printIndexingExpression(I.getPointerOperand(), gep_type_begin(I),
gep_type_end(I));
}
Out << Mang->getValueName(I.getOperand(0));
Out << "; va_arg(*(va_list*)&" << Mang->getValueName(&I) << ", ";
printType(Out, I.getArgType());
- Out << ")";
+ Out << ')';
}
void CWriter::visitVAArgInst(VAArgInst &I) {