[cfe-commits] r119341 - /cfe/trunk/lib/Checker/GRCXXExprEngine.cpp
Marcin Świderski
marcin.sfider at gmail.com
Wed Nov 17 03:20:11 PST 2010
W dniu 17 listopada 2010 12:08 użytkownik Zhongxing Xu <
xuzhongxing at gmail.com> napisał:
>
>
> 2010/11/17 Marcin Świderski <marcin.sfider at gmail.com>
>
> 2010/11/17 Zhongxing Xu <xuzhongxing at gmail.com>
>>
>>> On Tue, Nov 16, 2010 at 4:50 PM, Marcin Swiderski <
>>> marcin.sfider at gmail.com> wrote:
>>>
>>>> Author: sfider
>>>> Date: Tue Nov 16 02:50:38 2010
>>>> New Revision: 119341
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=119341&view=rev
>>>> Log:
>>>> Refactored GRExprEngine::getCXXThisRegion to use
>>>> CXXMethodDecl::getThisType instead of calculating it by hand.
>>>>
>>>
>>> Please don't do this for now. CXXMethodDecl::getThisType() takes
>>> qualifiers into account. But in the analyzer, we sometimes analyze methods
>>> in isolation. So we always use unqualified type.
>>>
>>
>>>
>> What would this change impact? Maybe there should be a comment regarding
>> this, because it's counter-intuitive.
>>
>
> To be more precise, we cannot do this. We do not always have CXXMethodDecl.
> We sometimes only have CXXRecordDecl when visiting constructors.
>
>
But what did you meant by analyzing methods in isolation? What would be
impacted by using type of 'this' with const qualifier for methods that are
const qualified?
>
>
>>>> Modified:
>>>> cfe/trunk/lib/Checker/GRCXXExprEngine.cpp
>>>>
>>>> Modified: cfe/trunk/lib/Checker/GRCXXExprEngine.cpp
>>>> URL:
>>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRCXXExprEngine.cpp?rev=119341&r1=119340&r2=119341&view=diff
>>>>
>>>> ==============================================================================
>>>> --- cfe/trunk/lib/Checker/GRCXXExprEngine.cpp (original)
>>>> +++ cfe/trunk/lib/Checker/GRCXXExprEngine.cpp Tue Nov 16 02:50:38 2010
>>>> @@ -66,8 +66,7 @@
>>>>
>>>> const CXXThisRegion *GRExprEngine::getCXXThisRegion(const CXXRecordDecl
>>>> *D,
>>>> const StackFrameContext
>>>> *SFC) {
>>>> - Type *T = D->getTypeForDecl();
>>>> - QualType PT = getContext().getPointerType(QualType(T, 0));
>>>> + QualType PT = D->getThisType(getContext());
>>>> return ValMgr.getRegionManager().getCXXThisRegion(PT, SFC);
>>>> }
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> cfe-commits mailing list
>>>> cfe-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101117/5a37363f/attachment.html>
More information about the cfe-commits
mailing list