[llvm-dev] Is RegionInfoBase meant to be subclassed?

Félix Cloutier via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 19 14:38:06 PST 2016


Hey all,

I'm trying to use LLVM's graph utilities to do some graph-related work on some of my own classes. More precisely, I'm interested in getting regions.

RegionInfoBase has a number of important private fields and methods: the dominator tree, post-dominator tree, dominance frontier fields are all private, as is the constructor and the destructor. The two known concrete subclasses of RegionInfo are friended, and access these members directly. It seems to me that this makes subclassing impossible, even as I don't see any reason that the algorithms wouldn't work (though I could be mistaken).

There are ways to go around the access levels on most class members, but I can't think of anything for the constructor and destructor that won't upset the compiler. Short of #defining MachinRegionInfo to my class's name (which probably violates ODR?), is there anything that I can do? Otherwise, would it be acceptable to make these members protected in LLVM?

Félix

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161119/561d65fb/attachment.html>


More information about the llvm-dev mailing list