[cfe-commits] r120890 - in /cfe/trunk: include/clang/AST/ include/clang/Sema/ lib/AST/ lib/Analysis/ lib/Checker/ lib/CodeGen/ lib/Parse/ lib/Sema/ test/CodeGen/ test/CodeGenObjCXX/ test/Rewriter/ test/Sema/ test/SemaCXX/ test/SemaTemplate/
John McCall
rjmccall at apple.com
Fri Dec 3 22:48:10 PST 2010
On Dec 3, 2010, at 10:47 PM, Abramo Bagnara wrote:
> Il 04/12/2010 07:42, John McCall ha scritto:
>>
>> On Dec 3, 2010, at 10:37 PM, Abramo Bagnara wrote:
>>
>>> Il 04/12/2010 04:47, John McCall ha scritto:
>>>> --- cfe/trunk/lib/AST/Expr.cpp (original)
>>>> +++ cfe/trunk/lib/AST/Expr.cpp Fri Dec 3 21:47:34 2010
>>>> @@ -824,6 +824,8 @@
>>>> return "LValueBitCast";
>>>> case CK_LValueToRValue:
>>>> return "LValueToRValue";
>>>> + case CK_GetObjCProperty:
>>>> + return "GetObjCProperty";
>>>> case CK_NoOp:
>>>> return "NoOp";
>>>> case CK_BaseToDerived:
>>>> @@ -1722,6 +1724,24 @@
>>>> }
>>>> }
>>>>
>>>> +Expr *Expr::IgnoreParenLValueCasts() {
>>>> + Expr *E = this;
>>>> + while (E) {
>>>> + if (ParenExpr *P = dyn_cast<ParenExpr>(E)) {
>>>> + E = P->getSubExpr();
>>>> + continue;
>>>> + }
>>>> + if (CastExpr *P = dyn_cast<CastExpr>(E)) {
>>>> + if (P->getCastKind() == CK_LValueToRValue) {
>>>> + E = P->getSubExpr();
>>>> + continue;
>>>> + }
>>>> + }
>>>> + break;
>>>> + }
>>>> + return E;
>>>> +}
>>>
>>> What about __extension__ skipping?
>>
>> Good point. I *think* we don't need that here because this method is meant to just be a hack to simplify workarounds in the static analyzer, but Ted might have thoughts. For one, I don't know whether the analyzer generally pays attention to __extension__ nodes.
>
> Whenever it calls IgnoreParen* helpers it *does* pay attention: they are
> always skipped.
In that case, I'll add __extension__ skipping, thanks.
John.
More information about the cfe-commits
mailing list