loc = decl->getLocation();
if(loc.isValid())
{
- if(decl->getKind()==35)
+ if(dyn_cast<FunctionDecl>(decl))
{
method_decl(decl);
}
loc = decl->getLocation();
if(loc.isValid())
{
- if(decl->getKind()==35)
+ if(dyn_cast<FunctionDecl>(decl))
{
method_decl(decl);
}
output="";
}
}
- if(i->getKind()==35) method_decl(*i);// C++ method
+ if (dyn_cast<FunctionDecl>(*i)) method_decl(*i);// C++ method
}
}
*/
void method_decl(const Decl *decl)
{
+ const FunctionDecl *fDecl = dyn_cast<FunctionDecl>(decl);
string output, line, event;
llvm::raw_string_ostream x(output);
- if(decl->hasBody())
+ if(fDecl->hasBody() && fDecl->getNumParams() > 0)
{
decl->print(x);
line = get_return(x.str());
if(get_model(line)==5)
{
//std::cout<<"metodass"<<std::endl;
- const FunctionDecl *fDecl = dyn_cast<FunctionDecl>(decl);
const ParmVarDecl *pvd = fDecl->getParamDecl(0);
QualType qt = pvd->getOriginalType();
event = qt.getAsString();