aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-02 23:40:41 +0000
committerChris Lattner <sabre@nondot.org>2010-11-02 23:40:41 +0000
commita1ca91af4e01b413cd1d1b3fa9d8d24fa99d9293 (patch)
tree025a64efe50e445d2064d8247051393c9dd56ed8 /utils
parente6c6cec82bee4f419645577bffbc1f56d4c90f34 (diff)
downloadexternal_llvm-a1ca91af4e01b413cd1d1b3fa9d8d24fa99d9293.zip
external_llvm-a1ca91af4e01b413cd1d1b3fa9d8d24fa99d9293.tar.gz
external_llvm-a1ca91af4e01b413cd1d1b3fa9d8d24fa99d9293.tar.bz2
Completely reject instructions that have an operand in their
ins/outs list that isn't specified by their asmstring. Previously the asmmatcher would just force a 0 register into it, which clearly isn't right. Mark a bunch of ARM instructions that use this as isCodeGenOnly. Some of them are clearly pseudo instructions (like t2TBB) others use a weird hasExtraSrcRegAllocReq thing that will either need to be removed or the asmmatcher will need to be taught about it (someday). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/AsmMatcherEmitter.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp
index 0620a88..5610368 100644
--- a/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/utils/TableGen/AsmMatcherEmitter.cpp
@@ -1176,27 +1176,21 @@ static void EmitConvertToMCInst(CodeGenTarget &Target,
continue;
}
+ // Otherwise, this must be a tied operand if not, it is something that is
+ // mentioned in the ins/outs list but not in the asm string.
+ int TiedOp = OpInfo.getTiedRegister();
+ if (TiedOp == -1)
+ throw TGError(II.TheDef->getLoc(), "Instruction '" +
+ II.TheDef->getName() + "' has operand '" + OpInfo.Name +
+ "' that doesn't appear in asm string!");
// If this operand is tied to a previous one, just copy the MCInst operand
// from the earlier one.
- int TiedOp = OpInfo.getTiedRegister();
- if (TiedOp != -1) {
- // Copy the tied operand. We can only tie single MCOperand values.
- assert(OpInfo.MINumOperands == 1 && "Not a singular MCOperand");
- assert(i > unsigned(TiedOp) && "Tied operand preceeds its target!");
- CaseOS << " Inst.addOperand(Inst.getOperand(" << TiedOp << "));\n";
- Signature += "__Tie" + itostr(TiedOp);
- continue;
- }
-
- // Otherwise this is some sort of dummy operand that is mentioned in the
- // ins/outs list but not mentioned in the asmstring, brutalize a dummy
- // value into the operand.
- // FIXME: This is a terrible hack: If an MCInst operand doesn't occur in
- // the asmstring, there is no way to parse something meaningful.
- // Just assume it is a zero register for now.
- CaseOS << " Inst.addOperand(MCOperand::CreateReg(0));\n";
- Signature += "__Imp";
+ // Copy the tied operand. We can only tie single MCOperand values.
+ assert(OpInfo.MINumOperands == 1 && "Not a singular MCOperand");
+ assert(i > unsigned(TiedOp) && "Tied operand preceeds its target!");
+ CaseOS << " Inst.addOperand(Inst.getOperand(" << TiedOp << "));\n";
+ Signature += "__Tie" + itostr(TiedOp);
}
II.ConversionFnKind = Signature;