Make intel asmprinter child of generic asmprinter, not x86 shared asm printer. This leads to some code duplication, which will be resolved later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov
2008-06-28 11:07:54 +00:00
parent 271329af24
commit 1c4b5eaa46
4 changed files with 138 additions and 27 deletions

View File

@@ -73,23 +73,6 @@ struct VISIBILITY_HIDDEN X86SharedAsmPrinter : public AsmPrinter {
// Necessary for dllexport support
StringSet<> DLLExportedFns, DLLExportedGVs;
inline static bool isScale(const MachineOperand &MO) {
return MO.isImmediate() &&
(MO.getImm() == 1 || MO.getImm() == 2 ||
MO.getImm() == 4 || MO.getImm() == 8);
}
inline static bool isMem(const MachineInstr *MI, unsigned Op) {
if (MI->getOperand(Op).isFrameIndex()) return true;
return Op+4 <= MI->getNumOperands() &&
MI->getOperand(Op ).isRegister() && isScale(MI->getOperand(Op+1)) &&
MI->getOperand(Op+2).isRegister() &&
(MI->getOperand(Op+3).isImmediate() ||
MI->getOperand(Op+3).isGlobalAddress() ||
MI->getOperand(Op+3).isConstantPoolIndex() ||
MI->getOperand(Op+3).isJumpTableIndex());
}
};
} // end namespace llvm