Mercurial > projects > ldc
comparison gen/runtime.cpp @ 1506:76936858d1c6
Return `void*` from _d_allocclass so LLVM doesn't do weird things with it...
This allows `-instcombine` followed by `-gvn` to do devirtualization, so add
`-gvn` in strategic places in the default pass order.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 20 Jun 2009 11:39:13 +0200 |
parents | 9344fecd24f0 |
children | 09734fb929c0 |
comparison
equal
deleted
inserted
replaced
1505:1e5a14691e77 | 1506:76936858d1c6 |
---|---|
327 // Object _d_allocclass(ClassInfo ci) | 327 // Object _d_allocclass(ClassInfo ci) |
328 { | 328 { |
329 std::string fname("_d_allocclass"); | 329 std::string fname("_d_allocclass"); |
330 std::vector<const LLType*> types; | 330 std::vector<const LLType*> types; |
331 types.push_back(classInfoTy); | 331 types.push_back(classInfoTy); |
332 const llvm::FunctionType* fty = llvm::FunctionType::get(objectTy, types, false); | 332 const llvm::FunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); |
333 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M) | 333 llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M) |
334 ->setAttributes(Attr_NoAlias); | 334 ->setAttributes(Attr_NoAlias); |
335 } | 335 } |
336 | 336 |
337 // void _d_delarray(size_t plength, void* pdata) | 337 // void _d_delarray(size_t plength, void* pdata) |