[clang] [clang][NFC] Use BuiltinType::isFloatingPoint() in Type::isFloatingType() (PR #139035)
via cfe-commits
cfe-commits at lists.llvm.org
Thu May 8 00:17:18 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
They both used to do the same comparison of getKind() to Half and Ibm128.
---
Full diff: https://github.com/llvm/llvm-project/pull/139035.diff
1 Files Affected:
- (modified) clang/lib/AST/Type.cpp (+1-2)
``````````diff
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 392a95d042353..82ca2c62eba30 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -2301,8 +2301,7 @@ bool Type::hasUnsignedIntegerRepresentation() const {
bool Type::isFloatingType() const {
if (const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
- return BT->getKind() >= BuiltinType::Half &&
- BT->getKind() <= BuiltinType::Ibm128;
+ return BT->isFloatingPoint();
if (const auto *CT = dyn_cast<ComplexType>(CanonicalType))
return CT->getElementType()->isFloatingType();
return false;
``````````
</details>
https://github.com/llvm/llvm-project/pull/139035
More information about the cfe-commits
mailing list