"llvm/lib/git@repo.hca.bsc.es:rferrer/llvm-epi-0.8.git" did not exist on "140542fcea7b915304b86879ab14637cfcaf2632"
Newer
Older
unsigned OpFlags = MI->getOperand(OpNo).getImmedValue();
OpNo += (OpFlags >> 3) + 1;
}
if (OpNo >= MI->getNumOperands()) {
Error = true;
unsigned OpFlags = MI->getOperand(OpNo).getImmedValue();
++OpNo; // Skip over the ID number.
AsmPrinter *AP = const_cast<AsmPrinter*>(this);
if ((OpFlags & 7) == 4 /*ADDR MODE*/) {
Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant,
Modifier[0] ? Modifier : 0);
} else {
Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
Modifier[0] ? Modifier : 0);
}
}
if (Error) {
Bill Wendling
committed
cerr << "Invalid operand found in inline asm: '"
<< AsmStr << "'\n";
MI->dump();
exit(1);
}
}
break;
}
}
}
O << "\n\t" << TAI->getInlineAsmEnd() << "\n";
}
/// printLabel - This method prints a local label used by debug and
/// exception handling tables.
void AsmPrinter::printLabel(const MachineInstr *MI) const {
O << "\n"
<< TAI->getPrivateGlobalPrefix()
<< MI->getOperand(0).getImmedValue()
<< ":\n";
}
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
/// instruction, using the specified assembler variant. Targets should
/// overried this to format as appropriate.
bool AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode) {
// Target doesn't support this yet!
return true;
bool AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant,
const char *ExtraCode) {
// Target doesn't support this yet!
return true;
}
/// printBasicBlockLabel - This method prints the label for the specified
/// MachineBasicBlock
void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
bool printColon,
bool printComment) const {
O << TAI->getPrivateGlobalPrefix() << "BB" << FunctionNumber << "_"
if (printColon)
O << ':';
if (printComment && MBB->getBasicBlock())
O << '\t' << TAI->getCommentString() << MBB->getBasicBlock()->getName();
}
/// printSetLabel - This method prints a set label for the specified
/// MachineBasicBlock
void AsmPrinter::printSetLabel(unsigned uid,
const MachineBasicBlock *MBB) const {
if (!TAI->getSetDirective())
return;
O << TAI->getSetDirective() << ' ' << TAI->getPrivateGlobalPrefix()
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
printBasicBlockLabel(MBB, false, false);
O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
<< '_' << uid << '\n';
}
void AsmPrinter::printSetLabel(unsigned uid, unsigned uid2,
const MachineBasicBlock *MBB) const {
if (!TAI->getSetDirective())
return;
O << TAI->getSetDirective() << ' ' << TAI->getPrivateGlobalPrefix()
<< getFunctionNumber() << '_' << uid << '_' << uid2
<< "_set_" << MBB->getNumber() << ',';
printBasicBlockLabel(MBB, false, false);
O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
<< '_' << uid << '_' << uid2 << '\n';
}
/// printDataDirective - This method prints the asm directive for the
/// specified type.
void AsmPrinter::printDataDirective(const Type *type) {
const TargetData *TD = TM.getTargetData();
switch (type->getTypeID()) {
case Type::IntegerTyID: {
unsigned BitWidth = cast<IntegerType>(type)->getBitWidth();
if (BitWidth <= 8)
O << TAI->getData8bitsDirective();
else if (BitWidth <= 16)
O << TAI->getData16bitsDirective();
else if (BitWidth <= 32)
O << TAI->getData32bitsDirective();
else if (BitWidth <= 64) {
assert(TAI->getData64bitsDirective() &&
"Target cannot handle 64-bit constant exprs!");
O << TAI->getData64bitsDirective();
}
break;
case Type::PointerTyID:
if (TD->getPointerSize() == 8) {
assert(TAI->getData64bitsDirective() &&
"Target cannot handle 64-bit pointer exprs!");
O << TAI->getData64bitsDirective();
}
break;
case Type::FloatTyID: case Type::DoubleTyID:
assert (0 && "Should have already output floating point constant.");
default:
assert (0 && "Can't handle printing this type of thing");
break;
}
}