[clang] d3db74e - [clang] Remove unused variable AllElementsInt.

Arthur O'Dwyer via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 28 09:27:52 PST 2022


Author: Arthur O'Dwyer
Date: 2022-02-28T12:27:34-05:00
New Revision: d3db74eadbfc06425668b39c41eeeca22f747978

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

LOG: [clang] Remove unused variable AllElementsInt.

This has been unused ever since it was committed in b8a501ccf1.

Differential Revision: https://reviews.llvm.org/D120629

Added: 
    

Modified: 
    clang/lib/Sema/SemaDecl.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 671aeb7e9ea69..7d9d5ec87948e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -18474,9 +18474,6 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange,
   unsigned NumNegativeBits = 0;
   unsigned NumPositiveBits = 0;
 
-  // Keep track of whether all elements have type int.
-  bool AllElementsInt = true;
-
   for (unsigned i = 0, e = Elements.size(); i != e; ++i) {
     EnumConstantDecl *ECD =
       cast_or_null<EnumConstantDecl>(Elements[i]);
@@ -18491,10 +18488,6 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange,
     else
       NumNegativeBits = std::max(NumNegativeBits,
                                  (unsigned)InitVal.getMinSignedBits());
-
-    // Keep track of whether every enum element has type int (very common).
-    if (AllElementsInt)
-      AllElementsInt = ECD->getType() == Context.IntTy;
   }
 
   // Figure out the type that should be used for this enum.


        


More information about the cfe-commits mailing list