[clang] [Clang] Emit TBAA info for enums in C (PR #73326)
Momchil Velikov via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 24 06:36:31 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));
----------------
momchil-velikov wrote:
Maybe `ETy->getDecl()->getIntegerType()` ?
https://github.com/llvm/llvm-project/pull/73326
More information about the cfe-commits
mailing list