[PATCH] D73967: Implement _ExtInt as an extended int type specifier.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 27 08:15:12 PST 2020


ABataev added inline comments.


================
Comment at: clang/include/clang/AST/Type.h:6196
 
+// A fixed int type of a specified bitwidth.
+class ExtIntType : public Type, public llvm::FoldingSetNode {
----------------
Use `///` style


================
Comment at: clang/include/clang/AST/Type.h:6197
+// A fixed int type of a specified bitwidth.
+class ExtIntType : public Type, public llvm::FoldingSetNode {
+  friend class ASTContext;
----------------
`final` class


================
Comment at: clang/include/clang/AST/Type.h:6225
+
+class DependentExtIntType : public Type, public llvm::FoldingSetNode {
+  friend class ASTContext;
----------------
`final` class


================
Comment at: clang/include/clang/AST/TypeLoc.h:2453-2457
+class ExtIntTypeLoc
+    : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, ExtIntTypeLoc,
+                                        ExtIntType> {};
+class DependentExtIntTypeLoc
+    : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, DependentExtIntTypeLoc,
----------------
`final` classes?


================
Comment at: clang/lib/AST/ASTContext.cpp:4020
+
+  ExtIntType *New =
+      new (*this, TypeAlignment) ExtIntType(IsUnsigned, NumBits);
----------------
`auto *`


================
Comment at: clang/lib/AST/ASTContext.cpp:4038
+
+  DependentExtIntType *New = new (*this, TypeAlignment)
+      DependentExtIntType(*this, IsUnsigned, NumBitsExpr);
----------------
`auto *`


================
Comment at: clang/lib/AST/ASTContext.cpp:5879-5881
+  if (const auto *EIT = dyn_cast<ExtIntType>(T)) {
+    return 0 + (EIT->getNumBits() << 3);
+  }
----------------
No need for braces here.


================
Comment at: clang/lib/AST/Type.cpp:2117-2118
     return STK_IntegralComplex;
-  }
+  } else if (isExtIntType())
+    return STK_Integral;
 
----------------
Enclose substatement in braces to follow the coding style used for other substatements.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73967/new/

https://reviews.llvm.org/D73967





More information about the cfe-commits mailing list