Skip to content

[CIR][CodeGen] Missing handling for global thunk infoΒ #1898

@badumbatish

Description

@badumbatish

From #1864 (comment), and #1864 (comment),

Jasmine: CIR crashes at CIRGenVTables.cpp:663, i'm guessing we cannot handle the case where they're different addresses?

Tommy: I remember hitting that when I briefly looked at the issue in the past. Can you create an issue with the test case? ...

Godbolt link: https://godbolt.org/z/cooqvhvqo

Crash at llvm_unreachable in CIRGenVTables.cpp:

void CIRGenVTables::emitThunks(GlobalDecl GD) {
  const CXXMethodDecl *MD =
      cast<CXXMethodDecl>(GD.getDecl())->getCanonicalDecl();

  // We don't need to generate thunks for the base destructor.
  if (isa<CXXDestructorDecl>(MD) && GD.getDtorType() == Dtor_Base)
    return;

  const VTableContextBase::ThunkInfoVectorTy *ThunkInfoVector =
      VTContext->getThunkInfo(GD);

  if (!ThunkInfoVector)
    return;

  for ([[maybe_unused]] const ThunkInfo &Thunk : *ThunkInfoVector)
    llvm_unreachable("NYI");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions