[clang] [Clang] Emit TBAA info for enums in C (PR #73326)

David Sherwood via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 06:12:02 PST 2023


================
@@ -196,11 +196,14 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) {
   // Enum types are distinct types. In C++ they have "underlying types",
   // however they aren't related for TBAA.
   if (const EnumType *ETy = dyn_cast<EnumType>(Ty)) {
+    if (!Features.CPlusPlus)
+      return getTypeInfo(Context.getIntTypeForBitwidth(Size * 8, 0));
----------------
david-arm wrote:

Good suggestion - thanks!

https://github.com/llvm/llvm-project/pull/73326


More information about the cfe-commits mailing list