[PlaceSafepoints] Fix a bug that came in with rL236672.

Transfer the calling convention from the invoke being replaced by
PlaceStatepoints to the new invoke to gc.statepoint created.  Add a test
case that would have caught this issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjoy Das
2015-05-15 00:26:21 +00:00
parent 4c4b944e83
commit fa93d0e1c6
2 changed files with 44 additions and 0 deletions

View File

@@ -951,6 +951,8 @@ static Value *ReplaceWithStatepoint(const CallSite &CS, /* to replace */
ToReplace->getUnwindDest(), makeArrayRef(CS.arg_begin(), CS.arg_end()),
None, None, "safepoint_token");
Invoke->setCallingConv(ToReplace->getCallingConv());
// In case if we can handle this set of attributes - set up function
// attributes directly on statepoint and return attributes later for
// gc_result intrinsic.