forked from OSchip/llvm-project
[BOLT] Do no report error on mismatched instruction encoding
Summary: When the validation of instruction encoding fails but we are able to continue processing the binary, do no report an error. Report encoding format only under `-v=1`. (cherry picked from FBD19376531)
This commit is contained in:
parent
45b27d7b44
commit
0283271f29
|
@ -1851,9 +1851,11 @@ bool BinaryContext::validateEncoding(const MCInst &Inst,
|
|||
MCE->encodeInstruction(Inst, VecOS, Fixups, *STI);
|
||||
auto EncodedData = ArrayRef<uint8_t>((uint8_t *)Code.data(), Code.size());
|
||||
if (InputEncoding != EncodedData) {
|
||||
errs() << "BOLT-ERROR: mismatched encoding detected\n"
|
||||
<< " input: " << InputEncoding << '\n'
|
||||
<< " output: " << EncodedData << '\n';
|
||||
if (opts::Verbosity > 1) {
|
||||
errs() << "BOLT-WARNING: mismatched encoding detected\n"
|
||||
<< " input: " << InputEncoding << '\n'
|
||||
<< " output: " << EncodedData << '\n';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue