[all-commits] [llvm/llvm-project] 8a2d68: [clang][CodeGen] Switch declaration of vtable info...

Nuno Lopes via All-commits all-commits at lists.llvm.org
Fri Sep 8 23:50:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a2d68f6be5058f88588c31928ff40d8eb16c20a
      https://github.com/llvm/llvm-project/commit/8a2d68f6be5058f88588c31928ff40d8eb16c20a
  Author: Nuno Lopes <nuno.lopes at tecnico.ulisboa.pt>
  Date:   2023-09-09 (Sat, 09 Sep 2023)

  Changed paths:
    M clang/lib/CodeGen/ItaniumCXXABI.cpp
    M clang/test/CodeGenCXX/RelativeVTablesABI/child-vtable-in-comdat.cpp
    M clang/test/CodeGenCXX/RelativeVTablesABI/parent-vtable-in-comdat.cpp
    M clang/test/CodeGenCXX/RelativeVTablesABI/simple-vtable-definition.cpp
    M clang/test/CodeGenCXX/RelativeVTablesABI/type-info.cpp
    M clang/test/CodeGenCXX/typeinfo-with-address-space.cpp

  Log Message:
  -----------
  [clang][CodeGen] Switch declaration of vtable information to be [0 x ptr] (#65596)

Continuing the discussion in
https://discourse.llvm.org/t/codegen-layout-of-si-class-type-info-doesnt-match-the-actual-size/73274

Before we had this code:
@_ZTVN10__cxxabiv117__class_type_infoE = external global ptr

now we'll produce:
@_ZTVN10__cxxabiv117__class_type_infoE = external global [0 x ptr]

This is because we may not know the exact size of this data, and clang
issues gep inbounds with idx=2. Before, that gep would always result in
poison.




More information about the All-commits mailing list