Changeset 1524:b265fb6ce15b
- Timestamp:
- 07/06/09 18:56:11
(3 years ago)
- Author:
- Robert Clipsham <robert@octarineparrot.com>
- Parents:
1523:833337c65fd3 1522:6766485fb584
- branch:
- default
- Message:
Merge.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1521 |
r1524 |
|
| 319 | 319 | else if (!noDefaultLib) |
|---|
| 320 | 320 | { |
|---|
| | 321 | #if !DMDV2 |
|---|
| 321 | 322 | global.params.linkswitches->push(mem.strdup("-lldc-runtime")); |
|---|
| 322 | 323 | global.params.linkswitches->push(mem.strdup("-ltango-cc-tango")); |
|---|
| … | … | |
| 325 | 326 | // with linking order |
|---|
| 326 | 327 | global.params.linkswitches->push(mem.strdup("-lldc-runtime")); |
|---|
| | 328 | #endif |
|---|
| 327 | 329 | } |
|---|
| 328 | 330 | |
|---|
| r1523 |
r1524 |
|
| 5 | 5 | |
|---|
| 6 | 6 | #include "gen/llvm.h" |
|---|
| | 7 | #include "gen/llvm-version.h" |
|---|
| 7 | 8 | #include "llvm/LinkAllVMCore.h" |
|---|
| 8 | 9 | #include "llvm/Linker.h" |
|---|
| | 10 | #if LLVM_REV >= 74640 |
|---|
| | 11 | #include "llvm/LLVMContext.h" |
|---|
| | 12 | #endif |
|---|
| 9 | 13 | #include "llvm/System/Signals.h" |
|---|
| 10 | 14 | #include "llvm/Target/SubtargetFeature.h" |
|---|
| … | … | |
| 12 | 16 | #include "llvm/Target/TargetOptions.h" |
|---|
| 13 | 17 | #include "llvm/Target/TargetMachineRegistry.h" |
|---|
| | 18 | #if LLVM_REV >= 73610 |
|---|
| | 19 | #include "llvm/Target/TargetSelect.h" |
|---|
| | 20 | #endif |
|---|
| 14 | 21 | |
|---|
| 15 | 22 | #include <stdio.h> |
|---|
| … | … | |
| 398 | 405 | fatal(); |
|---|
| 399 | 406 | |
|---|
| | 407 | #if LLVM_REV >= 74640 |
|---|
| | 408 | llvm::Module mod("dummy", llvm::getGlobalContext()); |
|---|
| | 409 | #else |
|---|
| 400 | 410 | llvm::Module mod("dummy"); |
|---|
| | 411 | #endif |
|---|
| 401 | 412 | |
|---|
| 402 | 413 | // override triple if needed |
|---|
| … | … | |
| 424 | 435 | mod.setTargetTriple(global.params.targetTriple); |
|---|
| 425 | 436 | |
|---|
| 426 | | // Allocate target machine. First, check whether the user has |
|---|
| 427 | | // explicitly specified an architecture to compile for. |
|---|
| | 437 | // Allocate target machine. |
|---|
| | 438 | |
|---|
| | 439 | // first initialize llvm |
|---|
| | 440 | #if LLVM_REV >= 73610 |
|---|
| | 441 | #define LLVM_TARGET(A) LLVMInitialize##A##Target(); LLVMInitialize##A##AsmPrinter(); |
|---|
| | 442 | // this is defined to be LLVM_TARGET(target name 1) LLVM_TARGET(target name 2) ... |
|---|
| | 443 | LDC_TARGETS |
|---|
| | 444 | #undef LLVM_TARGET |
|---|
| | 445 | #endif |
|---|
| | 446 | |
|---|
| | 447 | // Check whether the user has explicitly specified an architecture to compile for. |
|---|
| 428 | 448 | if (mArch == 0) |
|---|
| 429 | 449 | { |
|---|
| … | … | |
| 909 | 929 | char* filename = m->objfile->name->str; |
|---|
| 910 | 930 | |
|---|
| | 931 | #if LLVM_REV >= 74640 |
|---|
| | 932 | llvm::Linker linker(name, name, llvm::getGlobalContext()); |
|---|
| | 933 | #else |
|---|
| 911 | 934 | llvm::Linker linker(name, name); |
|---|
| | 935 | #endif |
|---|
| 912 | 936 | std::string errormsg; |
|---|
| 913 | 937 | for (int i = 0; i < llvmModules.size(); i++) |
|---|
| r1521 |
r1524 |
|
| 337 | 337 | // Object _d_allocclass(ClassInfo ci) |
|---|
| 338 | 338 | { |
|---|
| | 339 | #if DMDV2 |
|---|
| | 340 | std::string fname("_d_newclass"); |
|---|
| | 341 | #else |
|---|
| 339 | 342 | std::string fname("_d_allocclass"); |
|---|
| | 343 | #endif |
|---|
| 340 | 344 | std::vector<const LLType*> types; |
|---|
| 341 | 345 | types.push_back(classInfoTy); |
|---|
| r1523 |
r1524 |
|
| 1 | 1 | #include "gen/llvm.h" |
|---|
| | 2 | #include "gen/llvm-version.h" |
|---|
| | 3 | #if LLVM_REV >= 74640 |
|---|
| | 4 | #include "llvm/LLVMContext.h" |
|---|
| | 5 | #endif |
|---|
| 2 | 6 | #include "llvm/Module.h" |
|---|
| 3 | 7 | #include "llvm/Attributes.h" |
|---|
| … | … | |
| 150 | 154 | { |
|---|
| 151 | 155 | Logger::println("building module"); |
|---|
| | 156 | #if LLVM_REV >= 74640 |
|---|
| | 157 | M = new llvm::Module("ldc internal runtime", llvm::getGlobalContext()); |
|---|
| | 158 | #else |
|---|
| 152 | 159 | M = new llvm::Module("ldc internal runtime"); |
|---|
| | 160 | #endif |
|---|
| 153 | 161 | |
|---|
| 154 | 162 | Logger::println("building basic types"); |
|---|