merge to branch master
authorHamed <hamed.gorjiara@gmail.com>
Tue, 19 Sep 2017 23:39:05 +0000 (16:39 -0700)
committerHamed <hamed.gorjiara@gmail.com>
Tue, 19 Sep 2017 23:39:05 +0000 (16:39 -0700)
1  2 
src/ASTAnalyses/Encoding/encodinggraph.cc

@@@ -6,7 -6,9 +6,10 @@@
  #include "set.h"
  #include "csolver.h"
  #include "tunable.h"
+ #include "qsort.h"
+ #include "subgraph.h"
+ #include "elementencoding.h"
 +#include "boolean.h"
  
  EncodingGraph::EncodingGraph(CSolver * _solver) :
        solver(_solver) {
@@@ -29,6 -42,35 +43,35 @@@ void EncodingGraph::buildGraph() 
                        ASSERT(0);
                }
        }
 -                      ElementEncoding *encoding=getElementEncoding(e);
+       bsdqsort(edgeVector.expose(), edgeVector.getSize(), sizeof(EncodingEdge *), sortEncodingEdge);
+       decideEdges();
+ }
+ void EncodingGraph::encode() {
+       SetIteratorEncodingSubGraph * itesg=subgraphs.iterator();
+       while(itesg->hasNext()) {
+               EncodingSubGraph *sg=itesg->next();
+               sg->encode();
+       }
+       delete itesg;
+       ElementIterator it(solver);
+       while(it.hasNext()) {
+               Element * e = it.next();
+               switch(e->type) {
+               case ELEMSET:
+               case ELEMFUNCRETURN: {
++                      ElementEncoding *encoding=e->getElementEncoding();
+                       if (encoding->getElementEncodingType() == ELEM_UNASSIGNED) {
+                               //Do assignment...
+                       }
+                       break;
+               }
+               default:
+                       break;
+               }
+       }
+       
  }
  
  void EncodingGraph::mergeNodes(EncodingNode *first, EncodingNode *second) {