[cfe-dev] How can I get a FieldRegion in a CompoundAssignOperator in Static Analyzer?

Arthur Yoo phjy007 at gmail.com
Tue Jan 21 05:19:17 PST 2014


Hi all,


I want to get a FieldRegion when evaluating a CompoundAssignOperator. The
code snippet for my test is like below:



typedef struct {

           int a;

           int *p;

} Obj;

Obj obj;

obj.a = 0;

obj.a += sizeof(long);



When evaluating the statement ‘*obj.a += sizeof(long);*’ in the method *void
checkPostStmt(const BinaryOperator *Op, CheckerContext &C) const*, I want
to get the FieldRegion of *obj.a*. But I don’t know how to get it. Is there
anyone can provide me a way to get *obj.a*’s FieldRegion? Thanks a lot.

-- 
Best regards,
Arthur Yoo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140121/fe4b3a35/attachment.html>


More information about the cfe-dev mailing list