aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorShraiysh Vaishay <shraiysh@gmail.com>2023-04-15 21:16:16 -0500
committerShraiysh Vaishay <shraiysh@gmail.com>2023-04-17 13:40:51 -0500
commit7021182d6b43de9488ab70de626192ce70b3a4a6 (patch)
tree193d14c63ce01bf680f9919b5cbb4b11a944de8b /llvm/lib/LTO/LTO.cpp
parent63395cb0b69dee69ec5d5d0d552482c607861178 (diff)
downloadllvm-7021182d6b43de9488ab70de626192ce70b3a4a6.zip
llvm-7021182d6b43de9488ab70de626192ce70b3a4a6.tar.gz
llvm-7021182d6b43de9488ab70de626192ce70b3a4a6.tar.bz2
[nfc][llvm] Replace pointer cast functions in PointerUnion by llvm casting functions.
This patch replaces the uses of PointerUnion.is function by llvm::isa, PointerUnion.get function by llvm::cast, and PointerUnion.dyn_cast by llvm::dyn_cast_if_present. This is according to the FIXME in the definition of the class PointerUnion. This patch does not remove them as they are being used in other subprojects. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D148449
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index ff57f30..15b6e22 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -788,7 +788,7 @@ LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
ModuleSymbolTable::Symbol Msym = *MsymI++;
Skip();
- if (GlobalValue *GV = Msym.dyn_cast<GlobalValue *>()) {
+ if (GlobalValue *GV = dyn_cast_if_present<GlobalValue *>(Msym)) {
if (Res.Prevailing) {
if (Sym.isUndefined())
continue;
@@ -826,7 +826,8 @@ LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
GV->setDLLStorageClass(GlobalValue::DLLStorageClassTypes::
DefaultStorageClass);
}
- } else if (auto *AS = Msym.dyn_cast<ModuleSymbolTable::AsmSymbol *>()) {
+ } else if (auto *AS =
+ dyn_cast_if_present<ModuleSymbolTable::AsmSymbol *>(Msym)) {
// Collect non-prevailing symbols.
if (!Res.Prevailing)
NonPrevailingAsmSymbols.insert(AS->first);