diff options
author | Wei Wang <apollo.mobility@gmail.com> | 2020-08-25 10:42:54 -0700 |
---|---|---|
committer | Hongtao Yu <hoy@fb.com> | 2020-08-25 11:12:38 -0700 |
commit | ae90df8e5a68c7df4ea3e552dd7f87270fbcb0c7 (patch) | |
tree | b590128864d6546838a70be1f48882464c4068ae /llvm/lib/LTO/LTO.cpp | |
parent | 40cbb2484d72faefc9f6cd09548cd24d3fd9e9d5 (diff) | |
download | llvm-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.cpp | 2 |
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 "); |