From 9641fe47d6bdf383c29f9812a09047c228218e7d Mon Sep 17 00:00:00 2001 From: "Bohao(Aaron) Wang" Date: Wed, 6 May 2020 13:37:46 -0400 Subject: [PATCH] Add DataType::isFloat() Add function to also check if the datatype is of float type Signed-off-by: Bohao(Aaron) Wang --- compiler/il/OMRDataTypes.hpp | 3 ++- compiler/il/OMRDataTypes_inlines.hpp | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/il/OMRDataTypes.hpp b/compiler/il/OMRDataTypes.hpp index 8bc1dd40cb..38d6509aac 100644 --- a/compiler/il/OMRDataTypes.hpp +++ b/compiler/il/OMRDataTypes.hpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corp. and others + * Copyright (c) 2000, 2020 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -345,6 +345,7 @@ class OMR_EXTENSIBLE DataType inline bool isVector(); inline bool isBFPorHFP(); inline bool isDouble(); + inline bool isFloat(); inline bool isAddress(); inline bool isAggregate(); diff --git a/compiler/il/OMRDataTypes_inlines.hpp b/compiler/il/OMRDataTypes_inlines.hpp index 3398f4b7f3..25628f687c 100644 --- a/compiler/il/OMRDataTypes_inlines.hpp +++ b/compiler/il/OMRDataTypes_inlines.hpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2017 IBM Corp. and others + * Copyright (c) 2017, 2020 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -96,6 +96,12 @@ OMR::DataType::isDouble() return self()->getDataType() == TR::Double; } +bool +OMR::DataType::isFloat() + { + return self()->getDataType() == TR::Float; + } + bool OMR::DataType::isAddress() {