OK, I understand your question now.
I added the assert to the public overload of setFlags that has one parameter
(just the flag value), not the one the constructor eventually calls.
void setFlags(unsigned F) { assert(F != Flags); setFlags(getParent(), F); }
> On Apr 29, 2016, at 12:13 PM, Richard Smith <[email protected]> wrote:
>
> On Fri, Apr 29, 2016 at 12:12 PM, Akira Hatanaka via cfe-commits
> <[email protected] <mailto:[email protected]>> wrote:
> Scope’s constructor passes the parameter ScopeFlags to Scope::Init, which
> calls setFlags(Scope *parent, unsigned flags) and setFlags initializes
> Scope::Flags to the value passed to the constructor.
>
> Right, but you're making setFlags assert (F != Flags), at which point Flags
> is presumably uninitialized if the constructor didn't set it itself.
>
>> On Apr 29, 2016, at 11:36 AM, Richard Smith <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> On Fri, Apr 29, 2016 at 11:07 AM, Akira Hatanaka via cfe-commits
>> <[email protected] <mailto:[email protected]>> wrote:
>> If I add an assert to check (F != Flags) in setFlags, 2700+ out of 5000+
>> clang regression tests fail. I haven’t figured out which parts of clang are
>> passing the same value to setFlags.
>>
>> What are you initializing Flags to in the constructor?
>>> On Apr 28, 2016, at 7:38 PM, Richard Smith via cfe-commits
>>> <[email protected] <mailto:[email protected]>> wrote:
>>>
>>> On Thu, Apr 28, 2016 at 7:34 PM, Akira Hatanaka via cfe-commits
>>> <[email protected] <mailto:[email protected]>> wrote:
>>> ahatanak added a comment.
>>>
>>> Thanks for the review. I committed the patch in r267956 and r267975.
>>>
>>> Do you think I should make setFlags(unsigned F) return early if F == Flags?
>>>
>>> I don't think that should happen in practice, so it doesn't seem worth
>>> checking.
>>>
>>> Repository:
>>> rL LLVM
>>>
>>> http://reviews.llvm.org/D19175 <http://reviews.llvm.org/D19175>
>>>
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> [email protected] <mailto:[email protected]>
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>> <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> [email protected] <mailto:[email protected]>
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>> <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> [email protected] <mailto:[email protected]>
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>> <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
>>
>>
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected] <mailto:[email protected]>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits