summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2012-04-20 18:35:18 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2012-04-20 18:35:18 +0000
commit34fbcb4cbad99b9ffbfa9227358de5fe6f3d0811 (patch)
treeedb85c0147f4b0418b16691cb6aa780a957ba692 /lld
parentcca0f80ff3036591e8c7cda3951ed87abd136683 (diff)
downloadbcm5719-llvm-34fbcb4cbad99b9ffbfa9227358de5fe6f3d0811.tar.gz
bcm5719-llvm-34fbcb4cbad99b9ffbfa9227358de5fe6f3d0811.zip
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. llvm-svn: 155215
Diffstat (limited to 'lld')
-rw-r--r--lld/lib/Platforms/Darwin/ExecutableWriter.cpp6
-rw-r--r--lld/lib/Platforms/Darwin/MachOFormat.hpp6
2 files changed, 7 insertions, 5 deletions
diff --git a/lld/lib/Platforms/Darwin/ExecutableWriter.cpp b/lld/lib/Platforms/Darwin/ExecutableWriter.cpp
index 3ebf3517748..4245e9b0803 100644
--- a/lld/lib/Platforms/Darwin/ExecutableWriter.cpp
+++ b/lld/lib/Platforms/Darwin/ExecutableWriter.cpp
@@ -527,7 +527,8 @@ void SectionChunk::appendAtom(const DefinedAtom *atom) {
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::updateLoadCommandContent(const lld::File &file) {
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) {
diff --git a/lld/lib/Platforms/Darwin/MachOFormat.hpp b/lld/lib/Platforms/Darwin/MachOFormat.hpp
index 2566f7b0088..55340aa6145 100644
--- a/lld/lib/Platforms/Darwin/MachOFormat.hpp
+++ b/lld/lib/Platforms/Darwin/MachOFormat.hpp
@@ -135,7 +135,7 @@ public:
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 @@ enum {
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 @@ struct dylib_command : public load_command {
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);
OpenPOWER on IntegriCloud