aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorWei Wang <apollo.mobility@gmail.com>2020-08-25 10:42:54 -0700
committerHongtao Yu <hoy@fb.com>2020-08-25 11:12:38 -0700
commitae90df8e5a68c7df4ea3e552dd7f87270fbcb0c7 (patch)
treeb590128864d6546838a70be1f48882464c4068ae /llvm/lib/LTO/LTO.cpp
parent40cbb2484d72faefc9f6cd09548cd24d3fd9e9d5 (diff)
downloadllvm-ae90df8e5a68c7df4ea3e552dd7f87270fbcb0c7.zip
llvm-ae90df8e5a68c7df4ea3e552dd7f87270fbcb0c7.tar.gz
llvm-ae90df8e5a68c7df4ea3e552dd7f87270fbcb0c7.tar.bz2
[FIX] Avoid creating BFI when emitting remarks for dead functions
Dead function has its body stripped away, and can cause various analyses to panic. Also it does not make sense to apply analyses on such function. Reviewed By: xazax.hun, MaskRay, wenlei, hoy Differential Revision: https://reviews.llvm.org/D84715
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 6e1e399..6230216 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -798,7 +798,7 @@ Error LTO::linkRegularLTO(RegularLTOState::AddedModule Mod,
for (GlobalValue *GV : Mod.Keep) {
if (LivenessFromIndex && !ThinLTO.CombinedIndex.isGUIDLive(GV->getGUID())) {
if (Function *F = dyn_cast<Function>(GV)) {
- OptimizationRemarkEmitter ORE(F);
+ OptimizationRemarkEmitter ORE(F, nullptr);
ORE.emit(OptimizationRemark(DEBUG_TYPE, "deadfunction", F)
<< ore::NV("Function", F)
<< " not added to the combined module ");