diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-11-08 13:06:07 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-11-08 13:06:07 +0000 |
commit | 8930032f53322405ca2d06cac78b9503542e5b62 (patch) | |
tree | 503dcffac035e63554fc71f89bdb8901a350bda4 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 0fe91ad463fea9d08cbcd640a62aa9ca2d8d05e0 (diff) | |
download | llvm-8930032f53322405ca2d06cac78b9503542e5b62.zip llvm-8930032f53322405ca2d06cac78b9503542e5b62.tar.gz llvm-8930032f53322405ca2d06cac78b9503542e5b62.tar.bz2 |
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.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index ccf5d24..d8b819c 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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(); } |