[all-commits] [llvm/llvm-project] 02df44: Fine grain control over some symbol visibility

serge-sans-paille via All-commits all-commits at lists.llvm.org
Wed Sep 1 08:53:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02df443d2801601a4e42e360e436d97314e9da30
      https://github.com/llvm/llvm-project/commit/02df443d2801601a4e42e360e436d97314e9da30
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2021-09-01 (Wed, 01 Sep 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/LazyCallGraph.h
    M llvm/include/llvm/Analysis/LoopInfo.h
    M llvm/include/llvm/Analysis/LoopNestAnalysis.h
    M llvm/include/llvm/CodeGen/MachineFunction.h
    M llvm/include/llvm/IR/Function.h
    M llvm/include/llvm/IR/Module.h

  Log Message:
  -----------
  Fine grain control over some symbol visibility

Setting -fvisibility=hidden when compiling Target libs has the advantage of
not being intrusive on the codebase, but it also sets the visibility of all
functions within header-only component like ADT. In the end, we end up with
some symbols with hidden visibility within llvm dylib (through the target libs),
and some with external visibility (through other libs). This paves the way for
subtle bugs like https://reviews.llvm.org/D101972

This patch explicitly set the visibility of some classes to `default` so that
`llvm::Any` related symbols keep a `default` visibility. Indeed a template
function with `default` visibility parametrized by a type with `hidden`
visibility is granted `hidden` visibility, and we don't want this for the
uniqueness of `llvm::Any::TypeId`.

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




More information about the All-commits mailing list