Manually Constructing LoopInfo via Dominator Tree

Hi,

I noticed one of the earlier posts (https://groups.google.com/g/llvm-dev/c/lVc2-0d2cRs/m/uwuOA_pXAgAJ) from llvm-dev that talked about "constructing loop info manually without any pass" by doing this:

              llvm::DominatorTree domTree{&func, func};
              llvm::LoopInfo loopInfo{&func, domTree};

However, when I try this in llvm 10.0, I get the following error:

  error: no matching function for call to ‘llvm::DominatorTree::DominatorTree(<brace-enclosed initializer list>)’
              DominatorTree domTree{&F, F};

Am I doing something really silly here? or this manual hack no longer works?

Thanks,
Bodhi

DominatorTree has the following constructor:

  explicit DominatorTree(Function &F);

That is, use

    llvm::DominatorTree DT(func);

to instantiate it.

Michael