[cfe-dev] question about code in CGBuiltin.cpp

Hatanaka, Akira ahatanaka at mips.com
Mon Jul 2 16:55:25 PDT 2012


It seems to me that line 1333 in CGBuiltin.cpp will never assert since it
is checking whether PTy can be bitcast to FTy->getParamType(i) which is equal
to PTy.

Shouldn't the assertion check whether ArgValue->getType() can be bitcast to
PTy without loss instead?

01329       // If the intrinsic arg type is different from the builtin arg type
01330       // we need to do a bit cast.
01331       llvm::Type *PTy = FTy->getParamType(i);
01332       if (PTy != ArgValue->getType()) {
01333         assert(PTy->canLosslesslyBitCastTo(FTy->getParamType(i)) &&
01334                "Must be able to losslessly bit cast to param");
01335         ArgValue = Builder.CreateBitCast(ArgValue, PTy);
01336       }
01337
01338       Args.push_back(ArgValue);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120702/578cae2c/attachment.html>


More information about the cfe-dev mailing list