mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-16 06:30:13 +00:00
Add a spiffy little "CreateCall2" method, which can be used to make
a function call that takes two Value*'s as arguments. llvm-svn: 50514
This commit is contained in:
parent
757d7d318a
commit
09cf777a96
@ -475,15 +475,20 @@ public:
|
|||||||
CallInst *CreateCall(Value *Callee, Value *Arg, const char *Name = "") {
|
CallInst *CreateCall(Value *Callee, Value *Arg, const char *Name = "") {
|
||||||
return Insert(CallInst::Create(Callee, Arg, Name));
|
return Insert(CallInst::Create(Callee, Arg, Name));
|
||||||
}
|
}
|
||||||
|
CallInst *CreateCall2(Value *Callee, Value *Arg1, Value *Arg2,
|
||||||
|
const char *Name = "") {
|
||||||
|
Value *Args[] = { Arg1, Arg2 };
|
||||||
|
return Insert(CallInst::Create(Callee, Args, Args+2, Name));
|
||||||
|
}
|
||||||
|
|
||||||
template<typename InputIterator>
|
template<typename InputIterator>
|
||||||
CallInst *CreateCall(Value *Callee, InputIterator ArgBegin,
|
CallInst *CreateCall(Value *Callee, InputIterator ArgBegin,
|
||||||
InputIterator ArgEnd, const char *Name = "") {
|
InputIterator ArgEnd, const char *Name = "") {
|
||||||
return Insert(CallInst::Create(Callee, ArgBegin, ArgEnd, Name));
|
return Insert(CallInst::Create(Callee, ArgBegin, ArgEnd, Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
Value *CreateSelect(Value *C, Value *True, Value *False,
|
Value *CreateSelect(Value *C, Value *True, Value *False,
|
||||||
const char *Name = "") {
|
const char *Name = "") {
|
||||||
if (Constant *CC = dyn_cast<Constant>(C))
|
if (Constant *CC = dyn_cast<Constant>(C))
|
||||||
if (Constant *TC = dyn_cast<Constant>(True))
|
if (Constant *TC = dyn_cast<Constant>(True))
|
||||||
if (Constant *FC = dyn_cast<Constant>(False))
|
if (Constant *FC = dyn_cast<Constant>(False))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user