[lld] fee7896 - [ELF] Optimize SectionBase::Kind values to make isa<InputSection> more efficient. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 00:24:29 PST 2022


Author: Fangrui Song
Date: 2022-02-28T00:24:25-08:00
New Revision: fee78961f52a26686b98701ab6596931ebe95414

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

LOG: [ELF] Optimize SectionBase::Kind values to make isa<InputSection> more efficient. NFC

Surprisingly my lld executable is 1.5KiB smaller.

Added: 
    

Modified: 
    lld/ELF/InputSection.h

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 3ad6129bc5d1..4907e10fcbfc 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -43,7 +43,7 @@ template <class ELFT> struct RelsOrRelas {
 // sections.
 class SectionBase {
 public:
-  enum Kind { Regular, EHFrame, Merge, Synthetic, Output };
+  enum Kind { Regular, Synthetic, EHFrame, Merge, Output };
 
   Kind kind() const { return (Kind)sectionKind; }
 


        


More information about the llvm-commits mailing list