summaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenInstruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.cpp')
-rw-r--r--utils/TableGen/CodeGenInstruction.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp
index f4a760990999..44ee16f6fd74 100644
--- a/utils/TableGen/CodeGenInstruction.cpp
+++ b/utils/TableGen/CodeGenInstruction.cpp
@@ -128,8 +128,8 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(R) {
// Make sure the constraints list for each operand is large enough to hold
// constraint info, even if none is present.
- for (unsigned i = 0, e = OperandList.size(); i != e; ++i)
- OperandList[i].Constraints.resize(OperandList[i].MINumOperands);
+ for (OperandInfo &OpInfo : OperandList)
+ OpInfo.Constraints.resize(OpInfo.MINumOperands);
}
@@ -375,10 +375,10 @@ HasOneImplicitDefWithKnownVT(const CodeGenTarget &TargetInfo) const {
// Check to see if the first implicit def has a resolvable type.
Record *FirstImplicitDef = ImplicitDefs[0];
assert(FirstImplicitDef->isSubClassOf("Register"));
- const std::vector<MVT::SimpleValueType> &RegVTs =
+ const std::vector<ValueTypeByHwMode> &RegVTs =
TargetInfo.getRegisterVTs(FirstImplicitDef);
- if (RegVTs.size() == 1)
- return RegVTs[0];
+ if (RegVTs.size() == 1 && RegVTs[0].isSimple())
+ return RegVTs[0].getSimple().SimpleTy;
return MVT::Other;
}
@@ -430,6 +430,17 @@ FlattenAsmStringVariants(StringRef Cur, unsigned Variant) {
return Res;
}
+bool CodeGenInstruction::isOperandAPointer(unsigned i) const {
+ if (DagInit *ConstraintList = TheDef->getValueAsDag("InOperandList")) {
+ if (i < ConstraintList->getNumArgs()) {
+ if (DefInit *Constraint = dyn_cast<DefInit>(ConstraintList->getArg(i))) {
+ return Constraint->getDef()->isSubClassOf("TypedOperand") &&
+ Constraint->getDef()->getValueAsBit("IsPointer");
+ }
+ }
+ }
+ return false;
+}
//===----------------------------------------------------------------------===//
/// CodeGenInstAlias Implementation