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

Tom Stellard via All-commits all-commits at lists.llvm.org
Wed Sep 8 21:06:43 PDT 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: f56129fe78d5c849971017976c71333b6b1a27c6
      https://github.com/llvm/llvm-project/commit/f56129fe78d5c849971017976c71333b6b1a27c6
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2021-09-08 (Wed, 08 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