AsmBackend(asmbackend), CommentStream(CommentToEmit),
IsVerboseAsm(isVerboseAsm), ShowInst(showInst),
UseDwarfDirectory(useDwarfDirectory) {
- if (InstPrinter && IsVerboseAsm)
- InstPrinter->setCommentStream(CommentStream);
+ assert(InstPrinter);
+ if (IsVerboseAsm)
+ InstPrinter->setCommentStream(CommentStream);
}
inline void EmitEOL() {
}
void MCAsmStreamer::EmitRegisterName(int64_t Register) {
- if (InstPrinter && !MAI->useDwarfRegNumForCFI()) {
+ if (!MAI->useDwarfRegNumForCFI()) {
const MCRegisterInfo *MRI = getContext().getRegisterInfo();
unsigned LLVMRegister = MRI->getLLVMRegNum(Register, true);
InstPrinter->printRegName(OS, LLVMRegister);
GetCommentOS() << "\n";
}
- // If we have an AsmPrinter, use that to print, otherwise print the MCInst.
- if (InstPrinter)
- InstPrinter->printInst(&Inst, OS, "", STI);
- else
- Inst.print(OS);
+ InstPrinter->printInst(&Inst, OS, "", STI);
+
EmitEOL();
}