[clang] [clang][bytecode] Improve `getType()` (PR #200342)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 3 06:27:19 PDT 2026
================
@@ -375,19 +375,36 @@ Descriptor::Descriptor(const DeclTy &D, MetadataSize MD)
QualType Descriptor::getType() const {
if (SourceType)
return QualType(SourceType, 0);
- if (const auto *D = asValueDecl())
- return D->getType();
+
if (const auto *T = dyn_cast_if_present<TypeDecl>(asDecl()))
return T->getASTContext().getTypeDeclType(T);
// The Source sometimes has a different type than the once
// we really save. Try to consult the Record first.
if (isRecord()) {
const RecordDecl *RD = ElemRecord->getDecl();
- return RD->getASTContext().getCanonicalTagType(RD);
+ QualType T = RD->getASTContext().getTagType(ElaboratedTypeKeyword::None,
+ std::nullopt, RD, false);
----------------
tbaederr wrote:
Yes, I don't have anymore information to pass anything else.
https://github.com/llvm/llvm-project/pull/200342
More information about the cfe-commits
mailing list