cloud9_root/src/cloud9/lib/Module/Dyck/AAAnalyzer.cpp
/// return the structure's field vertex
return the structure's field vertex
return the structure ' s field vertex
DyckVertex* AAAnalyzer::addField(DyckVertex* val, long fieldIndex, DyckVertex* field) {
	if (fieldIndex >= -1) {
		errs() << "ERROR in addField: " << fieldIndex << "\n";
		exit(1);
	}
	DyckVertex* valrep = val->getRepresentative();
	if (field == NULL) {
		set<DyckVertex*>* valrepset = valrep->getOutVertices((void*) (fieldIndex));
		if (valrepset != NULL && !valrepset->empty()) {
			field = *(valrepset->begin());
		} else {
			field = dgraph->retrieveDyckVertex(NULL).first;
			valrep->addTarget(field, (void*) (fieldIndex));
		}
	} else {
		valrep->addTarget(field, (void*) (fieldIndex));
	}
	return field;
}
DyckVertex * AAAnalyzer :: addField ( DyckVertex * val , long fieldIndex , DyckVertex * field ) { if ( fieldIndex >= -1 ) { errs ( ) << " " << fieldIndex << " \n " ; exit ( 1 ) ; } DyckVertex * valrep = val -> getRepresentative ( ) ; if ( field == NULL ) { set < DyckVertex * > * valrepset = valrep -> getOutVertices ( ( void * ) ( fieldIndex ) ) ; if ( valrepset != NULL && ! valrepset -> empty ( ) ) { field = * ( valrepset -> begin ( ) ) ; } else { field = dgraph -> retrieveDyckVertex ( NULL ) . first ; valrep -> addTarget ( field , ( void * ) ( fieldIndex ) ) ; } } else { valrep -> addTarget ( field , ( void * ) ( fieldIndex ) ) ; } return field ; }
return the structure's field vertex
return the structure ' s field vertex