I'm new to stackoverflow, and new to using the rose compiler. I'm trying to get the total number of arrays accessed in a function (not for every array access, but for individual arrays). Here's what I have so far:
//for each function body
SgFunctionDeclaration *func = isSgFunctionDeclaration(*p);
SgFunctionDefinition *defn = func->get_definition();
Rose_STL_Container<SgNode*> arrayAccess = NodeQuery::querySubTree(defn,V_SgArrayType);
for (Rose_STL_Container<SgNode*>::iterator iter = arrayAccess.begin(); iter!= arrayAccess.end(); iter++ ) {
//in here i check if any iterators point to the same thing, and only increment counter if they do not point to the same
This seems to work for some examples, but for others it doesn't detect any arrays.. It seems the way I'm querying for array is not correct? Does anyone know about this?