diff --git a/llvm/lib/Target/I8085/AsmParser/I8085AsmParser.cpp b/llvm/lib/Target/I8085/AsmParser/I8085AsmParser.cpp index 34f1ef9bc778ac..93d2a711a7e3d1 100644 --- a/llvm/lib/Target/I8085/AsmParser/I8085AsmParser.cpp +++ b/llvm/lib/Target/I8085/AsmParser/I8085AsmParser.cpp @@ -57,8 +57,9 @@ class I8085AsmParser : public MCTargetAsmParser { bool MatchingInlineAsm) override; bool parseRegister(MCRegister &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) override; - OperandMatchResultTy tryParseRegister(MCRegister &RegNo, SMLoc &StartLoc, - SMLoc &EndLoc) override; + + ParseStatus tryParseRegister(MCRegister &Reg, SMLoc &StartLoc, + SMLoc &EndLoc) override; bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands) override; @@ -583,7 +584,7 @@ bool I8085AsmParser::parseRegister(MCRegister &RegNo, SMLoc &StartLoc, return (RegNo == I8085::NoRegister); } -OperandMatchResultTy I8085AsmParser::tryParseRegister(MCRegister &RegNo, +ParseStatus I8085AsmParser::tryParseRegister(MCRegister &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) { StartLoc = Parser.getTok().getLoc(); diff --git a/llvm/lib/Target/I8085/I8085AsmPrinter.cpp b/llvm/lib/Target/I8085/I8085AsmPrinter.cpp index ee79e5bbf1f263..3771c5f691020a 100644 --- a/llvm/lib/Target/I8085/I8085AsmPrinter.cpp +++ b/llvm/lib/Target/I8085/I8085AsmPrinter.cpp @@ -121,10 +121,8 @@ bool I8085AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum, Register Reg = RegOp.getReg(); unsigned ByteNumber = ExtraCode[0] - 'A'; - - unsigned OpFlags = MI->getOperand(OpNum - 1).getImm(); - unsigned NumOpRegs = InlineAsm::getNumOperandRegisters(OpFlags); - (void)NumOpRegs; + const InlineAsm::Flag OpFlags(MI->getOperand(OpNum - 1).getImm()); + const unsigned NumOpRegs = OpFlags.getNumOperandRegisters(); const I8085Subtarget &STI = MF->getSubtarget(); const TargetRegisterInfo &TRI = *STI.getRegisterInfo(); @@ -167,8 +165,8 @@ bool I8085AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, // If NumOpRegs == 2, then we assume it is product of a FrameIndex expansion // and the second operand is an Imm. - unsigned OpFlags = MI->getOperand(OpNum - 1).getImm(); - unsigned NumOpRegs = InlineAsm::getNumOperandRegisters(OpFlags); + const InlineAsm::Flag OpFlags(MI->getOperand(OpNum - 1).getImm()); + const unsigned NumOpRegs = OpFlags.getNumOperandRegisters(); if (NumOpRegs == 2) { O << '+' << MI->getOperand(OpNum + 1).getImm(); diff --git a/llvm/lib/Target/I8085/I8085ISelLowering.cpp b/llvm/lib/Target/I8085/I8085ISelLowering.cpp index 0363fd8ce473f1..36ea33528eb948 100644 --- a/llvm/lib/Target/I8085/I8085ISelLowering.cpp +++ b/llvm/lib/Target/I8085/I8085ISelLowering.cpp @@ -585,7 +585,7 @@ SDValue I8085TargetLowering::LowerFormalArguments( // If the function takes variable number of arguments, make a frame index for // the start of the first vararg value... for expansion of llvm.va_start. if (isVarArg) { - unsigned StackSize = CCInfo.getNextStackOffset(); + unsigned StackSize = CCInfo.getStackSize(); I8085MachineFunctionInfo *AFI = MF.getInfo(); AFI->setVarArgsFrameIndex(MFI.CreateFixedObject(2, StackSize, true)); @@ -644,7 +644,7 @@ SDValue I8085TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, } // Get a count of how many bytes are to be pushed on the stack. - unsigned NumBytes = CCInfo.getNextStackOffset(); + unsigned NumBytes = CCInfo.getStackSize(); SmallVector, 8> RegsToPass; diff --git a/llvm/lib/Target/I8085/MCTargetDesc/I8085ELFStreamer.cpp b/llvm/lib/Target/I8085/MCTargetDesc/I8085ELFStreamer.cpp index ae41f53e61aee3..c6494eb8b18d51 100644 --- a/llvm/lib/Target/I8085/MCTargetDesc/I8085ELFStreamer.cpp +++ b/llvm/lib/Target/I8085/MCTargetDesc/I8085ELFStreamer.cpp @@ -3,8 +3,8 @@ #include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/FormattedStream.h" +#include "llvm/TargetParser/SubtargetFeature.h" #include "I8085MCTargetDesc.h" diff --git a/llvm/lib/Target/I8085/MCTargetDesc/I8085InstPrinter.cpp b/llvm/lib/Target/I8085/MCTargetDesc/I8085InstPrinter.cpp index 39eff56f78ef07..9f057477dc1269 100644 --- a/llvm/lib/Target/I8085/MCTargetDesc/I8085InstPrinter.cpp +++ b/llvm/lib/Target/I8085/MCTargetDesc/I8085InstPrinter.cpp @@ -64,7 +64,7 @@ const char *I8085InstPrinter::getPrettyRegisterName(unsigned RegNum, void I8085InstPrinter::printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) { - const MCOperandInfo &MOI = this->MII.get(MI->getOpcode()).OpInfo[OpNo]; + const MCOperandInfo &MOI = this->MII.get(MI->getOpcode()).operands()[OpNo]; if (OpNo >= MI->size()) { // Not all operands are correctly disassembled at the moment. This means diff --git a/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.cpp b/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.cpp index 01715080838d56..772630fb8cd5e9 100644 --- a/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.cpp +++ b/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.cpp @@ -132,7 +132,9 @@ unsigned I8085MCCodeEmitter::getMachineOpValue(const MCInst &MI, void I8085MCCodeEmitter::emitInstruction(uint64_t Val, unsigned Size, const MCSubtargetInfo &STI, - raw_ostream &OS) const { + SmallVectorImpl &CB) const { + + llvm::raw_svector_ostream OS(CB); if(Size == 1){ uint8_t val = Val & 0xff; @@ -160,7 +162,8 @@ void I8085MCCodeEmitter::emitInstruction(uint64_t Val, unsigned Size, } } -void I8085MCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS, +void I8085MCCodeEmitter::encodeInstruction(const MCInst &MI, + SmallVectorImpl &CB, SmallVectorImpl &Fixups, const MCSubtargetInfo &STI) const { const MCInstrDesc &Desc = MCII.get(MI.getOpcode()); @@ -174,7 +177,7 @@ void I8085MCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS, assert(Size > 0 && "Instruction size cannot be zero"); uint64_t BinaryOpCode = getBinaryCodeForInstr(MI, Fixups, STI); - emitInstruction(BinaryOpCode, Size, STI, OS); + emitInstruction(BinaryOpCode, Size, STI, CB); } MCCodeEmitter *createI8085MCCodeEmitter(const MCInstrInfo &MCII, diff --git a/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.h b/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.h index 06200aa562e124..48bc0487aba1f7 100644 --- a/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.h +++ b/llvm/lib/Target/I8085/MCTargetDesc/I8085MCCodeEmitter.h @@ -68,9 +68,9 @@ class I8085MCCodeEmitter : public MCCodeEmitter { const MCSubtargetInfo &STI) const; void emitInstruction(uint64_t Val, unsigned Size, const MCSubtargetInfo &STI, - raw_ostream &OS) const; + SmallVectorImpl &CB) const; - void encodeInstruction(const MCInst &MI, raw_ostream &OS, + void encodeInstruction(const MCInst &MI, SmallVectorImpl &CB, SmallVectorImpl &Fixups, const MCSubtargetInfo &STI) const override;