[cfe-commits] [PATCH][Review request] f128 literal

Eli Friedman eli.friedman at gmail.com
Mon Jan 9 14:32:52 PST 2012


On Mon, Jan 9, 2012 at 1:13 PM, Akira Hatanaka <ahatanak at gmail.com> wrote:
> The attached patch makes FloatingLiteral::getValue() return 128-bit
> floating point values in the correct format.
> The existing code always returns PPCDoubleDouble floating points
> because parameter isIEEE of constructor APFloat::APFloat(const APInt&
> api, bool isIEEE) is not being set (default value is false).
>
> Without this patch, clang terminates with the following message when
> the attached test is compiled:
> clang: llvm/lib/VMCore/Instructions.cpp:1086: void
> llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() ==
> cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr
> must be a pointer to Val type!"' failed.

You can save some space in FloatingLiteral by caching the IsIEEE bit
rather than the ASTContext itself.  Otherwise, looks fine.

-Eli



More information about the cfe-commits mailing list