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)
commit5d2670c52a840266d9b2756a15a43731a74c500a
tree7188c0e324f7573e75364e4e8b3bd6fd016f9208
parent970b0d576c35c296111ffd9be6ffd04c294760db
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.

llvm-svn: 222126
llvm/lib/Analysis/ScalarEvolution.cpp