In path
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
In LLVM 9.0.0 the code is, STI.setByteCtr(CurByte);
But in LLVM 15.0.2 The CurByte has been replaced. In some instances the CurByte parameter is totally omitted and in some it has been replaced with StartByte
So what should be the equivalent command in case of LLVM 15.0.2?
if ((TSFlags & X86II::OpMapMask) == X86II::ThreeDNow)
EmitByte(X86II::getBaseOpcodeFor(TSFlags), CurByte, OS);
#ifndef NDEBUG
// FIXME: Verify.
if (/*!Desc.isVariadic() &&*/ CurOp != NumOps) {
errs() << "Cannot encode all operands of: ";
MI.dump();
errs() << '\n';
abort();
}
#endif
// Koo: Update the actual bytes to be emitted in MCSubtargetInfo class
STI.setByteCtr(CurByte);
The equivalent portion in LLVM 15.0.2
if ((TSFlags & X86II::OpMapMask) == X86II::ThreeDNow)
emitByte(X86II::getBaseOpcodeFor(TSFlags), OS);
assert(OS.tell() - StartByte <= 15 &&
"The size of instruction must be no longer than 15.");
#ifndef NDEBUG
// FIXME: Verify.
if (/*!Desc.isVariadic() &&*/ CurOp != NumOps) {
errs() << "Cannot encode all operands of: ";
MI.dump();
errs() << '\n';
abort();
}
#endif
// Koo: Update the actual bytes to be emitted in MCSubtargetInfo class
STI.setByteCtr(CurByte);
}