Merge remote-tracking branch 'origin/master' into merge-2.064

Conflicts:
	gen/runtime.cpp
	runtime/CMakeLists.txt
This commit is contained in:
Kai Nacke
2013-12-08 19:29:10 +01:00
4 changed files with 39 additions and 6 deletions

View File

@@ -570,14 +570,17 @@ static void registerPredefinedTargetVersions() {
VersionCondition::addPredefinedGlobalIdent("Cygwin");
break;
case llvm::Triple::Linux:
VersionCondition::addPredefinedGlobalIdent("linux");
VersionCondition::addPredefinedGlobalIdent("Posix");
#if LDC_LLVM_VER >= 302
if (global.params.targetTriple.getEnvironment() == llvm::Triple::Android)
{
VersionCondition::addPredefinedGlobalIdent("Android");
}
else
#endif
{
VersionCondition::addPredefinedGlobalIdent("linux");
VersionCondition::addPredefinedGlobalIdent("Posix");
}
break;
case llvm::Triple::Haiku:
VersionCondition::addPredefinedGlobalIdent("Haiku");
@@ -622,8 +625,6 @@ static void registerPredefinedTargetVersions() {
#if LDC_LLVM_VER >= 302
case llvm::Triple::Android:
VersionCondition::addPredefinedGlobalIdent("Android");
VersionCondition::addPredefinedGlobalIdent("linux");
VersionCondition::addPredefinedGlobalIdent("Posix");
break;
#endif
default:

View File

@@ -224,7 +224,7 @@ LLValue* DtoNestedContext(Loc loc, Dsymbol* sym)
return llvm::ConstantPointerNull::get(getVoidPtrType());
}
struct FuncDeclaration* frameToPass = 0;
FuncDeclaration* frameToPass = 0;
if (AggregateDeclaration *ad = sym->isAggregateDeclaration()) {
// If sym is a nested struct or a nested class, pass the frame
// of the function where sym is declared.

View File

@@ -168,6 +168,18 @@ static LLType* rt_dg2()
return LLStructType::get(gIR->context(), types, false);
}
template<typename DECL>
static void ensureDecl(DECL *decl, const char *msg)
{
if (!decl || !decl->type)
{
Logger::println("Missing class declaration: %s\n", msg);
error(Loc(), "Missing class declaration: %s", msg);
errorSupplemental(Loc(), "Please check that object.di is included and valid");
fatal();
}
}
static void LLVM_D_BuildRuntimeModule()
{
Logger::println("building runtime module");
@@ -187,10 +199,15 @@ static void LLVM_D_BuildRuntimeModule()
LLType* wstringTy = DtoType(Type::twchar->arrayOf());
LLType* dstringTy = DtoType(Type::tdchar->arrayOf());
ensureDecl(ClassDeclaration::object, "Object");
LLType* objectTy = DtoType(ClassDeclaration::object->type);
ensureDecl(Type::typeinfoclass, "TypeInfo_Class");
LLType* classInfoTy = DtoType(Type::typeinfoclass->type);
ensureDecl(Type::dtypeinfo, "DTypeInfo");
LLType* typeInfoTy = DtoType(Type::dtypeinfo->type);
ensureDecl(Type::typeinfoassociativearray, "TypeInfo_AssociativeArray");
LLType* aaTypeInfoTy = DtoType(Type::typeinfoassociativearray->type);
ensureDecl(Module::moduleinfo, "ModuleInfo");
LLType* moduleInfoPtrTy = getPtrToType(DtoType(Module::moduleinfo->type));
LLType* aaTy = rt_ptr(LLStructType::get(gIR->context()));

View File

@@ -89,6 +89,7 @@ if(APPLE)
endif()
file(GLOB_RECURSE CORE_D_UNIX ${RUNTIME_DIR}/src/core/sys/posix/*.d)
file(GLOB_RECURSE CORE_D_FREEBSD ${RUNTIME_DIR}/src/core/sys/freebsd/*.d)
file(GLOB_RECURSE CORE_D_LINUX ${RUNTIME_DIR}/src/core/sys/linux/*.d)
file(GLOB_RECURSE CORE_D_OSX ${RUNTIME_DIR}/src/core/sys/osx/*.d)
file(GLOB_RECURSE CORE_D_WIN ${RUNTIME_DIR}/src/core/sys/windows/*.d)
set(CORE_D_SYS)
@@ -98,7 +99,21 @@ if(UNIX)
if(${CMAKE_SYSTEM} MATCHES "FreeBSD")
list(APPEND CORE_D_SYS ${CORE_D_FREEBSD})
endif()
list(APPEND DCRT_ASM ${RUNTIME_DIR}/src/core/threadasm.S)
if(${CMAKE_SYSTEM} MATCHES "Linux")
list(APPEND CORE_D_SYS ${CORE_D_LINUX})
endif()
# Assembler support was rewritten in CMake 2.8.5.
# The assembler file must be passed to gcc but prior to this
# version it is passed to as. This results in a bunch of
# error message. This is only critical for non-x86 platforms.
# On x86/x86-64 the file can safely be ignored.
if("${CMAKE_VERSION}" MATCHES "^2\\.8\\.[01234]($|\\..*)")
message(WARNING "Excluding core/threadasm.S from build because of missing CMake support.")
message(WARNING "This file is required for certain non-x86 platforms.")
message(WARNING "Please consider updating CMake to at least 2.8.5.")
else()
list(APPEND DCRT_ASM ${RUNTIME_DIR}/src/core/threadasm.S)
endif()
if(APPLE)
list(APPEND CORE_D_SYS ${CORE_D_OSX})
endif()