Don't assert if we can't constant fold extract/insertvalue
authorHal Finkel <hfinkel@anl.gov>
Wed, 10 Jul 2013 22:51:01 +0000 (22:51 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 10 Jul 2013 22:51:01 +0000 (22:51 +0000)
commitb31366da8272e2e2149e5d044b0af1c01d81786f
treed849fda004df08e2d0dea61d8f9cd1fcbec06fa7
parent555aa899c63e4b6b854dc5fa71808b6a400191fc
Don't assert if we can't constant fold extract/insertvalue

A non-constant-foldable static initializer expression containing insertvalue or
extractvalue had been causing an assert:

  Constants.cpp:1971: Assertion `FC && "ExtractValue constant expr couldn't be
                                 folded!"' failed.

Now we report a more-sensible "Unsupported expression in static initializer"
error instead.

Fixes PR15417.

llvm-svn: 186044
llvm/lib/IR/Constants.cpp
llvm/test/Other/nonconst-static-ev.ll [new file with mode: 0644]
llvm/test/Other/nonconst-static-iv.ll [new file with mode: 0644]