mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-10-12 09:57:00 +02:00
[svn r305] Started support for custom class allocators/deallocators. Allocators with more than one argument still need to be fixed.
Removed the LLVM stacktrace code from mars.c. Moved the LLVM based default target detection code from mars.c to llvmhelpers.cpp.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "gen/llvm.h"
|
||||
#include "llvm/Target/TargetMachineRegistry.h"
|
||||
|
||||
#include "mars.h"
|
||||
#include "init.h"
|
||||
@@ -1096,3 +1097,18 @@ LLConstant* DtoTypeInfoOf(Type* type, bool base)
|
||||
return llvm::ConstantExpr::getBitCast(c, typeinfotype);
|
||||
return c;
|
||||
}
|
||||
|
||||
void findDefaultTarget()
|
||||
{
|
||||
std::string err_str;
|
||||
const llvm::TargetMachineRegistry::entry* e = llvm::TargetMachineRegistry::getClosestTargetForJIT(err_str);
|
||||
if (e == 0)
|
||||
{
|
||||
error("Failed to find a default target machine: %s", err_str.c_str());
|
||||
fatal();
|
||||
}
|
||||
else
|
||||
{
|
||||
global.params.llvmArch = const_cast<char*>(e->Name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user