[IR] Add Type::getFloatingPointTy.
authorBevin Hansson <bevin.hansson@ericsson.com>
Fri, 11 Sep 2020 11:59:22 +0000 (13:59 +0200)
committerBevin Hansson <bevin.hansson@ericsson.com>
Fri, 9 Oct 2020 08:27:41 +0000 (10:27 +0200)
commit14a217534b791b68ea4e5b85ae98d92846bbd430
tree12f944ffe3c2d01d6b01a97b548758c916cf81fb
parent6ee47f552ba7654a0997c8deb71f65d0d91f4a28
[IR] Add Type::getFloatingPointTy.

It is possible to get a fltSemantics of a particular Type,
but there is no way to produce a Type based on a
fltSemantics.

This adds the function Type::getFloatingPointTy, which
will return the appropriate floating point Type for a given
fltSemantics.

ConstantFP is modified to use this function instead of
implementing it itself. Also some minor refactors to use
Type::getFltSemantics instead of a hand-rolled version.

Differential Revision: https://reviews.llvm.org/D87512
llvm/include/llvm/IR/Type.h
llvm/lib/IR/Constants.cpp