[llvm-dev] Manually Constructing LoopInfo via Dominator Tree

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 15 15:59:34 PDT 2021


DominatorTree has the following constructor:

  explicit DominatorTree(Function &F);

That is, use

    llvm::DominatorTree DT(func);

to instantiate it.

Michael


Am Mi., 15. Sept. 2021 um 13:26 Uhr schrieb via llvm-dev
<llvm-dev at lists.llvm.org>:
>
> 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
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list