Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: llvm/tools/lto/LTOCodeGenerator.h

Issue 10808021: Change LLVM bitcode linking to use tree reduction to scale better (Closed)
Patch Set: stuff Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « llvm/tools/llc/llc.cpp ('k') | llvm/tools/lto/LTOCodeGenerator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-LTOCodeGenerator.h - LLVM Link Time Optimizer -----------------------===// 1 //===-LTOCodeGenerator.h - LLVM Link Time Optimizer -----------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares the LTOCodeGenerator class. 10 // This file declares the LTOCodeGenerator class.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #ifndef LTO_CODE_GENERATOR_H 14 #ifndef LTO_CODE_GENERATOR_H
15 #define LTO_CODE_GENERATOR_H 15 #define LTO_CODE_GENERATOR_H
16 16
17 #include "llvm/Linker.h" 17 #include "llvm/Linker.h"
18 #include "llvm/ADT/StringMap.h" 18 #include "llvm/ADT/StringMap.h"
19 #include "llvm/ADT/SmallPtrSet.h" 19 #include "llvm/ADT/SmallPtrSet.h"
20 #include "llvm-c/lto.h" 20 #include "llvm-c/lto.h"
21 #include <string> 21 #include <string>
22 #include <vector>
22 23
23 namespace llvm { 24 namespace llvm {
24 class LLVMContext; 25 class LLVMContext;
25 class GlobalValue; 26 class GlobalValue;
26 class Mangler; 27 class Mangler;
27 class MemoryBuffer; 28 class MemoryBuffer;
28 class TargetMachine; 29 class TargetMachine;
29 class raw_ostream; 30 class raw_ostream;
30 } 31 }
31 32
32 //===----------------------------------------------------------------------===// 33 //===----------------------------------------------------------------------===//
33 /// LTOCodeGenerator - C++ class which implements the opaque lto_code_gen_t 34 /// LTOCodeGenerator - C++ class which implements the opaque lto_code_gen_t
34 /// type. 35 /// type.
35 /// 36 ///
36 struct LTOCodeGenerator { 37 struct LTOCodeGenerator {
37 static const char *getVersionString(); 38 static const char *getVersionString();
38 39
39 LTOCodeGenerator(); 40 LTOCodeGenerator();
40 ~LTOCodeGenerator(); 41 ~LTOCodeGenerator();
41 42
42 bool addModule(struct LTOModule*, std::string &errMsg); 43 bool addModule(struct LTOModule*, std::string &errMsg);
44 // @LOCALMOD-BEGIN
45 // Alternative methods of adding modules, which delay merging modules until
46 // all modules are available.
47 bool gatherModuleForLinking(struct LTOModule*);
48 bool linkGatheredModulesAndDispose(std::string &errMsg);
49 // @LOCALMOD-END
43 bool setDebugInfo(lto_debug_model, std::string &errMsg); 50 bool setDebugInfo(lto_debug_model, std::string &errMsg);
44 bool setCodePICModel(lto_codegen_model, std::string &errMsg); 51 bool setCodePICModel(lto_codegen_model, std::string &errMsg);
45 52
46 void setCpu(const char* mCpu) { _mCpu = mCpu; } 53 void setCpu(const char* mCpu) { _mCpu = mCpu; }
47 54
48 void addMustPreserveSymbol(const char* sym) { 55 void addMustPreserveSymbol(const char* sym) {
49 _mustPreserveSymbols[sym] = 1; 56 _mustPreserveSymbols[sym] = 1;
50 } 57 }
51 58
52 bool writeMergedModules(const char *path, std::string &errMsg); 59 bool writeMergedModules(const char *path, std::string &errMsg);
(...skipping 27 matching lines...) Expand all
80 llvm::TargetMachine* _target; 87 llvm::TargetMachine* _target;
81 bool _emitDwarfDebugInfo; 88 bool _emitDwarfDebugInfo;
82 bool _scopeRestrictionsDone; 89 bool _scopeRestrictionsDone;
83 lto_codegen_model _codeModel; 90 lto_codegen_model _codeModel;
84 StringSet _mustPreserveSymbols; 91 StringSet _mustPreserveSymbols;
85 StringSet _asmUndefinedRefs; 92 StringSet _asmUndefinedRefs;
86 llvm::MemoryBuffer* _nativeObjectFile; 93 llvm::MemoryBuffer* _nativeObjectFile;
87 std::vector<char*> _codegenOptions; 94 std::vector<char*> _codegenOptions;
88 std::string _mCpu; 95 std::string _mCpu;
89 std::string _nativeObjectPath; 96 std::string _nativeObjectPath;
97
98 // @LOCALMOD
99 std::vector<LTOModule*> _gatheredModules;
90 }; 100 };
91 101
92 #endif // LTO_CODE_GENERATOR_H 102 #endif // LTO_CODE_GENERATOR_H
OLDNEW
« no previous file with comments | « llvm/tools/llc/llc.cpp ('k') | llvm/tools/lto/LTOCodeGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698