[PATCH] D28778: Use a test fixture for LoopInfoTest.
Sanjoy Das via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 17 10:18:19 PST 2017
sanjoy requested changes to this revision.
sanjoy added inline comments.
This revision now requires changes to proceed.
================
Comment at: unittests/Analysis/LoopInfoTest.cpp:26
+ // Compute the dominator tree and the loop info for the function.
+ std::unique_ptr<DominatorTree> DT(new DominatorTree(*F));
+ std::unique_ptr<LoopInfo> LI(new LoopInfo(*DT));
----------------
Why `unique_ptr`? Why not just:
```
DominatorTree DT(F);
LoopInfo LI(DT);
```
?
Also: why do you need the fixture at all? Why not just have `runWithLoopInfo` be a (`static`) free function.
https://reviews.llvm.org/D28778
More information about the llvm-commits
mailing list