return false;
}
+std::string AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
+ assert(MF && "No machine function?");
+ return Mang->makeNameProper(MF->getFunction()->getName() + ".eh",
+ TAI->getGlobalPrefix());
+}
+
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
// What's my mangled name?
CurrentFnName = Mang->getValueName(MF.getFunction());
}
+/// EmitFile - Emit a .file directive.
+void AsmPrinter::EmitFile(unsigned Number, const std::string &Name) const {
+ O << "\t.file\t" << Number << " \"";
+ for (unsigned i = 0, N = Name.size(); i < N; ++i) {
+ unsigned char C = Name[i];
+ printStringChar(O, C);
+ }
+ O << "\"";
+}
+
+
//===----------------------------------------------------------------------===//
// EmitAlignment - Emit an alignment directive to the specified power of
if (CVA->isString()) {
EmitString(CVA);
} else { // Not a string. Print the values in successive locations
- for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
+ for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) {
EmitGlobalConstant(CVA->getOperand(i));
+ const Type* EltTy = CVA->getType()->getElementType();
+ uint64_t padSize = TD->getABITypeSize(EltTy) - TD->getTypeSize(EltTy);
+ EmitZeros(padSize);
+ }
}
return;
} else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
return;
} else if (CFP->getType() == Type::X86_FP80Ty) {
// all long double variants are printed as hex
- const uint64_t *p = CFP->getValueAPF().convertToAPInt().getRawData();
+ // api needed to prevent premature destruction
+ APInt api = CFP->getValueAPF().convertToAPInt();
+ const uint64_t *p = api.getRawData();
if (TD->isBigEndian()) {
O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 48)
<< "\t" << TAI->getCommentString()
<< " long double most significant halfword\n";
}
return;
+ } else if (CFP->getType() == Type::PPC_FP128Ty) {
+ // all long double variants are printed as hex
+ // api needed to prevent premature destruction
+ APInt api = CFP->getValueAPF().convertToAPInt();
+ const uint64_t *p = api.getRawData();
+ if (TD->isBigEndian()) {
+ O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double most significant word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[0])
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[1] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[1])
+ << "\t" << TAI->getCommentString()
+ << " long double least significant word\n";
+ } else {
+ O << TAI->getData32bitsDirective() << uint32_t(p[1])
+ << "\t" << TAI->getCommentString()
+ << " long double least significant word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[1] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[0])
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double most significant word\n";
+ }
+ return;
} else assert(0 && "Floating point constant type not handled");
} else if (CV->getType() == Type::Int64Ty) {
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
bool printColon,
bool printComment) const {
- O << TAI->getPrivateGlobalPrefix() << "BB" << FunctionNumber << "_"
+ O << TAI->getPrivateGlobalPrefix() << "BB" << getFunctionNumber() << "_"
<< MBB->getNumber();
if (printColon)
O << ':';
}
break;
case Type::FloatTyID: case Type::DoubleTyID:
+ case Type::X86_FP80TyID: case Type::FP128TyID: case Type::PPC_FP128TyID:
assert (0 && "Should have already output floating point constant.");
default:
assert (0 && "Can't handle printing this type of thing");