[all-commits] [llvm/llvm-project] 8348c4: [clang-offload-bundler] Library-ize ClangOffloadBu...

Jacob Lambert via All-commits all-commits at lists.llvm.org
Tue Jul 26 10:06:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8348c4095600ec2c0beee293267832799d2ebee3
      https://github.com/llvm/llvm-project/commit/8348c4095600ec2c0beee293267832799d2ebee3
  Author: Jacob Lambert <jacob.lambert at amd.com>
  Date:   2022-07-26 (Tue, 26 Jul 2022)

  Changed paths:
    A clang/include/clang/Driver/OffloadBundler.h
    M clang/lib/Driver/CMakeLists.txt
    A clang/lib/Driver/OffloadBundler.cpp
    M clang/tools/clang-offload-bundler/CMakeLists.txt
    M clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp

  Log Message:
  -----------
  [clang-offload-bundler] Library-ize ClangOffloadBundler

Lifting the core functionalities of the clang-offload-bundler into a
user-facing library/API. This will allow online and JIT compilers to
bundle and unbundle files without spawning a new process.

This patch lifts the classes and functions used to implement
the clang-offload-bundler into a separate OffloadBundler.cpp,
and defines three top-level API functions in OfflaodBundler.h.
        BundleFiles()
        UnbundleFiles()
        UnbundleArchives()

This patch also introduces a Config class that locally stores the
previously global cl::opt options and arrays to allow users to call
the APIs in a multi-threaded context, and introduces an
OffloadBundler class to encapsulate the top-level API functions.

We also  lift the BundlerExecutable variable, which is specific
to the clang-offload-bundler tool, from the API, and replace
its use with an ObjcopyPath variable. This variable must be set
in order to internally call llvm-objcopy.

Finally, we move the API files from
clang/tools/clang-offload-bundler into clang/lib/Driver and
clang/include/clang/Driver.

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




More information about the All-commits mailing list