llvm.org GIT mirror llvm / 30fe94e
Some whitespace cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153567 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
1 changed file(s) with 14 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
2828
2929 // forward references to llvm classes
3030 namespace llvm {
31 class MemoryBuffer;
32 class GlobalValue;
33 class Value;
34 class Function;
31 class MemoryBuffer;
32 class GlobalValue;
33 class Value;
34 class Function;
3535 }
36
3736
3837 //
3938 // C++ class which implements the opaque lto_module_t
4241
4342 static bool isBitcodeFile(const void* mem, size_t length);
4443 static bool isBitcodeFile(const char* path);
45
4644 static bool isBitcodeFileForTarget(const void* mem,
47 size_t length, const char* triplePrefix);
48
45 size_t length,
46 const char* triplePrefix);
4947 static bool isBitcodeFileForTarget(const char* path,
5048 const char* triplePrefix);
51
5249 static LTOModule* makeLTOModule(const char* path,
5350 std::string& errMsg);
5451 static LTOModule* makeLTOModule(int fd, const char *path,
6158 std::string& errMsg);
6259 static LTOModule* makeLTOModule(const void* mem, size_t length,
6360 std::string& errMsg);
64
6561 const char* getTargetTriple();
6662 void setTargetTriple(const char*);
6763 uint32_t getSymbolCount();
6864 lto_symbol_attributes getSymbolAttributes(uint32_t index);
6965 const char* getSymbolName(uint32_t index);
70
7166 llvm::Module * getLLVVMModule() { return _module.get(); }
7267 const std::vector &getAsmUndefinedRefs() {
73 return _asm_undefines;
68 return _asm_undefines;
7469 }
7570
7671 private:
8176 bool isFunction);
8277 void addPotentialUndefinedSymbol(llvm::GlobalValue* decl);
8378 void addDefinedFunctionSymbol(llvm::Function* f);
84 void addDefinedDataSymbol(llvm::GlobalValue* v);
79 void addDefinedDataSymbol(llvm::GlobalValue* v);
8580 bool addAsmGlobalSymbols(std::string &errMsg);
8681 void addAsmGlobalSymbol(const char *,
8782 lto_symbol_attributes scope);
9388 std::string& name);
9489
9590 static bool isTargetMatch(llvm::MemoryBuffer* memBuffer,
96 const char* triplePrefix);
97
91 const char* triplePrefix);
9892 static LTOModule* makeLTOModule(llvm::MemoryBuffer* buffer,
99 std::string& errMsg);
93 std::string& errMsg);
10094 static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length);
10195
10296 typedef llvm::StringMap StringSet;
10397
10498 struct NameAndAttributes {
105 const char* name;
106 lto_symbol_attributes attributes;
99 const char* name;
100 lto_symbol_attributes attributes;
107101 };
108102
109103 llvm::OwningPtr _module;
110104 llvm::OwningPtr _target;
111105 std::vector _symbols;
106
112107 // _defines and _undefines only needed to disambiguate tentative definitions
113108 StringSet _defines;
114109 llvm::StringMap _undefines;
115110 std::vector _asm_undefines;
116111 llvm::MCContext _context;
112
117113 // Use mangler to add GlobalPrefix to names to match linker names.
118114 llvm::Mangler _mangler;
119115 };
120116
121117 #endif // LTO_MODULE_H
122