diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-11-06 19:25:43 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-11-06 19:25:43 +0000 |
| commit | 98c870f87b7f0c996a9ba67003d88d434d6dbcd0 (patch) | |
| tree | 3f02eb16478f4bae0f26a1164476630369829573 /utils/TableGen/CodeGenInstruction.cpp | |
| parent | dea546b62339578938a91f05a00a145baf921f6c (diff) | |
generalize alias support to allow the result of an alias to
add fixed immediate values. Move the aad and aam aliases to
use this, and document it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.cpp')
| -rw-r--r-- | utils/TableGen/CodeGenInstruction.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp index 40d4206b30..924608cbf0 100644 --- a/utils/TableGen/CodeGenInstruction.cpp +++ b/utils/TableGen/CodeGenInstruction.cpp @@ -449,6 +449,21 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) { ++AliasOpNo; continue; } + + if (IntInit *II = dynamic_cast<IntInit*>(Arg)) { + // Integer arguments can't have names. + if (!Result->getArgName(AliasOpNo).empty()) + throw TGError(R->getLoc(), "result argument #" + utostr(AliasOpNo) + + " must not have a name!"); + if (ResultInst->Operands[i].MINumOperands != 1 || + !ResultInst->Operands[i].Rec->isSubClassOf("Operand")) + throw TGError(R->getLoc(), "invalid argument class " + + ResultInst->Operands[i].Rec->getName() + + " for integer result operand!"); + ResultOperands.push_back(ResultOperand(II->getValue())); + ++AliasOpNo; + continue; + } throw TGError(R->getLoc(), "result of inst alias has unknown operand type"); } |
