mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-28 14:10:42 +03:00
Skip superfluous IR pointer bitcasts, now that they are always opaque
This commit is contained in:
parent
ee9f3a142c
commit
d140f2a283
28 changed files with 182 additions and 399 deletions
|
@ -1221,11 +1221,8 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
|
|||
if (!irFty.arg_this->byref) {
|
||||
if (fd->interfaceVirtual) {
|
||||
// Adjust the 'this' pointer instead of using a thunk
|
||||
LLType *targetThisType = thismem->getType();
|
||||
thismem = DtoBitCast(thismem, getVoidPtrType());
|
||||
auto off = DtoConstInt(-fd->interfaceVirtual->offset);
|
||||
thismem = DtoGEP1(llvm::Type::getInt8Ty(gIR->context()), thismem, off);
|
||||
thismem = DtoBitCast(thismem, targetThisType);
|
||||
thismem = DtoGEP1(getI8Type(), thismem, off);
|
||||
}
|
||||
thismem = DtoAllocaDump(thismem, 0, "this");
|
||||
irFunc->thisArg = thismem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue