[llvm] 1211c41 - [FileCheck] Fix initialized but never used static analyzer warning. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 13:03:58 PST 2022


Author: Simon Pilgrim
Date: 2022-02-10T21:03:45Z
New Revision: 1211c41805f040f33ae5117aa6eb596aef7141e7

URL: https://github.com/llvm/llvm-project/commit/1211c41805f040f33ae5117aa6eb596aef7141e7
DIFF: https://github.com/llvm/llvm-project/commit/1211c41805f040f33ae5117aa6eb596aef7141e7.diff

LOG: [FileCheck] Fix initialized but never used static analyzer warning. NFC.

Remove superfluous variable initialization, the variable is assigned by both paths immediately afterward.

Added: 
    

Modified: 
    llvm/utils/FileCheck/FileCheck.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 6742853c9b63a..9fa16af1dd502 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -630,7 +630,7 @@ static void DumpAnnotatedInput(raw_ostream &OS, const FileCheckRequest &Req,
     // -dump-input-filter.  However, in case the resulting ellipsis would occupy
     // more lines than the input lines and annotations it elides, buffer the
     // elided lines and annotations so we can print them instead.
-    raw_ostream *LineOS = &OS;
+    raw_ostream *LineOS;
     if ((!PrevLineInFilter || PrevLineInFilter + DumpInputContext < Line) &&
         (NextLineInFilter == UINT_MAX ||
          Line + DumpInputContext < NextLineInFilter))


        


More information about the llvm-commits mailing list