[LLVMbugs] [Bug 20590] trunk/llvm/lib/Transforms/Scalar/SROA.cpp: 2 * init error ?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 8 03:16:04 PDT 2014


David Binderman <dcb314 at hotmail.com> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #2 from David Binderman <dcb314 at hotmail.com> ---
>They're not initialized by itself, but with an argument of the same name. 

I don't think so. Please quote the relevant part of the C++
language standard that two mentions of variable S refer to two different 

Let's not forget that this kind of double naming is poor software engineering.

I'm thinking that a fix like

SliceBuilder(const DataLayout &DL, AllocaInst &AI, AllocaSlices & thatS)
      : PtrUseVisitor<SliceBuilder>(DL),
        AllocSize(DL.getTypeAllocSize(AI.getAllocatedType())), S(thatS) {}

would solve the problem.

>This is a very common pattern in LLVM and harmless. 

Nope. I've just scanned all the trunk source code of LLVM
and this problem pattern only occurs in this file. Hence the bug report.

>What checker did emit those warnings?

cppcheck, available from sourceforge. Strongly recommended.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140808/300be54d/attachment.html>

More information about the llvm-bugs mailing list