LLVM  4.0.0
LTOBackend.h
Go to the documentation of this file.
1 //===-LTOBackend.h - LLVM Link Time Optimizer Backend ---------------------===//
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 implements the "backend" phase of LTO, i.e. it performs
11 // optimization and code generation on a loaded module. It is generally used
12 // internally by the LTO class but can also be used independently, for example
13 // to implement a standalone ThinLTO backend.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_LTO_LTOBACKEND_H
18 #define LLVM_LTO_LTOBACKEND_H
19 
20 #include "llvm/ADT/MapVector.h"
21 #include "llvm/IR/DiagnosticInfo.h"
23 #include "llvm/LTO/LTO.h"
27 
28 namespace llvm {
29 
30 class BitcodeModule;
31 class Error;
32 class Module;
33 class Target;
34 
35 namespace lto {
36 
37 /// Runs a regular LTO backend.
38 Error backend(Config &C, AddStreamFn AddStream,
39  unsigned ParallelCodeGenParallelismLevel,
40  std::unique_ptr<Module> M);
41 
42 /// Runs a ThinLTO backend.
43 Error thinBackend(Config &C, unsigned Task, AddStreamFn AddStream, Module &M,
44  ModuleSummaryIndex &CombinedIndex,
45  const FunctionImporter::ImportMapTy &ImportList,
46  const GVSummaryMapTy &DefinedGlobals,
47  MapVector<StringRef, BitcodeModule> &ModuleMap);
48 }
49 }
50 
51 #endif
std::function< std::unique_ptr< NativeObjectStream >unsigned Task)> AddStreamFn
This type defines the callback to add a native object that is generated on the fly.
Definition: LTO.h:253
Error thinBackend(Config &C, unsigned Task, AddStreamFn AddStream, Module &M, ModuleSummaryIndex &CombinedIndex, const FunctionImporter::ImportMapTy &ImportList, const GVSummaryMapTy &DefinedGlobals, MapVector< StringRef, BitcodeModule > &ModuleMap)
Runs a ThinLTO backend.
Definition: LTOBackend.cpp:317
static const char * Target
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
std::map< GlobalValue::GUID, GlobalValueSummary * > GVSummaryMapTy
Map of global value GUID to its summary, used to identify values defined in a particular module...
Error backend(Config &C, AddStreamFn AddStream, unsigned ParallelCodeGenParallelismLevel, std::unique_ptr< Module > M)
Runs a regular LTO backend.
Definition: LTOBackend.cpp:292
StringMap< FunctionsToImportTy > ImportMapTy
The map contains an entry for every module to import from, the key being the module identifier to pas...
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...