Changeset 78a0b88 for src/ResolvExpr/TypeEnvironment.h
- Timestamp:
- Sep 1, 2017, 3:33:25 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- bc3127d
- Parents:
- e8ccca3 (diff), a01f7c94 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/TypeEnvironment.h
re8ccca3 r78a0b88 28 28 29 29 namespace ResolvExpr { 30 // adding this comparison operator significantly improves assertion resolution run time for 31 // some cases. The current resolution algorithm's speed partially depends on the order of 32 // assertions. Assertions which have fewer possible matches should appear before 33 // assertions which have more possible matches. This seems to imply that this could 34 // be further improved by providing an indexer as an additional argument and ordering based 35 // on the number of matches of the same kind (object, function) for the names of the 36 // declarations. 37 // 38 // I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this comparator. 30 39 struct AssertCompare { 31 bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const; 40 bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const { 41 int cmp = d1->get_name().compare( d2->get_name() ); 42 return cmp < 0 || 43 ( cmp == 0 && d1->get_type() < d2->get_type() ); 44 } 32 45 }; 33 46 struct AssertionSetValue {
Note: See TracChangeset
for help on using the changeset viewer.