[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:
Tomas Lindquist Olsen
2008-06-21 02:48:53 +02:00
parent ddfa41938f
commit f8b421d4ac
6 changed files with 74 additions and 44 deletions
+16
View File
@@ -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);
}
}