[cfe-dev] slurping include files

Vane, Edwin edwin.vane at intel.com
Mon Mar 18 09:14:11 PDT 2013

1) LibTooling sure does have rewrite support! Take a look at the extra clang tools repo (instructions at the top of http://clang.llvm.org/docs/ClangTools.html). There's a few simple tools (remove-cstr-calls and tool-template) and one not-so-simple tool (cpp11-migrate) which use rewriting.
2) If you're using libtooling you get clang's header searching functionality for free. If the code you're about to rewrite can compile, you should be able to run your tool on it. Now, you may still get header problems. I think there was a problem just recently fixed for finding c++ headers buried within arch-specific directories (i.e. newer versions of Ubuntu). My workaround was to add the directory manually as a command-line flag e.g.: -I/usr/include/x86_64-linux-gnu/c++/4.7/

-----Original Message-----
From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of suppamax
Sent: Monday, March 18, 2013 11:54 AM
To: cfe-dev at cs.uiuc.edu
Subject: Re: [cfe-dev] slurping include files

Hi Manuel,

thank you for your hint, I will have a look at libtooling.
Just a quick question: my final target is being able to rewrite my source code in some hot spots (variable declarations).

1) do LibTooling also ease the rewriting procedure?
2) The reason why I started struggling with included files is my original code didn't react on variable declarations like complex<float> c1; and I imagined it was because the program didn't know how to react without loading the complex library. Any suggestion on how to perform this task?


View this message in context: http://clang-developers.42468.n3.nabble.com/slurping-include-files-tp4031016p4031023.html
Sent from the Clang Developers mailing list archive at Nabble.com.
cfe-dev mailing list
cfe-dev at cs.uiuc.edu

More information about the cfe-dev mailing list