1 //===- SplitModule.h - Split a module into partitions -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the function llvm::SplitModule, which splits a module
11 // into multiple linkable partitions. It can be used to implement parallel code
12 // generation for link-time optimization.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
17 #define LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
27 /// Splits the module M into N linkable partitions. The function ModuleCallback
28 /// is called N times passing each individual partition as the MPart argument.
30 /// FIXME: This function does not deal with the somewhat subtle symbol
31 /// visibility issues around module splitting, including (but not limited to):
33 /// - Internal symbols should not collide with symbols defined outside the
35 /// - Internal symbols defined in module-level inline asm should be visible to
38 std::unique_ptr<Module> M, unsigned N,
39 std::function<void(std::unique_ptr<Module> MPart)> ModuleCallback);
41 } // End llvm namespace