[lld] b223177 - [ELF] Special case static_assert for _WIN32

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 10:08:52 PST 2020


Author: Fangrui Song
Date: 2020-11-09T10:08:44-08:00
New Revision: b22317705d39289e778ffa755489225bf1e3fc6e

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

LOG: [ELF] Special case static_assert for _WIN32

I don't have a Windows machine. Hope someone can test why its InputSection is
still larger.

Added: 
    

Modified: 
    lld/ELF/InputSection.h

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index f0cc592d1328..a8771bad0f8a 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -390,7 +390,11 @@ class InputSection : public InputSectionBase {
   template <class ELFT> void copyShtGroup(uint8_t *buf);
 };
 
+#ifdef _WIN32
+static_assert(sizeof(InputSection) <= 192, "InputSection is too big");
+#else
 static_assert(sizeof(InputSection) <= 184, "InputSection is too big");
+#endif
 
 inline bool isDebugSection(const InputSectionBase &sec) {
   return sec.name.startswith(".debug") || sec.name.startswith(".zdebug");


        


More information about the llvm-commits mailing list