Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 583:12bda38ea366
Fixed choosing default target machine without needing to link in targets.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sun, 07 Sep 2008 17:44:25 -0700 |
parents | 3197ffdc2811 |
children | fbb1a366cfbc |
comparison
equal
deleted
inserted
replaced
582:723806dc48d8 | 583:12bda38ea366 |
---|---|
1481 return c; | 1481 return c; |
1482 } | 1482 } |
1483 | 1483 |
1484 ////////////////////////////////////////////////////////////////////////////////////////// | 1484 ////////////////////////////////////////////////////////////////////////////////////////// |
1485 | 1485 |
1486 void findDefaultTarget() | |
1487 { | |
1488 std::string err_str; | |
1489 const llvm::TargetMachineRegistry::entry* e = llvm::TargetMachineRegistry::getClosestTargetForJIT(err_str); | |
1490 if (e == 0) | |
1491 { | |
1492 error("Failed to find a default target machine: %s", err_str.c_str()); | |
1493 fatal(); | |
1494 } | |
1495 else | |
1496 { | |
1497 global.params.llvmArch = const_cast<char*>(e->Name); | |
1498 } | |
1499 } | |
1500 | |
1501 ////////////////////////////////////////////////////////////////////////////////////////// | |
1502 | |
1503 LLValue* DtoBoolean(Loc& loc, DValue* dval) | 1486 LLValue* DtoBoolean(Loc& loc, DValue* dval) |
1504 { | 1487 { |
1505 Type* dtype = dval->getType()->toBasetype(); | 1488 Type* dtype = dval->getType()->toBasetype(); |
1506 TY ty = dtype->ty; | 1489 TY ty = dtype->ty; |
1507 | 1490 |