Mercurial > projects > ldc
comparison gen/statements.cpp @ 1529:ad7f2f1862d6
Adjust LDC to work with the LLVMContext LLVM changes.
This means we now require a fairly new LLVM revision. I use 75234.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 10 Jul 2009 21:30:02 +0200 |
parents | e1e93343fc11 |
children | 8ca25bd765a3 |
comparison
equal
deleted
inserted
replaced
1528:15f1707721fa | 1529:ad7f2f1862d6 |
---|---|
816 } | 816 } |
817 // build static array for ptr or final array | 817 // build static array for ptr or final array |
818 const LLType* elemTy = DtoType(condition->type); | 818 const LLType* elemTy = DtoType(condition->type); |
819 const llvm::ArrayType* arrTy = llvm::ArrayType::get(elemTy, inits.size()); | 819 const llvm::ArrayType* arrTy = llvm::ArrayType::get(elemTy, inits.size()); |
820 LLConstant* arrInit = llvm::ConstantArray::get(arrTy, inits); | 820 LLConstant* arrInit = llvm::ConstantArray::get(arrTy, inits); |
821 llvm::GlobalVariable* arr = new llvm::GlobalVariable(arrTy, true, llvm::GlobalValue::InternalLinkage, arrInit, ".string_switch_table_data", gIR->module); | 821 llvm::GlobalVariable* arr = new llvm::GlobalVariable(*gIR->module, arrTy, true, llvm::GlobalValue::InternalLinkage, arrInit, ".string_switch_table_data"); |
822 | 822 |
823 const LLType* elemPtrTy = getPtrToType(elemTy); | 823 const LLType* elemPtrTy = getPtrToType(elemTy); |
824 LLConstant* arrPtr = llvm::ConstantExpr::getBitCast(arr, elemPtrTy); | 824 LLConstant* arrPtr = llvm::ConstantExpr::getBitCast(arr, elemPtrTy); |
825 | 825 |
826 // build the static table | 826 // build the static table |
1378 ////////////////////////////////////////////////////////////////////////////// | 1378 ////////////////////////////////////////////////////////////////////////////// |
1379 | 1379 |
1380 static LLConstant* generate_unique_critical_section() | 1380 static LLConstant* generate_unique_critical_section() |
1381 { | 1381 { |
1382 const LLType* Mty = DtoMutexType(); | 1382 const LLType* Mty = DtoMutexType(); |
1383 return new llvm::GlobalVariable(Mty, false, llvm::GlobalValue::InternalLinkage, LLConstant::getNullValue(Mty), ".uniqueCS", gIR->module); | 1383 return new llvm::GlobalVariable(*gIR->module, Mty, false, llvm::GlobalValue::InternalLinkage, LLConstant::getNullValue(Mty), ".uniqueCS"); |
1384 } | 1384 } |
1385 | 1385 |
1386 void SynchronizedStatement::toIR(IRState* p) | 1386 void SynchronizedStatement::toIR(IRState* p) |
1387 { | 1387 { |
1388 Logger::println("SynchronizedStatement::toIR(): %s", loc.toChars()); | 1388 Logger::println("SynchronizedStatement::toIR(): %s", loc.toChars()); |