First merge of 2.064 beta.

This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb.

Doesn't build Phobos yet.
This commit is contained in:
David Nadlinger
2013-10-19 23:21:53 +02:00
committed by Kai Nacke
parent c400d180d2
commit cb341586e3
130 changed files with 13566 additions and 9190 deletions

View File

@@ -7,12 +7,17 @@
//
//===----------------------------------------------------------------------===//
#include <assert.h>
#include "target.h"
#include "gen/irstate.h"
#include "mars.h"
#include "mtype.h"
#include <assert.h>
#if defined(_MSC_VER)
#include <windows.h>
#else
#include <pthread.h>
#endif
int Target::ptrsize;
int Target::realsize;
@@ -49,3 +54,19 @@ unsigned Target::fieldalign (Type* type)
// LDC_FIXME: Verify this.
return type->alignsize();
}
// sizes based on those from tollvm.cpp:DtoMutexType()
unsigned Target::critsecsize()
{
#if defined(_MSC_VER)
// Return sizeof(RTL_CRITICAL_SECTION)
return global.params.is64bit ? 40 : 24;
#else
if (global.params.targetTriple.isOSWindows())
return global.params.is64bit ? 40 : 24;
else if (global.params.targetTriple.getOS() == llvm::Triple::FreeBSD)
return sizeof(size_t);
else
return sizeof(pthread_mutex_t);
#endif
}