[PATCH] add BugReporterVisitor to PthreadLockChecker

Daniel Fahlgren daniel at fahlgren.se
Tue Jun 3 08:07:57 PDT 2014


On Mon, 2014-06-02 at 15:54 -0700, Jordan Rose wrote:
> Good idea! Rather than add another state, though, it might be better to
> use a custom tag for the initialization transition. That way we don't
> need to have "S->isInitialized() || S->isUnlocked()" anywhere. What do
> you think?

Do you mean to add another variable that is true if the unlocked mutex
just been initialized? I tried that but that made the code look a bit
kludgy. The ugly part simply moved from one place to another.

Initialized is only a special case of unlocked, so if isUnlocked()
returns true for both cases the rest of the code turned out rather

I've attached a new version of the patch with that approach and a note
that the order we check the state in VisitNode now is important.

> I don't think we have one yet, but feel free to augment the existing
> StackHintGeneratorForSymbol to support both. I imagine most of the
> logic is the same.

Ok. I'll see if I have some time later on for doing that.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PthreadLockChecker.cpp.diff
Type: text/x-patch
Size: 8507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140603/c0a23ce8/attachment.bin>

More information about the cfe-commits mailing list