[cfe-dev] Missing ReturnStmt?

Zong zong_y365 at 163.com
Mon Feb 6 01:55:29 PST 2012


 Dear All,

I have a very simple clang analyzer checker code snippet like below,

--------------------------------------------------
using namespace clang;
using namespace ento;

namespace {
  class myChecker: public Checker< check::PreStmt<Stmt> >  {
  public:
    void checkPreStmt(const Stmt *S, CheckerContext &Ctx) const ;

  };
}

void myChecker::checkPreStmt(const Stmt *S, CheckerContext &Ctx) const {
   S->dumpAll();
}
--------------------------------------------------

This analyzer was then fed with the test code:

int main()
{
  int *b;
  int *c;
  *c=b;
   return 0;
}

Why can't I observe a "ReturnStmt"?
If I change "*c=b" with something other (e.g., b=c), then "ReturnStmt" appears.  I just can't figure out the reason. Would someone please help me ? Thanks!

Best,
Z
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120206/fc33e3df/attachment.html>


More information about the cfe-dev mailing list