mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Print an error message in Formula::print if the HasBaseReg flag
is inconsistent with the BaseRegs field. It's not print's job to assert on an invalid condition, but it can make one more obvious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104077 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
90bb355b16
commit
c4cfbaf217
@ -326,6 +326,13 @@ void Formula::print(raw_ostream &OS) const {
|
||||
if (!First) OS << " + "; else First = false;
|
||||
OS << "reg(" << **I << ')';
|
||||
}
|
||||
if (AM.HasBaseReg && BaseRegs.empty()) {
|
||||
if (!First) OS << " + "; else First = false;
|
||||
OS << "**error: HasBaseReg**";
|
||||
} else if (!AM.HasBaseReg && !BaseRegs.empty()) {
|
||||
if (!First) OS << " + "; else First = false;
|
||||
OS << "**error: !HasBaseReg**";
|
||||
}
|
||||
if (AM.Scale != 0) {
|
||||
if (!First) OS << " + "; else First = false;
|
||||
OS << AM.Scale << "*reg(";
|
||||
|
Loading…
Reference in New Issue
Block a user