[PATCH] D107719: [Clang] Resolve FIXMEs in Types.h

2021-08-08 Thread Alf via Phabricator via cfe-commits
gAlfonso-bit updated this revision to Diff 365046.

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

https://reviews.llvm.org/D107719

Files:
  clang/include/clang/AST/Type.h
  clang/lib/AST/Type.cpp


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2785,7 +2785,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -3450,10 +3450,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2785,7 +2785,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -3450,10 +3450,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D107719: [Clang] Resolve FIXMEs in Types.h

2021-08-08 Thread Alf via Phabricator via cfe-commits
gAlfonso-bit updated this revision to Diff 365045.

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

https://reviews.llvm.org/D107719

Files:
  clang/include/clang/AST/Type.h
  clang/lib/AST/Type.cpp


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -31,6 +31,7 @@
 #include "clang/Basic/AddressSpaces.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
 #include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Linkage.h"
@@ -2011,9 +2012,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!getLangOpts().CPlusPlus && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2036,7 +2038,6 @@
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
 return IT->isSigned();
 
-
   return false;
 }
 
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!getLangOpts().CPlusPlus && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2787,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -24,6 +24,7 @@
 #include "clang/Basic/AttrKinds.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/Linkage.h"
 #include "clang/Basic/PartialDiagnostic.h"
@@ -3450,10 +3451,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;
@@ -6989,9 +6986,8 @@
BT->getKind() <= BuiltinType::Int128;
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-return IsEnumDeclComplete(ET->getDecl()) &&
-  !IsEnumDeclScoped(ET->getDecl());
+// In C++, enum types are never integer types.
+return !getLangOpts().CPlusPlus && IsEnumDeclComplete(ET->getDecl());
   }
   return isExtIntType();
 }


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -31,6 +31,7 @@
 #include "clang/Basic/AddressSpaces.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
 #include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Linkage.h"
@@ -2011,9 +2012,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!getLangOpts().CPlusPlus && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2036,7 +2038,6 @@
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
 return IT->isSigned();
 
-
   return false;
 }
 
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!getLangOpts().CPlusPlus && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = 

[PATCH] D107719: [Clang] Resolve FIXMEs in Types.h

2021-08-08 Thread Alf via Phabricator via cfe-commits
gAlfonso-bit updated this revision to Diff 365044.

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

https://reviews.llvm.org/D107719

Files:
  clang/include/clang/AST/Type.h
  clang/lib/AST/Type.cpp


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -31,6 +31,7 @@
 #include "clang/Basic/AddressSpaces.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
 #include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Linkage.h"
@@ -2011,9 +2012,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2060,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2788,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -24,6 +24,7 @@
 #include "clang/Basic/AttrKinds.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/Linkage.h"
 #include "clang/Basic/PartialDiagnostic.h"
@@ -3450,10 +3451,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;
@@ -6989,9 +6986,8 @@
BT->getKind() <= BuiltinType::Int128;
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-return IsEnumDeclComplete(ET->getDecl()) &&
-  !IsEnumDeclScoped(ET->getDecl());
+// In C++, enum types are never integer types.
+return !isCPlusPlus() && IsEnumDeclComplete(ET->getDecl());
   }
   return isExtIntType();
 }


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -31,6 +31,7 @@
 #include "clang/Basic/AddressSpaces.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
 #include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/Linkage.h"
@@ -2011,9 +2012,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2060,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2788,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h

[PATCH] D107719: [Clang] Resolve FIXMEs in Types.h

2021-08-08 Thread Alf via Phabricator via cfe-commits
gAlfonso-bit updated this revision to Diff 365043.

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

https://reviews.llvm.org/D107719

Files:
  clang/include/clang/AST/Type.h
  clang/lib/AST/Type.cpp


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2011,9 +2011,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2787,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -24,6 +24,7 @@
 #include "clang/Basic/AttrKinds.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/Linkage.h"
 #include "clang/Basic/PartialDiagnostic.h"
