[llvm] 3b285ff - [llvm-profgen] Fix a set-but-unused warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 10:19:54 PDT 2021


Author: Kazu Hirata
Date: 2021-10-29T10:19:44-07:00
New Revision: 3b285ff5172c734240a96a12bd7a2d125136efef

URL: https://github.com/llvm/llvm-project/commit/3b285ff5172c734240a96a12bd7a2d125136efef
DIFF: https://github.com/llvm/llvm-project/commit/3b285ff5172c734240a96a12bd7a2d125136efef.diff

LOG: [llvm-profgen] Fix a set-but-unused warning

This patch fixes:

  llvm/tools/llvm-profgen/ProfiledBinary.cpp:357:12: error: variable
  'EndOffset' set but not used [-Werror,-Wunused-but-set-variable]

The last use of the variable was removed on Oct 26 in commit
40ca4112515d03bbcf594bd2dfa6b4394d5b00d6.

Added: 
    

Modified: 
    llvm/tools/llvm-profgen/ProfiledBinary.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp
index 43c86106f2a5..6d8dd78d04ae 100644
--- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp
+++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp
@@ -354,7 +354,6 @@ bool ProfiledBinary::dissassembleSymbol(std::size_t SI, ArrayRef<uint8_t> Bytes,
   };
 
   uint64_t Offset = StartOffset;
-  uint64_t EndOffset = 0;
   // Size of a consecutive invalid instruction range starting from Offset -1
   // backwards.
   uint64_t InvalidInstLength = 0;
@@ -403,8 +402,6 @@ bool ProfiledBinary::dissassembleSymbol(std::size_t SI, ArrayRef<uint8_t> Bytes,
       else if (MCDesc.isReturn())
         RetAddrs.insert(Offset);
 
-      EndOffset = Offset;
-
       if (InvalidInstLength) {
         WarnInvalidInsts(Offset - InvalidInstLength, Offset - 1);
         InvalidInstLength = 0;


        


More information about the llvm-commits mailing list