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

David Sherwood via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 24 05:32:30 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:

I am not sure if this is entirely correct so would appreciate some guidance here!

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


More information about the cfe-commits mailing list