[cfe-commits] [llvm-commits] [patch] fp128 sint_to_fp folding fix

Tim Northover t.p.northover at gmail.com
Fri Jan 18 01:54:50 PST 2013


Hi Richard,

Thanks very much for your suggestion, that does sound much nicer if we
can make it work; I'm afraid I may need some more guidance
implementing it though.

> Instead of storing the fltSemantics* on the FloatingLiteral, you can
> use ASTContext::getFloatTypeSemantics(Literal->getType()). You'll need
> to update getValue to take a const ASTContext&.

The ripple effects of this change are getting rather large. Most
worrying so far is ASTDumper, a visitor for the AST. When it needs to
call the getValue function (well, actually
getValueAsApproximateDouble, but same idea) there's no ASTContext
available. In principle it could be added as a class member to
ASTDumper, but this is particularly worrying for the Stmt::dump()
method, which doesn't appear to have one available when constructing
the dumper.

Am I missing some way to conjure up an ASTContext?

Cheers.

Tim.



More information about the cfe-commits mailing list