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)
commit10050d19e857396e65289c05ce9714e0a570deed
tree4992288578a0e5278d036a914aab6b6498b326ca
parentb0d599334fea18023c0b219b2e7bc2beb7298ba0
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186044 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Constants.cpp
test/Other/nonconst-static-ev.ll [new file with mode: 0644]
test/Other/nonconst-static-iv.ll [new file with mode: 0644]