Clang addToCallGraph可以为我生成调用图吗?

Clang addToCallGraph可以为我生成调用图吗?,clang,libtooling,Clang,Libtooling,我想为.cpp文件中的特定函数生成调用图。 我使用AST匹配器获得函数的decl。然后,我将decl传递给addToCallGraph函数 clang::CallGraph CG; CG.addToCallGraph(std::move(function_decl)); 之后,我尝试打印调用图: std::string str; llvm::raw_string_ostream os(str); CG.print(os); std::cout<<os.str

我想为.cpp文件中的特定函数生成调用图。 我使用AST匹配器获得函数的decl。然后,我将decl传递给addToCallGraph函数

clang::CallGraph CG;    
CG.addToCallGraph(std::move(function_decl));
之后,我尝试打印调用图:

  std::string str;
  llvm::raw_string_ostream os(str);
  CG.print(os);
  std::cout<<os.str()<<std::endl;
std::string str;
llvm::原始字符串操作系统(str);
CG.打印(os);
标准::cout
Function: < root > calls: A B
  Function: A calls: B
  Function: B calls: