PlaceSafepoints: use IRBuilder helpers

Use the IRBuilder helpers for gc.statepoint and gc.result, instead of
coding the construction by hand. Note that the gc.statepoint IRBuilder
handles only CallInst, not InvokeInst; retain that part of hand-coding.

Differential Revision: http://reviews.llvm.org/D7518

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230591 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ramkumar Ramachandra
2015-02-26 00:35:56 +00:00
parent 341f17d0f0
commit e10581ac39
4 changed files with 59 additions and 45 deletions

View File

@@ -260,6 +260,17 @@ CallInst *IRBuilderBase::CreateGCStatepoint(Value *ActualCallee,
return createCallHelper(FnStatepoint, args, this, Name);
}
CallInst *IRBuilderBase::CreateGCStatepoint(Value *ActualCallee,
ArrayRef<Use> CallArgs,
ArrayRef<Value *> DeoptArgs,
ArrayRef<Value *> GCArgs,
const Twine &Name) {
std::vector<Value *> VCallArgs;
for (auto &U : CallArgs)
VCallArgs.push_back(U.get());
return CreateGCStatepoint(ActualCallee, VCallArgs, DeoptArgs, GCArgs, Name);
}
CallInst *IRBuilderBase::CreateGCResult(Instruction *Statepoint,
Type *ResultType,
const Twine &Name) {