diff options
author | Fangrui Song <maskray@google.com> | 2019-07-09 19:36:22 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-07-09 19:36:22 +0000 |
commit | 3fbd8fda9a02e8aed4c8723a80a0837e637392cc (patch) | |
tree | 190ea03182f3ce41412f9d348ec5948fd05942f2 /clang | |
parent | 2d739940466980bd07419a846e33a6b648978d40 (diff) | |
download | bcm5719-llvm-3fbd8fda9a02e8aed4c8723a80a0837e637392cc.tar.gz bcm5719-llvm-3fbd8fda9a02e8aed4c8723a80a0837e637392cc.zip |
[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
llvm-svn: 365545
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index ea13dcb6506..0d69eb90aba 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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(); } |