在Rose编译器中访问数组

时间:2012-01-28 07:22:46

标签: c++ arrays compiler-construction rose-compiler-framework

我是stackoverflow的新手,也是使用rose编译器的新手。 我正在尝试获取函数中访问的数组总数(不是每个数组访问,而是单个数组)。 这是我到目前为止所做的:

//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

这似乎适用于某些示例,但对于其他示例,它不会检测到任何数组。 看来我查询数组的方式不正确?有谁知道这个?

0 个答案:

没有答案