forked from OSchip/llvm-project
CGCXX: Use cast in getAddrOfCXXStructor()
All callers should be passing `CXXConstructorDecl` or `CXXDestructorDecl` here, so use `cast<>` instead of `dyn_cast<>` when setting up the `GlobalDecl`. llvm-svn: 236651
This commit is contained in:
parent
54085cdc7b
commit
d6616acb2c
|
@ -231,8 +231,7 @@ llvm::GlobalValue *CodeGenModule::getAddrOfCXXStructor(
|
|||
if (auto *CD = dyn_cast<CXXConstructorDecl>(MD)) {
|
||||
GD = GlobalDecl(CD, toCXXCtorType(Type));
|
||||
} else {
|
||||
auto *DD = dyn_cast<CXXDestructorDecl>(MD);
|
||||
GD = GlobalDecl(DD, toCXXDtorType(Type));
|
||||
GD = GlobalDecl(cast<CXXDestructorDecl>(MD), toCXXDtorType(Type));
|
||||
}
|
||||
|
||||
StringRef Name = getMangledName(GD);
|
||||
|
|
Loading…
Reference in New Issue