mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 21:00:29 +00:00
Add IRBuilder::{CreateIsNull, CreateIsNonNull} helper methods.
- I'm open to the idea that these could have better names. I think these read better than CreateEQNull and CreateNENull. llvm-svn: 56757
This commit is contained in:
parent
28d9b3a8ad
commit
fe82c1180a
@ -630,6 +630,23 @@ public:
|
||||
IdxBegin, IdxEnd - IdxBegin);
|
||||
return Insert(InsertValueInst::Create(Agg, Val, IdxBegin, IdxEnd), Name);
|
||||
}
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Utility creation methods
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
/// CreateIsNull - Return an i1 value testing if \arg Arg is null.
|
||||
Value *CreateIsNull(Value *Arg, const char *Name = "") {
|
||||
return CreateICmpEQ(Arg, llvm::Constant::getNullValue(Arg->getType()),
|
||||
Name);
|
||||
}
|
||||
|
||||
/// CreateIsNonNull - Return an i1 value testing if \arg Arg is not null.
|
||||
Value *CreateIsNonNull(Value *Arg, const char *Name = "") {
|
||||
return CreateICmpNE(Arg, llvm::Constant::getNullValue(Arg->getType()),
|
||||
Name);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user