@@ -110,15 +110,13 @@ namespace {
110110 Matcher *GetMatcher () const { return TheMatcher; }
111111 private:
112112 void AddMatcher (Matcher *NewNode);
113- void InferPossibleTypes (unsigned ForceMode );
113+ void InferPossibleTypes ();
114114
115115 // Matcher Generation.
116- void EmitMatchCode (const TreePatternNode *N, TreePatternNode *NodeNoTypes,
117- unsigned ForceMode);
116+ void EmitMatchCode (const TreePatternNode *N, TreePatternNode *NodeNoTypes);
118117 void EmitLeafMatchCode (const TreePatternNode *N);
119118 void EmitOperatorMatchCode (const TreePatternNode *N,
120- TreePatternNode *NodeNoTypes,
121- unsigned ForceMode);
119+ TreePatternNode *NodeNoTypes);
122120
123121 // / If this is the first time a node with unique identifier Name has been
124122 // / seen, record it. Otherwise, emit a check to make sure this is the same
@@ -167,19 +165,17 @@ MatcherGen::MatcherGen(const PatternToMatch &pattern,
167165 PatWithNoTypes->RemoveAllTypes ();
168166
169167 // If there are types that are manifestly known, infer them.
170- InferPossibleTypes (Pattern. getForceMode () );
168+ InferPossibleTypes ();
171169}
172170
173171// / InferPossibleTypes - As we emit the pattern, we end up generating type
174172// / checks and applying them to the 'PatWithNoTypes' tree. As we do this, we
175173// / want to propagate implied types as far throughout the tree as possible so
176174// / that we avoid doing redundant type checks. This does the type propagation.
177- void MatcherGen::InferPossibleTypes (unsigned ForceMode ) {
175+ void MatcherGen::InferPossibleTypes () {
178176 // TP - Get *SOME* tree pattern, we don't care which. It is only used for
179177 // diagnostics, which we know are impossible at this point.
180178 TreePattern &TP = *CGP.pf_begin ()->second ;
181- TP.getInfer ().CodeGen = true ;
182- TP.getInfer ().ForceMode = ForceMode;
183179
184180 bool MadeChange = true ;
185181 while (MadeChange)
@@ -304,8 +300,7 @@ void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) {
304300}
305301
306302void MatcherGen::EmitOperatorMatchCode (const TreePatternNode *N,
307- TreePatternNode *NodeNoTypes,
308- unsigned ForceMode) {
303+ TreePatternNode *NodeNoTypes) {
309304 assert (!N->isLeaf () && " Not an operator?" );
310305
311306 if (N->getOperator ()->isSubClassOf (" ComplexPattern" )) {
@@ -359,7 +354,7 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N,
359354
360355 // Match the LHS of the AND as appropriate.
361356 AddMatcher (new MoveChildMatcher (0 ));
362- EmitMatchCode (N->getChild (0 ), NodeNoTypes->getChild (0 ), ForceMode );
357+ EmitMatchCode (N->getChild (0 ), NodeNoTypes->getChild (0 ));
363358 AddMatcher (new MoveParentMatcher ());
364359 return ;
365360 }
@@ -458,7 +453,7 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N,
458453 // Get the code suitable for matching this child. Move to the child, check
459454 // it then move back to the parent.
460455 AddMatcher (new MoveChildMatcher (OpNo));
461- EmitMatchCode (N->getChild (i), NodeNoTypes->getChild (i), ForceMode );
456+ EmitMatchCode (N->getChild (i), NodeNoTypes->getChild (i));
462457 AddMatcher (new MoveParentMatcher ());
463458 }
464459}
@@ -499,8 +494,7 @@ bool MatcherGen::recordUniqueNode(ArrayRef<std::string> Names) {
499494}
500495
501496void MatcherGen::EmitMatchCode (const TreePatternNode *N,
502- TreePatternNode *NodeNoTypes,
503- unsigned ForceMode) {
497+ TreePatternNode *NodeNoTypes) {
504498 // If N and NodeNoTypes don't agree on a type, then this is a case where we
505499 // need to do a type check. Emit the check, apply the type to NodeNoTypes and
506500 // reinfer any correlated types.
@@ -509,7 +503,7 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N,
509503 for (unsigned i = 0 , e = NodeNoTypes->getNumTypes (); i != e; ++i) {
510504 if (NodeNoTypes->getExtType (i) == N->getExtType (i)) continue ;
511505 NodeNoTypes->setType (i, N->getExtType (i));
512- InferPossibleTypes (ForceMode );
506+ InferPossibleTypes ();
513507 ResultsToTypeCheck.push_back (i);
514508 }
515509
@@ -531,7 +525,7 @@ void MatcherGen::EmitMatchCode(const TreePatternNode *N,
531525 if (N->isLeaf ())
532526 EmitLeafMatchCode (N);
533527 else
534- EmitOperatorMatchCode (N, NodeNoTypes, ForceMode );
528+ EmitOperatorMatchCode (N, NodeNoTypes);
535529
536530 // If there are node predicates for this node, generate their checks.
537531 for (unsigned i = 0 , e = N->getPredicateCalls ().size (); i != e; ++i) {
@@ -573,8 +567,7 @@ bool MatcherGen::EmitMatcherCode(unsigned Variant) {
573567 }
574568
575569 // Emit the matcher for the pattern structure and types.
576- EmitMatchCode (Pattern.getSrcPattern (), PatWithNoTypes.get (),
577- Pattern.getForceMode ());
570+ EmitMatchCode (Pattern.getSrcPattern (), PatWithNoTypes.get ());
578571
579572 // If the pattern has a predicate on it (e.g. only enabled when a subtarget
580573 // feature is around, do the check).
0 commit comments