[cfe-commits] r160634 - in /cfe/trunk: include/clang/AST/CommentSema.h lib/AST/CommentSema.cpp
Jordan Rose
jordan_rose at apple.com
Tue Jul 24 14:36:08 PDT 2012
On Jul 24, 2012, at 14:27 , Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Tue, Jul 24, 2012 at 2:25 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>>
>> On Jul 24, 2012, at 13:59 , Dmitri Gribenko <gribozavr at gmail.com> wrote:
>>
>>> Hi Jordan!
>>>
>>> Thank you for the review!
>>>
>>> On Mon, Jul 23, 2012 at 11:27 AM, Jordan Rose <jordan_rose at apple.com> wrote:
>>>> But more importantly, I don't see where IsThisDeclInspected gets reset to
>>>> false.
>>>
>>> In the member initializer list:
>>>
>>> Sema::Sema(llvm::BumpPtrAllocator &Allocator, const SourceManager &SourceMgr,
>>> DiagnosticsEngine &Diags) :
>>> - Allocator(Allocator), SourceMgr(SourceMgr), Diags(Diags), ThisDecl(NULL) {
>>> + Allocator(Allocator), SourceMgr(SourceMgr), Diags(Diags), ThisDecl(NULL),
>>> + IsThisDeclInspected(false) {
>>> }
>>>
>>
>> That's where it's initially set to false. I'll admit I haven't tracked the comment framework so closely, but surely you don't recreate the comment::Sema object for every Decl?
>
> I do. A fresh Sema object is stack-allocated for each comment we parse.
>
> Dmitri
…ah, okay. That is very very different from clang::Sema, but I suppose it makes sense, since a comment always attaches to the next decl or the previous decl. Sorry for the noise, then.
More information about the cfe-commits
mailing list