[clang] 1c10667 - [AST] Simplify Type::isSizelessBuiltinType(). NFC.

Jim Lin via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 1 19:47:14 PDT 2023


Author: Jim Lin
Date: 2023-08-02T10:46:42+08:00
New Revision: 1c1066797c5bb56616dc485b596fd40d5f03ece2

URL: https://github.com/llvm/llvm-project/commit/1c1066797c5bb56616dc485b596fd40d5f03ece2
DIFF: https://github.com/llvm/llvm-project/commit/1c1066797c5bb56616dc485b596fd40d5f03ece2.diff

LOG: [AST] Simplify Type::isSizelessBuiltinType(). NFC.

Reuse isSVESizelessBuiltinType() and isRVVSizelessBuiltinType().

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D156686

Added: 
    

Modified: 
    clang/lib/AST/Type.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index cd1bcc4f17cdc6..8af6e296a20efb 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -2353,14 +2353,11 @@ bool Type::isIncompleteType(NamedDecl **Def) const {
 }
 
 bool Type::isSizelessBuiltinType() const {
+  if (isSVESizelessBuiltinType() || isRVVSizelessBuiltinType())
+    return true;
+
   if (const BuiltinType *BT = getAs<BuiltinType>()) {
     switch (BT->getKind()) {
-      // SVE Types
-#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
-#include "clang/Basic/AArch64SVEACLETypes.def"
-#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
-#include "clang/Basic/RISCVVTypes.def"
-      return true;
       // WebAssembly reference types
 #define WASM_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
 #include "clang/Basic/WebAssemblyReferenceTypes.def"


        


More information about the cfe-commits mailing list