comparison gen/statements.cpp @ 1534:8ca25bd765a3

Build fix for the latest LLVMContext changes (LLVM r75445) This shouldn't break the build with older LLVM revs. We include LLVMContext.h in gen/llvm.h now to make the transition a little bit easier.
author Benjamin Kramer <benny.kra@gmail.com>
date Mon, 13 Jul 2009 12:17:58 +0200
parents ad7f2f1862d6
children 61f12f4651b5
comparison
equal deleted inserted replaced
1533:d1652c8fb4f6 1534:8ca25bd765a3
112 // and then contains a return (exp); statement. Since the actual 112 // and then contains a return (exp); statement. Since the actual
113 // return type remains i32, we just throw away the exp value 113 // return type remains i32, we just throw away the exp value
114 // and return 0 instead 114 // and return 0 instead
115 // if we're not in main, just bitcast 115 // if we're not in main, just bitcast
116 if (p->topfunc() == p->mainFunc) 116 if (p->topfunc() == p->mainFunc)
117 v = llvm::Constant::getNullValue(p->mainFunc->getReturnType()); 117 v = llvm::getGlobalContext().getNullValue(p->mainFunc->getReturnType());
118 else 118 else
119 v = gIR->ir->CreateBitCast(v, p->topfunc()->getReturnType(), "tmp"); 119 v = gIR->ir->CreateBitCast(v, p->topfunc()->getReturnType(), "tmp");
120 120
121 if (Logger::enabled()) 121 if (Logger::enabled())
122 Logger::cout() << "return value after cast: " << *v << '\n'; 122 Logger::cout() << "return value after cast: " << *v << '\n';
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(*gIR->module, Mty, false, llvm::GlobalValue::InternalLinkage, LLConstant::getNullValue(Mty), ".uniqueCS"); 1383 return new llvm::GlobalVariable(*gIR->module, Mty, false, llvm::GlobalValue::InternalLinkage, llvm::getGlobalContext().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());