[llvm-commits] [llvm] r71427 - /llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp

Jay Foad jay.foad at gmail.com
Tue May 12 04:57:31 PDT 2009

>> +// Return the integer value Val zero-extended or truncated (if necessary) to
>> +// type ITy. Any new instructions are inserted at InsertBefore.
> this sounds like a generally useful thing, so shouldn't be here.

> Doesn't the IRBuilder stuff already do this?  If so, why not just
> use a builder here?

You're right; IRBuilder::CreateIntCast() already does everything that
my helper function does. How about this patch, which converts the
whole of IntrinsicLowering.cpp to use IRBuilder? It passes "make

Incidentally, is there any reason why all the IRBuilder::CreateXXX
functions take "const char *Name" instead of "const std::string &Name"
(like the underlying XXXInst::Create() functions)? It's a bit of a
pain, because it means I can't write:

  New = Builder.CreateXXX(..., Old->getName());

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.licbuilder
Type: application/octet-stream
Size: 31752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090512/40264361/attachment.obj>

More information about the llvm-commits mailing list