forked from OSchip/llvm-project
bea19a9493
Summary: Previously, if a function accepts an optional DT pointer, ``` void Foo (.., DominatorTree * DT = nullptr) { ... if(DT) DomTreeUpdater(*DT, ...).insertEdge(A, B); if(DT){ DomTreeUpdater DTU(*DT, ...); ... // Construct the update vector and applyUpdates } ... if(DT){ DomTreeUpdater DTU(*DT, ...); ... // Construct the update vector and applyUpdates } } ``` After this patch, it can be simplified as ``` void Foo (.., DominatorTree * DT = nullptr) { DomTreeUpdater DTU(DT, ...); ... DTU.insertEdge(A, B); if(DT){ ... // Construct the update vector and applyUpdates } ... if(DT){ ... // Construct the update vector and applyUpdates } } ``` Patch by Chijun Sima <simachijun@gmail.com>. Reviewers: kuhar, brzycki, dmgreen Reviewed By: kuhar Author: NutshellySima Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48923 llvm-svn: 336294 |
||
---|---|---|
.. | ||
AsmWriterTest.cpp | ||
AttributesTest.cpp | ||
BasicBlockTest.cpp | ||
CFGBuilder.cpp | ||
CFGBuilder.h | ||
CMakeLists.txt | ||
ConstantRangeTest.cpp | ||
ConstantsTest.cpp | ||
DebugInfoTest.cpp | ||
DebugTypeODRUniquingTest.cpp | ||
DeferredDominanceTest.cpp | ||
DomTreeUpdaterTest.cpp | ||
DominatorTreeBatchUpdatesTest.cpp | ||
DominatorTreeTest.cpp | ||
FunctionTest.cpp | ||
IRBuilderTest.cpp | ||
InstructionsTest.cpp | ||
IntrinsicsTest.cpp | ||
LegacyPassManagerTest.cpp | ||
MDBuilderTest.cpp | ||
ManglerTest.cpp | ||
MetadataTest.cpp | ||
ModuleTest.cpp | ||
PassBuilderCallbacksTest.cpp | ||
PassManagerTest.cpp | ||
PatternMatch.cpp | ||
TypeBuilderTest.cpp | ||
TypesTest.cpp | ||
UseTest.cpp | ||
UserTest.cpp | ||
ValueHandleTest.cpp | ||
ValueMapTest.cpp | ||
ValueTest.cpp | ||
VerifierTest.cpp | ||
WaymarkTest.cpp |