[cfe-commits] r58137 - in /cfe/trunk: include/clang/Analysis/PathSensitive/MemRegion.h lib/Analysis/MemRegion.cpp

Zhongxing Xu xuzhongxing at gmail.com
Sat Oct 25 17:46:38 PDT 2008


On Sun, Oct 26, 2008 at 3:47 AM, Ted Kremenek <kremenek at apple.com> wrote:

>
> On Oct 25, 2008, at 7:13 AM, Zhongxing Xu wrote:
>
>  /// AnonTypedRegion - An "anonymous" region that simply types a chunk
>> ///  of memory.
>> class AnonTypedRegion : public TypedRegion {
>> @@ -195,6 +227,11 @@
>> public:
>>  const Decl* getDecl() const { return D; }
>>  void Profile(llvm::FoldingSetNodeID& ID) const;
>> +
>> +  static bool classof(const MemRegion* R) {
>> +    unsigned k = R->getKind();
>> +    return k > BEG_DECL_REGIONS && k < END_DECL_REGIONS;
>> +  }
>> };
>>
>
> Hi Zhongxing,
>
> Can you tell me what your motivation was for implementing 'classof' for
> AnonTypedRegion in this way?  This will return true if the MemRegion is a
> VarRegion or a FieldRegion, but not if it is an instance of AnonTypedRegion
> (!).  AnonTypedRegion is just meant to be some lightweight layering on top
> of an existing region where we want to add some typing information to a set
> of bytes.
>

Hi Ted,

This is not the classof implementation of AnonTypedRegion, but of
DeclRegion. It looks confusing in the patch. Please look at the updated
MemRegion.h.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20081026/0c4aef2a/attachment.html>


More information about the cfe-commits mailing list