[cfe-dev] Visitor Question

Socrates Katsoulacos socrates.katsoulacos11 at imperial.ac.uk
Mon Aug 6 09:20:17 PDT 2012


Dear Sir/Madam,

I am implementing a code that typechecks C source code.
At some point in my program I used the following function in order to visit
all functions and their bodies.

      // Function (declaration and body) visitor.
      void VisitFunctionDecl(FunctionDecl *D) {
  BaseDeclVisitor::VisitFunctionDecl(D);
  if (D->isThisDeclarationADefinition()) {
            BaseStmtVisitor::Visit(D->getBody());

  }
      }

The problem that I have is that if I test a C source file that has function
calls to another file which contains the declaration and body of the
functions, then it does not give me back the body of these functions.
As a result it tests only functions that their body is specified in the
same source file that I am testing.
Any suggestions on how can I retrieve the functions bodies of these
functions that are specified in other files ?

Sincerely yours,

Socrates
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120806/e0caa027/attachment.html>


More information about the cfe-dev mailing list