llvm.org GIT mirror llvm / 3c6b29b
Cleanup whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153634 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
1 changed file(s) with 12 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
33 //
44 // This file is distributed under the University of Illinois Open Source
55 // License. See LICENSE.TXT for details.
6 //
6 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file declares the LTOModule class.
9 // This file declares the LTOModule class.
1010 //
1111 //===----------------------------------------------------------------------===//
1212
4040 struct LTOModule {
4141 private:
4242 typedef llvm::StringMap StringSet;
43
44 struct NameAndAttributes {
45 enum name_type { IsFunction, IsData };
46 const char* name;
47 lto_symbol_attributes attributes;
43
44 struct NameAndAttributes {
45 const char *name;
46 uint32_t attributes;
4847 };
4948
5049 llvm::OwningPtr _module;
5251 std::vector _symbols;
5352
5453 // _defines and _undefines only needed to disambiguate tentative definitions
55 StringSet _defines;
54 StringSet _defines;
5655 llvm::StringMap _undefines;
5756 std::vector _asm_undefines;
5857 llvm::MCContext _context;
6968
7069 /// isBitcodeFileForTarget - Returns 'true' if the file or memory contents
7170 /// is LLVM bitcode for the specified triple.
72 static bool isBitcodeFileForTarget(const void *mem,
71 static bool isBitcodeFileForTarget(const void *mem,
7372 size_t length,
7473 const char *triplePrefix);
75 static bool isBitcodeFileForTarget(const char *path,
74 static bool isBitcodeFileForTarget(const char *path,
7675 const char *triplePrefix);
7776
7877 /// makeLTOModule - Create an LTOModule. N.B. These methods take ownership
108107 /// index.
109108 lto_symbol_attributes getSymbolAttributes(uint32_t index) {
110109 if (index < _symbols.size())
111 return _symbols[index].attributes;
112 else
113 return lto_symbol_attributes(0);
110 return lto_symbol_attributes(_symbols[index].attributes);
111 return lto_symbol_attributes(0);
114112 }
115113
116114 /// getSymbolName - Get the name of the symbol at the specified index.
117115 const char *getSymbolName(uint32_t index) {
118116 if (index < _symbols.size())
119117 return _symbols[index].name;
120 else
121 return NULL;
118 return NULL;
122119 }
123120
124121 /// getLLVVMModule - Return the Module.