[clang] [clang][NFC] Adjust TBAA Base Info API (PR #73263)

Nathan Sidwell via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 10 15:29:26 PST 2024


================
@@ -95,8 +95,6 @@ static bool TypeHasMayAlias(QualType QTy) {
 
 /// Check if the given type is a valid base type to be used in access tags.
 static bool isValidBaseType(QualType QTy) {
-  if (QTy->isReferenceType())
-    return false;
----------------
urnathan wrote:

This is case  #1 in the intro. Namely this is immediately followed by 
```
 if (const RecordType *TTy = QTy->getAs<RecordType>()) {
   .. do stuff
   return true;
}
return false;
```
So AFAICT that inital check for a reference type is doing nothing.  Am I misunderstanding getAs<RecordType> and that it's possible for a type to be both RecordType and ReferenceType?

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


More information about the cfe-commits mailing list