hanchenye-llvm-project/llvm/lib/Transforms/Utils
Chijun Sima e8263f33d9 [SimplifyCFG] Remove pointer from SmallPtrSet before deletion
Summary:
Previously, `eraseFromParent()` calls `delete` which invalidates the value of the pointer. Copying the value of the pointer later is undefined behavior in C++11 and implementation-defined (which may cause a segfault on implementations having strict pointer safety) in C++14.

This patch removes the BasicBlock pointer from related SmallPtrSet before `delete` invalidates it in the SimplifyCFG pass.

Reviewers: kuhar, dmgreen, davide, trentxintong

Reviewed By: kuhar, dmgreen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D50717

llvm-svn: 339773
2018-08-15 13:56:21 +00:00
..
ASanStackFrameLayout.cpp [asan] Add a full redzone after every stack variable 2017-11-18 01:13:18 +00:00
AddDiscriminators.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
BasicBlockUtils.cpp [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
BreakCriticalEdges.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
BuildLibCalls.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
BypassSlowDivision.cpp Move Analysis/Utils/Local.h back to Transforms 2018-06-04 21:23:21 +00:00
CMakeLists.txt [NFC] Factor out implicit control flow logic from GVN 2018-08-07 01:47:20 +00:00
CallPromotionUtils.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
CloneFunction.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
CloneModule.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
CodeExtractor.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
CtorUtils.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
DemoteRegToStack.cpp Move Analysis/Utils/Local.h back to Transforms 2018-06-04 21:23:21 +00:00
EntryExitInstrumenter.cpp EntryExitInstrumenter: Handle musttail calls 2018-04-06 10:14:09 +00:00
EscapeEnumerator.cpp Move Analysis/Utils/Local.h back to Transforms 2018-06-04 21:23:21 +00:00
Evaluator.cpp [Evaluator] Examine alias when evaluating function call 2018-07-10 16:34:23 +00:00
FlattenCFG.cpp Move Analysis/Utils/Local.h back to Transforms 2018-06-04 21:23:21 +00:00
FunctionComparator.cpp Use SmallPtrSet explicitly for SmallSets with pointer types (NFC). 2018-06-12 11:16:56 +00:00
FunctionImportUtils.cpp [ThinLTO] Clear dllimport when setting dso_local. 2018-03-13 15:24:51 +00:00
GlobalStatus.cpp [GlobalOpt] Fix exponential compile-time with selects. 2018-01-31 20:42:25 +00:00
ImplicitControlFlowTracking.cpp [NFC] Add sanitizing assertion to ICF tracker 2018-08-15 05:50:38 +00:00
ImportedFunctionsInliningStatistics.cpp [Transforms] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:47:57 +00:00
InlineFunction.cpp Enrich inline messages 2018-08-05 14:53:08 +00:00
InstructionNamer.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
IntegerDivision.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
LCSSA.cpp [DebugInfo][LCSSA] Preserve debug location in lcssa phis 2018-07-31 14:54:52 +00:00
LLVMBuild.txt
LibCallsShrinkWrap.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Local.cpp [Local] Add dbg location on unreachable inst in changeToUnreachable 2018-08-07 20:21:56 +00:00
LoopRotationUtils.cpp [DebugInfo] Refactor DbgInfoIntrinsic class hierarchy. 2018-08-06 03:59:47 +00:00
LoopSimplify.cpp Move Analysis/Utils/Local.h back to Transforms 2018-06-04 21:23:21 +00:00
LoopUnroll.cpp [UnrollAndJam] New Unroll and Jam pass 2018-07-01 12:47:30 +00:00
LoopUnrollAndJam.cpp [UnJ] Rename hasInvariantIterationCount to hasIterationCountInvariantInParent NFC 2018-08-15 10:59:41 +00:00
LoopUnrollPeel.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
LoopUnrollRuntime.cpp Use SmallPtrSet explicitly for SmallSets with pointer types (NFC). 2018-06-12 11:16:56 +00:00
LoopUtils.cpp [UnJ] Rename hasInvariantIterationCount to hasIterationCountInvariantInParent NFC 2018-08-15 10:59:41 +00:00
LoopVersioning.cpp [LoopVersioning] Don't modify the list that we iterate over in addPHINodes 2018-05-22 08:33:02 +00:00
LowerInvoke.cpp Support a funclet operand bundle in LowerInvoke 2018-05-09 00:53:50 +00:00
LowerMemIntrinsics.cpp [LowerMemIntrinsics] Update uses of deprecated MemIntrinsic::getAlignment API (NFC) 2018-02-05 22:23:58 +00:00
LowerSwitch.cpp [LowerSwitch] Fixed faulty PHI nodes 2018-07-10 12:06:16 +00:00
Mem2Reg.cpp Transforms: Introduce Transforms/Utils.h rather than spreading the declarations amongst Scalar.h and IPO.h 2018-03-28 17:44:36 +00:00
MetaRenamer.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
ModuleUtils.cpp
NameAnonGlobals.cpp
OrderedInstructions.cpp [PredicateInfo] Order instructions in different BBs by DFSNumIn. 2018-06-20 17:42:01 +00:00
PredicateInfo.cpp [PredicateInfo] Use custom mangling to support ssa_copy with unnamed types. 2018-07-24 14:49:52 +00:00
PromoteMemoryToRegister.cpp [DebugInfo] Refactor DbgInfoIntrinsic class hierarchy. 2018-08-06 03:59:47 +00:00
SSAUpdater.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
SSAUpdaterBulk.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
SanitizerStats.cpp
SimplifyCFG.cpp [SimplifyCFG] Remove pointer from SmallPtrSet before deletion 2018-08-15 13:56:21 +00:00
SimplifyIndVar.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
SimplifyLibCalls.cpp [SimplifyLibCalls] don't drop fast-math-flags on trig reflection folds (retry r339608) 2018-08-13 21:49:19 +00:00
SplitModule.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
StripGCRelocates.cpp Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
StripNonLineTableDebugInfo.cpp Fix some layering in StripNonLineTableDebugInfo, moving its declaration from IPO.h to Utils.h to match its implementation 2018-03-29 22:42:08 +00:00
SymbolRewriter.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
UnifyFunctionExitNodes.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
Utils.cpp [instsimplify] Move the instsimplify pass to use more obvious file names 2018-06-29 23:36:03 +00:00
VNCoercion.cpp [GVN] Avoid casting a vector of size less than 8 bits to i8 2018-06-21 21:43:20 +00:00
ValueMapper.cpp Teach ValueMapper to use ODR uniqued types when available 2018-01-30 20:16:32 +00:00