"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "projects/CodeThorn/src/AstUtility.C" between
rose-0.11.49.0.tar.gz and rose-0.11.50.0.tar.gz

About: ROSE is a compiler infrastructure to build source-to-source program transformation and analysis tools for large-scale C, C++, UPC, Fortran, OpenMP, Java, Python and PHP applications.

AstUtility.C  (rose-0.11.49.0):AstUtility.C  (rose-0.11.50.0)
skipping to change at line 44 skipping to change at line 44
SgExpression* initExp=SgNodeHelper::getInitializerExpressionOfVariableDeclar ation(*i); SgExpression* initExp=SgNodeHelper::getInitializerExpressionOfVariableDeclar ation(*i);
CodeThorn::VariableIdSet usedVarsInInitializer; CodeThorn::VariableIdSet usedVarsInInitializer;
usedVarsInInitializer=AstUtility::astSubTreeVariables(initExp, *variableIdMa pping); usedVarsInInitializer=AstUtility::astSubTreeVariables(initExp, *variableIdMa pping);
usedVarsInInitializersIdSet.insert(usedVarsInInitializer.begin(),usedVarsInI nitializer.end()); usedVarsInInitializersIdSet.insert(usedVarsInInitializer.begin(),usedVarsInI nitializer.end());
} }
return usedVarsInInitializersIdSet; return usedVarsInInitializersIdSet;
} }
CodeThorn::VariableIdSet CodeThorn::VariableIdSet
AstUtility::usedVariablesInsideFunctions(SgProject* project, VariableIdMapping* variableIdMapping) { AstUtility::usedVariablesInsideFunctions(SgProject* project, VariableIdMapping* variableIdMapping) {
VariableIdMappingExtended* vimExtended=dynamic_cast<VariableIdMappingExtended*
>(variableIdMapping);
ROSE_ASSERT(vimExtended);
list<SgVarRefExp*> varRefExpList=SgNodeHelper::listOfUsedVarsInFunctions(proje ct); list<SgVarRefExp*> varRefExpList=SgNodeHelper::listOfUsedVarsInFunctions(proje ct);
//cout<<"DEBUG: varRefExpList-size:"<<varRefExpList.size()<<endl; //cout<<"DEBUG: varRefExpList-size:"<<varRefExpList.size()<<endl;
CodeThorn::VariableIdSet setOfUsedVars; CodeThorn::VariableIdSet setOfUsedVars;
for(list<SgVarRefExp*>::iterator i=varRefExpList.begin();i!=varRefExpList.end( );++i) { for(list<SgVarRefExp*>::iterator i=varRefExpList.begin();i!=varRefExpList.end( );++i) {
//cout<<"DEBUG: determining varid for variable "<<(*i)->unparseToString()<<e ndl; //cout<<"DEBUG: determining varid for variable "<<(*i)->unparseToString()<<e ndl;
// this test properly excludes data member accesses, only global and local v ariables are detected // this test properly excludes data member accesses, only global and local v ariables are detected
if(VariableIdMappingExtended::isGlobalOrLocalVariableAccess(*i)) { if(vimExtended->isGlobalOrLocalVariableAccess(*i)) {
VariableId id = variableIdMapping->variableId(*i); VariableId id = variableIdMapping->variableId(*i);
if(!id.isValid()) { if(!id.isValid()) {
//cout<<" : invalid."<<endl; //cout<<" : invalid."<<endl;
SgExpression* exp=*i; SgExpression* exp=*i;
while(isSgExpression(exp->get_parent())) while(isSgExpression(exp->get_parent()))
exp=isSgExpression(exp->get_parent()); exp=isSgExpression(exp->get_parent());
cout<<"EXPRESSION: "<<exp->unparseToString()<<endl; cout<<"EXPRESSION: "<<exp->unparseToString()<<endl;
ostringstream exceptionMsg; ostringstream exceptionMsg;
exceptionMsg << "Error: AstUtility::usedVariablesInsideFunctions: Invalid variable id for SgVarRefExp " exceptionMsg << "Error: AstUtility::usedVariablesInsideFunctions: Invalid variable id for SgVarRefExp "
<< (*i)->unparseToString() << ", Symbol: " << (*i)->get_symb ol() << endl; << (*i)->unparseToString() << ", Symbol: " << (*i)->get_symb ol() << endl;
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)