[llvm-commits] [lld] r167166 - in /lld/trunk/lib/ReaderWriter/ELF: HexagonReference.cpp PPCReference.cpp X86Reference.cpp

Michael J. Spencer bigcheesegs at gmail.com
Wed Oct 31 13:47:30 PDT 2012


Author: mspencer
Date: Wed Oct 31 15:47:30 2012
New Revision: 167166

URL: http://llvm.org/viewvc/llvm-project?rev=167166&view=rev
Log:
Fix cl brokeness.

cl is not attempting to complete a templated class when used in this
context. The conversion forces this to happen.

Thanks to Richard Smith for figuring this out.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/HexagonReference.cpp
    lld/trunk/lib/ReaderWriter/ELF/PPCReference.cpp
    lld/trunk/lib/ReaderWriter/ELF/X86Reference.cpp

Modified: lld/trunk/lib/ReaderWriter/ELF/HexagonReference.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/HexagonReference.cpp?rev=167166&r1=167165&r2=167166&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/HexagonReference.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/HexagonReference.cpp Wed Oct 31 15:47:30 2012
@@ -46,7 +46,7 @@
   if ((result < 0x200000) && (result > -0x200000)) {
     result = ((result<<1) & 0x3ffe) | ((result<<3) & 0x01ff0000);
     *reinterpret_cast<llvm::support::ulittle32_t *>(location) = result |
-                     *reinterpret_cast<llvm::support::ulittle32_t *>(location);
+            (uint32_t)*reinterpret_cast<llvm::support::ulittle32_t *>(location);
     return HexagonKindHandler::NoError;
   }
   return HexagonKindHandler::Overflow;
@@ -58,7 +58,7 @@
   if ((result < 0x8000) && (result > -0x8000)) {
     result = ((result<<1) & 0x20fe) | ((result<<7) & 0x00df0000);
     *reinterpret_cast<llvm::support::ulittle32_t *>(location) = result |
-                      *reinterpret_cast<llvm::support::ulittle32_t *>(location);
+            (uint32_t)*reinterpret_cast<llvm::support::ulittle32_t *>(location);
     return HexagonKindHandler::NoError;
   }
   return HexagonKindHandler::Overflow;
@@ -69,7 +69,7 @@
   uint32_t result = (uint32_t)(S + A);
   result = ((result & 0x3fff) | ((result << 2) & 0x00c00000));
   *reinterpret_cast<llvm::support::ulittle32_t *>(location) = result |
-                    *reinterpret_cast<llvm::support::ulittle32_t *>(location);
+            (uint32_t)*reinterpret_cast<llvm::support::ulittle32_t *>(location);
   return HexagonKindHandler::NoError;
 }
 
@@ -78,7 +78,7 @@
   uint32_t result = (uint32_t)((S + A)>>16);
   result = ((result & 0x3fff) | ((result << 2) & 0x00c00000));
   *reinterpret_cast<llvm::support::ulittle32_t *>(location) = result |
-                    *reinterpret_cast<llvm::support::ulittle32_t *>(location);
+            (uint32_t)*reinterpret_cast<llvm::support::ulittle32_t *>(location);
   return HexagonKindHandler::NoError;
 }
 
@@ -86,7 +86,7 @@
 int reloc32(uint8_t *location, uint64_t P, uint64_t S, uint64_t A) {
   uint32_t result = (uint32_t)(S + A);
   *reinterpret_cast<llvm::support::ulittle32_t *>(location) = result |
-                    *reinterpret_cast<llvm::support::ulittle32_t *>(location);
+            (uint32_t)*reinterpret_cast<llvm::support::ulittle32_t *>(location);
   return HexagonKindHandler::NoError;
 }
 } // namespace hexagon

Modified: lld/trunk/lib/ReaderWriter/ELF/PPCReference.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPCReference.cpp?rev=167166&r1=167165&r2=167166&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/PPCReference.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/PPCReference.cpp Wed Oct 31 15:47:30 2012
@@ -46,7 +46,7 @@
   if ((result < 0x1000000) && (result > -0x1000000)) {
     result &= ~-(0x1000000);
     *reinterpret_cast<llvm::support::ubig32_t *>(location) = result |
-                      *reinterpret_cast<llvm::support::ubig32_t *>(location);
+               (uint32_t)*reinterpret_cast<llvm::support::ubig32_t *>(location);
     return PPCKindHandler::NoError;
   }
   return PPCKindHandler::Overflow;

Modified: lld/trunk/lib/ReaderWriter/ELF/X86Reference.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86Reference.cpp?rev=167166&r1=167165&r2=167166&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86Reference.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86Reference.cpp Wed Oct 31 15:47:30 2012
@@ -45,14 +45,14 @@
 int reloc32(uint8_t *location, uint64_t P, uint64_t S, uint64_t A) {
   int32_t result = (uint32_t)(S + A);
   *reinterpret_cast<llvm::support::ulittle32_t *>(location) = result |
-                    *reinterpret_cast<llvm::support::ulittle32_t *>(location);
+            (uint32_t)*reinterpret_cast<llvm::support::ulittle32_t *>(location);
   return X86KindHandler::NoError;
 }
 /// \brief R_386_PC32 - word32: S + A - P
 int relocPC32(uint8_t *location, uint64_t P, uint64_t S, uint64_t A) {
   uint32_t result = (uint32_t)((S + A) - P);
   *reinterpret_cast<llvm::support::ulittle32_t *>(location) = result +
-                    *reinterpret_cast<llvm::support::ulittle32_t *>(location);
+            (uint32_t)*reinterpret_cast<llvm::support::ulittle32_t *>(location);
   return X86KindHandler::NoError;
 }
 





More information about the llvm-commits mailing list