forked from OSchip/llvm-project
Don't dereference a dyn_cast<> result - use cast<> instead. NFCI.
We were relying on the dyn_cast<> succeeding - better use cast<> and have it assert that its the correct type than dereference a null result.
This commit is contained in:
parent
0fe91ad463
commit
8930032f53
|
@ -372,7 +372,7 @@ void CodeGenModule::checkAliases() {
|
|||
for (const GlobalDecl &GD : Aliases) {
|
||||
StringRef MangledName = getMangledName(GD);
|
||||
llvm::GlobalValue *Entry = GetGlobalValue(MangledName);
|
||||
auto *Alias = dyn_cast<llvm::GlobalIndirectSymbol>(Entry);
|
||||
auto *Alias = cast<llvm::GlobalIndirectSymbol>(Entry);
|
||||
Alias->replaceAllUsesWith(llvm::UndefValue::get(Alias->getType()));
|
||||
Alias->eraseFromParent();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue