mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Fix a bug in tblgen that caused incorrect encodings on instructions that specified operands with "bit" instead of "bits<1>".
Unfortunately, my only testcase for this is fragile, and the ARM AsmParser can't round trip the instruction in question. <rdar://problem/9345702> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d78bfbc6bb
commit
4cdcb4772d
@ -63,10 +63,14 @@ void CodeEmitterGen::reverseBits(std::vector<Record*> &Insts) {
|
|||||||
// return the variable bit position. Otherwise return -1.
|
// return the variable bit position. Otherwise return -1.
|
||||||
int CodeEmitterGen::getVariableBit(const std::string &VarName,
|
int CodeEmitterGen::getVariableBit(const std::string &VarName,
|
||||||
BitsInit *BI, int bit) {
|
BitsInit *BI, int bit) {
|
||||||
if (VarBitInit *VBI = dynamic_cast<VarBitInit*>(BI->getBit(bit)))
|
if (VarBitInit *VBI = dynamic_cast<VarBitInit*>(BI->getBit(bit))) {
|
||||||
if (VarInit *VI = dynamic_cast<VarInit*>(VBI->getVariable()))
|
if (VarInit *VI = dynamic_cast<VarInit*>(VBI->getVariable()))
|
||||||
if (VI->getName() == VarName)
|
if (VI->getName() == VarName)
|
||||||
return VBI->getBitNum();
|
return VBI->getBitNum();
|
||||||
|
} else if (VarInit *VI = dynamic_cast<VarInit*>(BI->getBit(bit))) {
|
||||||
|
if (VI->getName() == VarName)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user