We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3118b2 commit e362e7aCopy full SHA for e362e7a
clang/lib/CodeGen/CodeGenModule.cpp
@@ -5100,8 +5100,8 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
5100
LT = getFunctionLinkage(GD);
5101
AS = Aliasee->getType()->getPointerAddressSpace();
5102
} else {
5103
- const auto *VarD = cast<VarDecl>(GD.getDecl());
5104
- AS = ArgInfoAddressSpace(GetGlobalVarAddressSpace(VarD));
+ AS = ArgInfoAddressSpace(
+ GetGlobalVarAddressSpace(dyn_cast<VarDecl>(GD.getDecl())));
5105
Aliasee = GetOrCreateLLVMGlobal(AA->getAliasee(), DeclTy->getPointerTo(AS),
5106
/*D=*/nullptr);
5107
if (const auto *VD = dyn_cast<VarDecl>(GD.getDecl()))
0 commit comments