From: Fangrui Song Date: Tue, 9 Jul 2019 19:36:22 +0000 (+0000) Subject: [OpenMP] Simplify getFloatTypeSemantics X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7599e11553153798750a453a01c54f8062f72521;p=clang [OpenMP] Simplify getFloatTypeSemantics When the float point representations are the same on the host and on the target device, (`&Target->getLongDoubleFormat() == &AuxTarget->getLongDoubleFormat()`), we can just use `AuxTarget->getLongDoubleFormat()`. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D64423 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365545 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index ea13dcb650..0d69eb90ab 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1525,13 +1525,11 @@ const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const { case BuiltinType::Float: return Target->getFloatFormat(); case BuiltinType::Double: return Target->getDoubleFormat(); case BuiltinType::LongDouble: - if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice && - &Target->getLongDoubleFormat() != &AuxTarget->getLongDoubleFormat()) + if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice) return AuxTarget->getLongDoubleFormat(); return Target->getLongDoubleFormat(); case BuiltinType::Float128: - if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice && - &Target->getFloat128Format() != &AuxTarget->getFloat128Format()) + if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice) return AuxTarget->getFloat128Format(); return Target->getFloat128Format(); }