[all-commits] [llvm/llvm-project] cafe50: Explicitly initialize opaque pointer mode in CodeG...

Matthias Braun via All-commits all-commits at lists.llvm.org
Mon Nov 7 12:49:20 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cafe50daf525971ffc3b8c5f2f6343d24e381384
      https://github.com/llvm/llvm-project/commit/cafe50daf525971ffc3b8c5f2f6343d24e381384
  Author: Matthias Braun <matze at braunis.de>
  Date:   2022-11-07 (Mon, 07 Nov 2022)

  Changed paths:
    M clang/lib/CodeGen/CodeGenAction.cpp
    A clang/test/CodeGen/Inputs/thinlto-opaque.ll
    M clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
    A clang/test/CodeGen/thinlto-opaque-typed-mix.ll

  Log Message:
  -----------
  Explicitly initialize opaque pointer mode in CodeGenAction

Explicitly call `LLVMContext::setOpaquePointers` in `CodeGenAction`
before loading any IR files. With this we use the mode specified on the
command-line rather than lazily initializing it based on the contents of
the IR.

This helps when using `-fthinlto-index` which may end up mixing files
with typed and opaque pointer types which fails when the first file
happened to use typed pointers since we cannot downgrade IR with opaque
pointer types to typed pointer types.

Differential Revision: https://reviews.llvm.org/D137475




More information about the All-commits mailing list