[cfe-users] Getting function body from AST for interprocedural analysis

Lauro Cruz via cfe-users cfe-users at lists.llvm.org
Wed Mar 14 19:39:28 PDT 2018


Good Evening!

I'm playing a little with Clang and I'm trying to do a sort of
interprocedural def-use analysis in the clang AST and I need to visit
the body of functions not defined in the current file.

I've been searching a way to do that and I see there is something to
do with Libtooling, but I can't figure out how. I see there is a
function in ClangTool called BuildASTs, but for that I need to
instantiate a CommomOptionsParser with the command line arguments,
which I don't have in the CodeGen file I'm working.

Can someone give me a light on how I can build the ASTs with the
funciton definitions and get this definition from the ASTs?

Thanks!

-- 
Lauro Cruz e Souza

Computer Engineering BSc- 2014
State University of Campinas (UNICAMP)

+55 19 99857-6981
Facebook: lcruzsouza | Github: laurocruz



More information about the cfe-users mailing list