[all-commits] [llvm/llvm-project] 6b2789: [ORC][COFF] Handle COFF import files of static arc...

Sunho Kim via All-commits all-commits at lists.llvm.org
Fri Jul 29 00:25:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b27890b2ccafe7ed5d808932e7017579d67aed0
      https://github.com/llvm/llvm-project/commit/6b27890b2ccafe7ed5d808932e7017579d67aed0
  Author: Sunho Kim <ksunhokim123 at naver.com>
  Date:   2022-07-29 (Fri, 29 Jul 2022)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
    M llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.cpp

  Log Message:
  -----------
  [ORC][COFF] Handle COFF import files of static archive.

Handles COFF import files of static archive. Changes static library genrator to build up object file map keyed by symbol name that excludes the symbols from dllimported symbols so that static generator will not be responsible for them. It exposes the list of dynamic libraries that need to be imported. Client should properly load the libraries in this list beforehand. Object file map is also an improvment from the past in terms of performance. Archive.findSym does a slow O(n) linear serach of symbol list to find the symbol. (we call findSym O(n) times, thus full time complexity is O(n^2); we were the only user of findSym function in fact)

There is a room for improvements in how to load the libraries in the list. We currently just hand the responsibility over to the clinet. A better way would be let ORC read this list and hand them over to JITLink side that would also help validation (e.g. not trying to generate stub for non dllimported targets) Nevertheless, we will have to exclude the symbols from COFF import object file list and need a way to access this list, which this patch offers.

Reviewed By: lhames

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




More information about the All-commits mailing list