ScalarEvolution: Construct SCEVDivision's Derived type instead of itself
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 17 Nov 2014 11:27:45 +0000 (11:27 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 17 Nov 2014 11:27:45 +0000 (11:27 +0000)
commit2014c91510d124fbdbd993074ab023f21f614a55
tree5d4c2aea0675b95a01c54553f00abe6d312205d6
parent8f832fce3b4613bcdd35362b2fb0ae84c7d4d78d
ScalarEvolution: Construct SCEVDivision's Derived type instead of itself

SCEVDivision::divide constructed an object of SCEVDivision<Derived>
instead of Derived.  divide would call visit which would cast the
SCEVDivision<Derived> to type Derived.  As it happens,
SCEVDivision<Derived> and Derived currently have the same layout but
this is fragile and grounds for UB.

Instead, just construct Derived.  No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222126 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp