[llvm-commits] [lld] r155215 - in /lld/trunk/lib/Platforms/Darwin: ExecutableWriter.cpp MachOFormat.hpp

Michael J. Spencer bigcheesegs at gmail.com
Fri Apr 20 11:35:18 PDT 2012


Author: mspencer
Date: Fri Apr 20 13:35:18 2012
New Revision: 155215

URL: http://llvm.org/viewvc/llvm-project?rev=155215&view=rev
Log:
MSVC fixes:

* MSVC does not yet support initializer lists and uniform initialization.
* MSVC does not support flexible array members (And neither does C++).

The Mach-O writer test still fails with this, but it all compiles and
all other tests pass.

Modified:
    lld/trunk/lib/Platforms/Darwin/ExecutableWriter.cpp
    lld/trunk/lib/Platforms/Darwin/MachOFormat.hpp

Modified: lld/trunk/lib/Platforms/Darwin/ExecutableWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Platforms/Darwin/ExecutableWriter.cpp?rev=155215&r1=155214&r2=155215&view=diff
==============================================================================
--- lld/trunk/lib/Platforms/Darwin/ExecutableWriter.cpp (original)
+++ lld/trunk/lib/Platforms/Darwin/ExecutableWriter.cpp Fri Apr 20 13:35:18 2012
@@ -527,7 +527,8 @@
   if ( align2 > _align2 )
     _align2 = align2;
   // Assign atom to this section with this offset.
-  _atoms.push_back({atom, offset});
+  SectionChunk::AtomInfo ai = {atom, offset};
+  _atoms.push_back(ai);
   // Update section size to include this atom.
   _size = offset + atom->size();
   // Update permissions
@@ -820,7 +821,8 @@
 
 
 void LoadCommandsChunk::addSection(SectionChunk* chunk) {
-  _sectionInfo.push_back({chunk, nullptr, nullptr});
+  LoadCommandsChunk::ChunkSegInfo csi = {chunk, nullptr, nullptr};
+  _sectionInfo.push_back(csi);
 }
 
 void LoadCommandsChunk::addLoadCommand(load_command* lc) {

Modified: lld/trunk/lib/Platforms/Darwin/MachOFormat.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Platforms/Darwin/MachOFormat.hpp?rev=155215&r1=155214&r2=155215&view=diff
==============================================================================
--- lld/trunk/lib/Platforms/Darwin/MachOFormat.hpp (original)
+++ lld/trunk/lib/Platforms/Darwin/MachOFormat.hpp Fri Apr 20 13:35:18 2012
@@ -135,7 +135,7 @@
   uint32_t  initprot;  
   uint32_t  nsects;    
   uint32_t  flags;  
-  section_64 sections[];
+  section_64 sections[1];
   
   // The segment_command_64 load commands has a nsect trailing
   // section_64 records appended to the end.
@@ -160,7 +160,7 @@
 class dylinker_command : public load_command {
 public:
   uint32_t  name_offset;
-  char      name[];
+  char      name[1];
   
   static dylinker_command* make(const char* path) {
     unsigned size = (sizeof(dylinker_command) + strlen(path) + 7) & (-8);
@@ -280,7 +280,7 @@
   uint32_t  timestamp;
   uint32_t  current_version;    
   uint32_t  compatibility_version;
-  char      name[];
+  char      name[1];
   
   static dylib_command* make(const char* path) {
     unsigned size = (sizeof(dylib_command) + strlen(path) + 7) & (-8);





More information about the llvm-commits mailing list