summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2005-12-08 02:14:08 +0000
committerEvan Cheng <evan.cheng@apple.com>2005-12-08 02:14:08 +0000
commitc9a620060b00e85071964678c37fd2deb48af161 (patch)
treedfc287c27015c0c89d915bf86fc338367603609a /llvm/utils
parentc9fab310987cd9d5271edc5d5bf59bd41f380c82 (diff)
downloadbcm5719-llvm-c9a620060b00e85071964678c37fd2deb48af161.tar.gz
bcm5719-llvm-c9a620060b00e85071964678c37fd2deb48af161.zip
* Added an explicit type field to ComplexPattern.
* Renamed MatchingNodes to RootNodes. llvm-svn: 24636
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.cpp8
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.h8
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.cpp5
3 files changed, 12 insertions, 9 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index d4d4187924f..b16bc8831d7 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -335,7 +335,9 @@ unsigned CodeGenInstruction::getOperandNamed(const std::string &Name) const {
// ComplexPattern implementation
//
ComplexPattern::ComplexPattern(Record *R) {
- NumOperands = R->getValueAsInt("NumOperands");
- SelectFunc = R->getValueAsString("SelectFunc");
- MatchingNodes = R->getValueAsListOfDefs("MatchingNodes");
+ Ty = ::getValueType(R->getValueAsDef("Ty"));
+ NumOperands = R->getValueAsInt("NumOperands");
+ SelectFunc = R->getValueAsString("SelectFunc");
+ RootNodes = R->getValueAsListOfDefs("RootNodes");
}
+
diff --git a/llvm/utils/TableGen/CodeGenTarget.h b/llvm/utils/TableGen/CodeGenTarget.h
index 36b87599322..c7958d5a476 100644
--- a/llvm/utils/TableGen/CodeGenTarget.h
+++ b/llvm/utils/TableGen/CodeGenTarget.h
@@ -160,17 +160,19 @@ public:
/// ComplexPattern - ComplexPattern info, corresponding to the ComplexPattern
/// tablegen class in TargetSelectionDAG.td
class ComplexPattern {
+ MVT::ValueType Ty;
unsigned NumOperands;
std::string SelectFunc;
- std::vector<Record*> MatchingNodes;
+ std::vector<Record*> RootNodes;
public:
ComplexPattern() : NumOperands(0) {};
ComplexPattern(Record *R);
+ MVT::ValueType getValueType() const { return Ty; }
unsigned getNumOperands() const { return NumOperands; }
const std::string &getSelectFunc() const { return SelectFunc; }
- const std::vector<Record*> &getMatchingNodes() const {
- return MatchingNodes;
+ const std::vector<Record*> &getRootNodes() const {
+ return RootNodes;
}
};
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index cf5abc2de0e..3379f4695a3 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -478,8 +478,7 @@ static unsigned char getIntrinsicType(Record *R, bool NotRegisters,
// Using a VTSDNode or CondCodeSDNode.
return MVT::Other;
} else if (R->isSubClassOf("ComplexPattern")) {
- const CodeGenTarget &T = TP.getDAGISelEmitter().getTargetInfo();
- return T.getPointerType();
+ return TP.getDAGISelEmitter().getComplexPattern(R).getValueType();
} else if (R->getName() == "node") {
// Placeholder.
return MVT::isUnknown;
@@ -2256,7 +2255,7 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
dynamic_cast<IntInit*>(Node->getLeafValue())) {
PatternsByOpcode[getSDNodeNamed("imm")].push_back(&PatternsToMatch[i]);
} else if ((CP = NodeGetComplexPattern(Node, *this))) {
- std::vector<Record*> OpNodes = CP->getMatchingNodes();
+ std::vector<Record*> OpNodes = CP->getRootNodes();
for (unsigned j = 0, e = OpNodes.size(); j != e; j++) {
PatternsByOpcode[OpNodes[j]].insert(PatternsByOpcode[OpNodes[j]].begin(),
&PatternsToMatch[i]);
OpenPOWER on IntegriCloud