summaryrefslogtreecommitdiff
path: root/utils/TableGen/InstrSelectorEmitter.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-07 21:02:56 +0000
committerChris Lattner <sabre@nondot.org>2003-08-07 21:02:56 +0000
commit5709e512b19b9b97f3011197bda04ab8e1fe191b (patch)
treeee98cc73c09a9794ef52243b342c57966455b1f5 /utils/TableGen/InstrSelectorEmitter.h
parentee858d2a8357e6773553fa11f3502f72a0372f06 (diff)
downloadllvm-5709e512b19b9b97f3011197bda04ab8e1fe191b.tar.gz
llvm-5709e512b19b9b97f3011197bda04ab8e1fe191b.tar.bz2
llvm-5709e512b19b9b97f3011197bda04ab8e1fe191b.tar.xz
Implement type-inference/checking for non-terminal references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/InstrSelectorEmitter.h')
-rw-r--r--utils/TableGen/InstrSelectorEmitter.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/utils/TableGen/InstrSelectorEmitter.h b/utils/TableGen/InstrSelectorEmitter.h
index 8a8734b934..e8c8fad33f 100644
--- a/utils/TableGen/InstrSelectorEmitter.h
+++ b/utils/TableGen/InstrSelectorEmitter.h
@@ -162,10 +162,15 @@ public:
bool isResolved() const { return Resolved; }
+ /// InstantiateNonterminalsReferenced - If this pattern refers to any
+ /// nonterminals which are not themselves completely resolved, clone the
+ /// nonterminal and resolve it with the using context we provide.
+ void InstantiateNonterminalsReferenced();
private:
+ MVT::ValueType getIntrinsicType(Record *R) const;
TreePatternNode *ParseTreePattern(DagInit *DI);
bool InferTypes(TreePatternNode *N, bool &MadeChange);
- void error(const std::string &Msg);
+ void error(const std::string &Msg) const;
};
std::ostream &operator<<(std::ostream &OS, const Pattern &P);
@@ -193,6 +198,17 @@ public:
const CodeGenTarget &getTarget() const { return Target; }
std::map<Record*, NodeType> &getNodeTypes() { return NodeTypes; }
+ /// getPattern - return the pattern corresponding to the specified record, or
+ /// null if there is none.
+ Pattern *getPattern(Record *R) const {
+ std::map<Record*, Pattern*>::const_iterator I = Patterns.find(R);
+ return I != Patterns.end() ? I->second : 0;
+ }
+
+ /// ReadNonterminal - This method parses the specified record as a
+ /// nonterminal, but only if it hasn't been read in already.
+ Pattern *ReadNonterminal(Record *R);
+
private:
// ReadNodeTypes - Read in all of the node types in the current RecordKeeper,
// turning them into the more accessible NodeTypes data structure.