/// an operand, specified with syntax like ${opname:modifier}.
std::string MiModifier;
- AsmWriterOperand(const std::string &LitStr)
+ // To make VS STL happy
+ AsmWriterOperand():OperandType(isLiteralTextOperand) {}
+
+ explicit AsmWriterOperand(const std::string &LitStr)
: OperandType(isLiteralTextOperand), Str(LitStr) {}
AsmWriterOperand(const std::string &Printer, unsigned OpNo,
for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
const AsmWriterInst *Inst = getAsmWriterInstByID(i);
- if (Inst == 0) continue; // PHI, INLINEASM, LABEL, etc.
+ if (Inst == 0) continue; // PHI, INLINEASM, DBG_LABEL, etc.
std::string Command;
if (Inst->Operands.empty())
}
// Figure out how many bits we used for the string index.
- unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx);
+ unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx+1);
// To reduce code size, we compactify common instructions into a few bits
// in the opcode-indexed table.
}
O << "\";\n\n";
+ O << " if (TAI->doesSupportDebugInformation() &&\n"
+ << " DW->ShouldEmitDwarfDebug()) {\n"
+ << " const MachineFunction *MF = MI->getParent()->getParent();\n"
+ << " DebugLoc CurDL = MI->getDebugLoc();\n\n"
+ << " if (!CurDL.isUnknown()) {\n"
+ << " static DebugLocTuple PrevDLT(~0U, ~0U, ~0U);\n"
+ << " DebugLocTuple CurDLT = MF->getDebugLocTuple(CurDL);\n\n"
+ << " if (PrevDLT.Src != ~0U && PrevDLT != CurDLT)\n"
+ << " printLabel(DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,\n"
+ << " CurDLT.Src));\n\n"
+ << " PrevDLT = CurDLT;\n"
+ << " }\n"
+ << " }\n\n";
+
O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
<< " O << \"\\t\";\n"
<< " printInlineAsm(MI);\n"
<< " return true;\n"
- << " } else if (MI->getOpcode() == TargetInstrInfo::LABEL) {\n"
+ << " } else if (MI->isLabel()) {\n"
<< " printLabel(MI);\n"
<< " return true;\n"
<< " } else if (MI->getOpcode() == TargetInstrInfo::DECLARE) {\n"