summaryrefslogtreecommitdiffstats
path: root/llvm/test/C++Frontend/ptr-to-method-devirt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-13 17:09:08 +0000
committerChris Lattner <sabre@nondot.org>2007-08-13 17:09:08 +0000
commitaadc778782a65c1eb0bcbf07e6fcbd43d3d7c40d (patch)
tree85ab90b57cdb5a8fa7416a66c31c292aa3660733 /llvm/test/C++Frontend/ptr-to-method-devirt.cpp
parent5ca98c657db0ffa4e6011dc9be3c03ebd811bc50 (diff)
downloadbcm5719-llvm-aadc778782a65c1eb0bcbf07e6fcbd43d3d7c40d.tar.gz
bcm5719-llvm-aadc778782a65c1eb0bcbf07e6fcbd43d3d7c40d.zip
Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
Into: inttoptr (i64 0 to i8*) -> null This occurs in the example in PR1602. With this fixed, we now compile the example in PR1602 into fully "devirtualized" code: define void @_Z1g1S(%struct.S* noalias %s) { entry: %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i32 (...)***> [#uses=1] %tmp16 = load i32 (...)*** %tmp131415, align 4 ; <i32 (...)**> [#uses=1] %tmp26277 = load i32 (...)** %tmp16 ; <i32 (...)*> [#uses=1] %tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)* ; <void (%struct.S*)*> [#uses=1] tail call void %tmp2829( %struct.S* %s ) ret void } This still has the vtable dispatch (as required) but does not have any pointer to method cruft left. llvm-svn: 41046
Diffstat (limited to 'llvm/test/C++Frontend/ptr-to-method-devirt.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud