LLVM  6.0.0svn
SplitModule.h
Go to the documentation of this file.
1 //===- SplitModule.h - Split a module into partitions -----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
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.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
17 #define LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
18 
19 #include "llvm/ADT/STLExtras.h"
20 #include <memory>
21 
22 namespace llvm {
23 
24 class Module;
25 
26 /// Splits the module M into N linkable partitions. The function ModuleCallback
27 /// is called N times passing each individual partition as the MPart argument.
28 ///
29 /// FIXME: This function does not deal with the somewhat subtle symbol
30 /// visibility issues around module splitting, including (but not limited to):
31 ///
32 /// - Internal symbols should not collide with symbols defined outside the
33 /// module.
34 /// - Internal symbols defined in module-level inline asm should be visible to
35 /// each partition.
36 void SplitModule(
37  std::unique_ptr<Module> M, unsigned N,
38  function_ref<void(std::unique_ptr<Module> MPart)> ModuleCallback,
39  bool PreserveLocals = false);
40 
41 } // end namespace llvm
42 
43 #endif // LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
void SplitModule(std::unique_ptr< Module > M, unsigned N, function_ref< void(std::unique_ptr< Module > MPart)> ModuleCallback, bool PreserveLocals=false)
Splits the module M into N linkable partitions.
#define N