[llvm] 6ff1ea3 - Fix "use of uninitialized variable" static analyzer warning. NFCI.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 19:03:21 PDT 2020


Similarly, please don't add initializations for variables that don't need
them for runtime correctness as it impedes dynamic analysis tools - prefer
annotations, etc, if necessary for static analysis compatibility.

On Tue, Jan 7, 2020 at 4:07 AM Simon Pilgrim via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Simon Pilgrim
> Date: 2020-01-07T12:06:54Z
> New Revision: 6ff1ea3244c543ad24fc99c7f4979db2f2078593
>
> URL:
> https://github.com/llvm/llvm-project/commit/6ff1ea3244c543ad24fc99c7f4979db2f2078593
> DIFF:
> https://github.com/llvm/llvm-project/commit/6ff1ea3244c543ad24fc99c7f4979db2f2078593.diff
>
> LOG: Fix "use of uninitialized variable" static analyzer warning. NFCI.
>
> Added:
>
>
> Modified:
>     llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
> b/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
> index 11dd249f8ada..346296c77377 100644
> --- a/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
> +++ b/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
> @@ -541,7 +541,7 @@ R600InstrInfo::fitsReadPortLimitations(const
> std::vector<MachineInstr *> &IG,
>
>    std::vector<std::vector<std::pair<int, unsigned>>> IGSrcs;
>    ValidSwizzle.clear();
> -  unsigned ConstCount;
> +  unsigned ConstCount = 0;
>    BankSwizzle TransBS = ALU_VEC_012_SCL_210;
>    for (unsigned i = 0, e = IG.size(); i < e; ++i) {
>      IGSrcs.push_back(ExtractSrcs(*IG[i], PV, ConstCount));
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200326/4d7f9c23/attachment.html>


More information about the llvm-commits mailing list