[clang][OpaquePtr] Remove call to getPointerElementType() in CodeGenModule::GetAddrOfGlobalTemporary()

This commit is contained in:
Arthur Eubanks 2022-02-11 10:39:26 -08:00
parent 595d340dce
commit 87dd3d350c
1 changed files with 5 additions and 3 deletions

View File

@ -5670,9 +5670,11 @@ ConstantAddress CodeGenModule::GetAddrOfGlobalTemporary(
getModule(), Type, false, llvm::GlobalVariable::InternalLinkage,
nullptr);
}
return ConstantAddress(
InsertResult.first->second,
InsertResult.first->second->getType()->getPointerElementType(), Align);
return ConstantAddress(InsertResult.first->second,
llvm::cast<llvm::GlobalVariable>(
InsertResult.first->second->stripPointerCasts())
->getValueType(),
Align);
}
// FIXME: If an externally-visible declaration extends multiple temporaries,