[PATCH] D15996: Avoid undefined behavior in LinkAllPasses.h

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 13:34:48 PST 2016


dim added a comment.

In http://reviews.llvm.org/D15996#323997, @dim wrote:

> For the `llvm::RegionPass` part, the problem is that there is only one descendant of this class in the tree, and it isn't exposed via a header.  So create a bogus descendant, and let it call `llvm::RegionPass::runOnRegion()`.


Sigh, unfortunately clang now indeed emits a call to the pure virtual function `llvm::RegionPass::runOnRegion()`, and since that isn't defined, the program fails to link.

I guess the whole exercise to attempt to call this function is useless?  Could we maybe just delete this part (e.g. lines 196 through 197 in the new version)?


http://reviews.llvm.org/D15996





More information about the llvm-commits mailing list