summaryrefslogtreecommitdiffstats
path: root/utils/TableGen/CodeGenInstruction.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-02-16 09:30:23 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-02-16 09:30:23 +0000
commitf25ddd991a5601d0101602c4c263a58c7af4b8a2 (patch)
tree4cfca640904d1896e25032757a61f8959c066919 /utils/TableGen/CodeGenInstruction.cpp
parent3fd58f91dd318518f7daa4ba64c0aaf31799d89b (diff)
downloadFreeBSD-src-f25ddd991a5601d0101602c4c263a58c7af4b8a2.zip
FreeBSD-src-f25ddd991a5601d0101602c4c263a58c7af4b8a2.tar.gz
Update LLVM to r96341.
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.cpp')
-rw-r--r--utils/TableGen/CodeGenInstruction.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp
index 684431a..d31502b 100644
--- a/utils/TableGen/CodeGenInstruction.cpp
+++ b/utils/TableGen/CodeGenInstruction.cpp
@@ -33,10 +33,10 @@ static void ParseConstraint(const std::string &CStr, CodeGenInstruction *I) {
I->ParseOperandName(Name, false);
// Build the string for the operand
- std::string OpConstraint = "(1 << TOI::EARLY_CLOBBER)";
- if (!I->OperandList[Op.first].Constraints[Op.second].empty())
+ if (!I->OperandList[Op.first].Constraints[Op.second].isNone())
throw "Operand '" + Name + "' cannot have multiple constraints!";
- I->OperandList[Op.first].Constraints[Op.second] = OpConstraint;
+ I->OperandList[Op.first].Constraints[Op.second] =
+ CodeGenInstruction::ConstraintInfo::getEarlyClobber();
return;
}
@@ -65,13 +65,11 @@ static void ParseConstraint(const std::string &CStr, CodeGenInstruction *I) {
unsigned FlatOpNo = I->getFlattenedOperandNumber(SrcOp);
- // Build the string for the operand.
- std::string OpConstraint =
- "((" + utostr(FlatOpNo) + " << 16) | (1 << TOI::TIED_TO))";
- if (!I->OperandList[DestOp.first].Constraints[DestOp.second].empty())
+ if (!I->OperandList[DestOp.first].Constraints[DestOp.second].isNone())
throw "Operand '" + DestOpName + "' cannot have multiple constraints!";
- I->OperandList[DestOp.first].Constraints[DestOp.second] = OpConstraint;
+ I->OperandList[DestOp.first].Constraints[DestOp.second] =
+ CodeGenInstruction::ConstraintInfo::getTied(FlatOpNo);
}
static void ParseConstraints(const std::string &CStr, CodeGenInstruction *I) {
@@ -210,18 +208,13 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
// For backward compatibility: isTwoAddress means operand 1 is tied to
// operand 0.
if (isTwoAddress) {
- if (!OperandList[1].Constraints[0].empty())
+ if (!OperandList[1].Constraints[0].isNone())
throw R->getName() + ": cannot use isTwoAddress property: instruction "
"already has constraint set!";
- OperandList[1].Constraints[0] = "((0 << 16) | (1 << TOI::TIED_TO))";
+ OperandList[1].Constraints[0] =
+ CodeGenInstruction::ConstraintInfo::getTied(0);
}
- // Any operands with unset constraints get 0 as their constraint.
- for (unsigned op = 0, e = OperandList.size(); op != e; ++op)
- for (unsigned j = 0, e = OperandList[op].MINumOperands; j != e; ++j)
- if (OperandList[op].Constraints[j].empty())
- OperandList[op].Constraints[j] = "0";
-
// Parse the DisableEncoding field.
std::string DisableEncoding = R->getValueAsString("DisableEncoding");
while (1) {
OpenPOWER on IntegriCloud