This is an archive of the discontinued LLVM Phabricator instance.

Rearrange Dom unittest to accommodate multiple tests
ClosedPublic

Authored by anemet on May 26 2017, 4:57 PM.

Details

Summary

I've taken the approach from the LoopInfo test:

  • Rather than running in the pass manager just build the analyses manually
  • Split out the common parts (makeLLVMModule, runWithDomTree) into helpers

Diff Detail

Repository
rL LLVM

Event Timeline

anemet created this revision.May 26 2017, 4:57 PM
sanjoy accepted this revision.May 26 2017, 6:43 PM

lgtm

unittests/IR/DominatorTreeTest.cpp
32 ↗(On Diff #100504)

I'd write this as DominatorTreeBase<BasicBlock> PDT(/*isPostDom*/true)

39 ↗(On Diff #100504)

I'd either assert or ASSERT that the module was successfully parsed. (This part's optional) I'd also prefer StringRef as an argument, and also in the declaration of ModuleString.

This revision is now accepted and ready to land.May 26 2017, 6:43 PM
anemet marked 2 inline comments as done.May 26 2017, 9:06 PM
This revision was automatically updated to reflect the committed changes.