@@ -3450,10 +3451,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;
@@ -6989,9 +6986,8 @@
BT->getKind() <= BuiltinType::Int128;
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-return IsEnumDeclComplete(ET->getDecl()) &&
-  !IsEnumDeclScoped(ET->getDecl());
+// In C++, enum types are never integer types.
+return !isCPlusPlus() && IsEnumDeclComplete(ET->getDecl());
   }
   return isExtIntType();
 }


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2011,9 +2011,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2787,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -24,6 +24,7 @@
 #include "clang/Basic/AttrKinds.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/Linkage.h"
 #include "clang/Basic/PartialDiagnostic.h"
@@ -3450,10 +3451,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also 

[PATCH] D107719: [Clang] Resolve FIXMEs in Types.h

2021-08-08 Thread Alf via Phabricator via cfe-commits
gAlfonso-bit updated this revision to Diff 365042.

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

https://reviews.llvm.org/D107719

Files:
  clang/include/clang/AST/Type.h
  clang/lib/AST/Type.cpp


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2011,9 +2011,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2787,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -24,6 +24,7 @@
 #include "clang/Basic/AttrKinds.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/Linkage.h"
 #include "clang/Basic/PartialDiagnostic.h"
@@ -3450,10 +3451,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;
@@ -6989,9 +6986,9 @@
BT->getKind() <= BuiltinType::Int128;
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-return IsEnumDeclComplete(ET->getDecl()) &&
-  !IsEnumDeclScoped(ET->getDecl());
+// In C++, enum types are never integer types.
+return !isCPlusPlus() && IsEnumDeclComplete(ET->getDecl()) &&
+   !IsEnumDeclScoped(ET->getDecl());
   }
   return isExtIntType();
 }


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2011,9 +2011,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2787,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -24,6 +24,7 @@
 #include "clang/Basic/AttrKinds.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/ExceptionSpecificationType.h"
+#include "clang/Basic/LangStandard.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/Linkage.h"
 #include "clang/Basic/PartialDiagnostic.h"
@@ -3450,10 +3451,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to 

[PATCH] D107719: [Clang] Resolve FIXMEs in Types.h

2021-08-08 Thread Alf via Phabricator via cfe-commits
gAlfonso-bit created this revision.
gAlfonso-bit added projects: LLVM, clang.
gAlfonso-bit requested review of this revision.
Herald added a subscriber: cfe-commits.

This includes removing ObjectiveC Object Pointers from the list of specifiers, 
as well as checking for C++ instead of using Scoped Enums as a workaround.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107719

Files:
  clang/include/clang/AST/Type.h
  clang/lib/AST/Type.cpp


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2011,9 +2011,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2787,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -3450,10 +3450,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;
@@ -6989,9 +6985,9 @@
BT->getKind() <= BuiltinType::Int128;
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-return IsEnumDeclComplete(ET->getDecl()) &&
-  !IsEnumDeclScoped(ET->getDecl());
+// In C++, enum types are never integer types.
+return !isCPlusPlus() && IsEnumDeclComplete(ET->getDecl()) &&
+   !IsEnumDeclScoped(ET->getDecl());
   }
   return isExtIntType();
 }


Index: clang/lib/AST/Type.cpp
===
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2011,9 +2011,10 @@
 
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2058,9 +2059,10 @@
 
   if (const auto *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as integer types.
-// FIXME: In C++, enum types are never integer types.
-if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
+// In C++, enum types are never integer types.
+if (!isCPlusPlus() && ET->getDecl()->isComplete())
   return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+return false;
   }
 
   if (const ExtIntType *IT = dyn_cast(CanonicalType))
@@ -2785,7 +2787,6 @@
   case DependentTemplateSpecialization:
   case ObjCInterface:
   case ObjCObject:
-  case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers
 return true;
   default:
 return false;
Index: clang/include/clang/AST/Type.h
===
--- clang/include/clang/AST/Type.h
+++ clang/include/clang/AST/Type.h
@@ -3450,10 +3450,6 @@
 protected:
   friend class ASTContext;
 
-  /// The element type of the matrix.
-  // FIXME: Appears to be unused? There is also MatrixType::ElementType...
-  QualType ElementType;
-
   /// Number of rows and columns.
   unsigned NumRows;
   unsigned NumColumns;
@@ -6989,9 +6985,9 @@
BT->getKind() <= BuiltinType::Int128;
   if (const EnumType *ET = dyn_cast(CanonicalType)) {
 // Incomplete enum types are not treated as