[PATCH] D38955: LLD/ELF: Fix C4307: '-': integral constant overflow for MSVC15

Konstantin Zhuravlyov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 11:49:50 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL315926: Revert r315877: Simplify. (authored by kzhuravl).

Changed prior to commit:
  https://reviews.llvm.org/D38955?vs=119187&id=119188#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38955

Files:
  lld/trunk/ELF/SymbolTable.cpp
  lld/trunk/ELF/SymbolTable.h


Index: lld/trunk/ELF/SymbolTable.h
===================================================================
--- lld/trunk/ELF/SymbolTable.h
+++ lld/trunk/ELF/SymbolTable.h
@@ -103,8 +103,9 @@
   void assignWildcardVersion(SymbolVersion Ver, uint16_t VersionId);
 
   struct SymIndex {
-    int32_t Idx : 31;
-    uint32_t Traced : 1;
+    SymIndex(int Idx, bool Traced) : Idx(Idx), Traced(Traced) {}
+    int Idx : 31;
+    unsigned Traced : 1;
   };
 
   // The order the global symbols are in is not defined. We can use an arbitrary
Index: lld/trunk/ELF/SymbolTable.cpp
===================================================================
--- lld/trunk/ELF/SymbolTable.cpp
+++ lld/trunk/ELF/SymbolTable.cpp
@@ -240,13 +240,13 @@
     Name = Name.take_front(Pos);
 
   auto P = Symtab.insert(
-      {CachedHashStringRef(Name), SymIndex{(int)SymVector.size(), false}});
+      {CachedHashStringRef(Name), SymIndex((int)SymVector.size(), false)});
   SymIndex &V = P.first->second;
   bool IsNew = P.second;
 
   if (V.Idx == -1) {
     IsNew = true;
-    V = SymIndex{(int)SymVector.size(), true};
+    V = SymIndex((int)SymVector.size(), true);
   }
 
   Symbol *Sym;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38955.119188.patch
Type: text/x-patch
Size: 1164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171016/826f72d3/attachment.bin>


More information about the llvm-commits mailing list