class Linker

Declaration

class Linker { /* full declaration omitted */ };

Description

This class provides the core functionality of linking in LLVM. It keeps a pointer to the merged module so far. It doesn't take ownership of the module since it is assumed that the user of this class will want to do something with it after the linking.

Declared at: llvm/include/llvm/Linker/Linker.h:24

Method Overview

  • public Linker(llvm::Module & M)
  • public bool linkInModule(std::unique_ptr<Module> Src, unsigned int Flags = Flags::None, std::function<void (Module &, const StringSet<> &)> InternalizeCallback = {})
  • public static bool linkModules(llvm::Module & Dest, std::unique_ptr<Module> Src, unsigned int Flags = Flags::None, std::function<void (Module &, const StringSet<> &)> InternalizeCallback = {})

Methods

Linker(llvm::Module& M)

Declared at: llvm/include/llvm/Linker/Linker.h:34

Parameters

llvm::Module& M

bool linkInModule(
    std::unique_ptr<Module> Src,
    unsigned int Flags = Flags::None,
    std::function<void(Module&,
                       const StringSet<>&)>
        InternalizeCallback = {})

Description

Link \p Src into the composite. Passing OverrideSymbols as true will have symbols from Src shadow those in the Dest. Passing InternalizeCallback will have the linker call the function with the new module and a list of global value names to be internalized by the callback. Returns true on error.

Declared at: llvm/include/llvm/Linker/Linker.h:46

Parameters

std::unique_ptr<Module> Src
unsigned int Flags = Flags::None
std::function<void(Module&, const StringSet<>&)> InternalizeCallback = {}

static bool linkModules(
    llvm::Module& Dest,
    std::unique_ptr<Module> Src,
    unsigned int Flags = Flags::None,
    std::function<void(Module&,
                       const StringSet<>&)>
        InternalizeCallback = {})

Declared at: llvm/include/llvm/Linker/Linker.h:50

Parameters

llvm::Module& Dest
std::unique_ptr<Module> Src
unsigned int Flags = Flags::None
std::function<void(Module&, const StringSet<>&)> InternalizeCallback = {}