Some whitespace cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153567 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2012-03-28 04:17:34 +00:00
parent d4ec0547a2
commit 30fe94ea43

View File

@@ -29,13 +29,12 @@
// forward references to llvm classes // forward references to llvm classes
namespace llvm { namespace llvm {
class MemoryBuffer; class MemoryBuffer;
class GlobalValue; class GlobalValue;
class Value; class Value;
class Function; class Function;
} }
// //
// C++ class which implements the opaque lto_module_t // C++ class which implements the opaque lto_module_t
// //
@@ -43,13 +42,11 @@ struct LTOModule {
static bool isBitcodeFile(const void* mem, size_t length); static bool isBitcodeFile(const void* mem, size_t length);
static bool isBitcodeFile(const char* path); static bool isBitcodeFile(const char* path);
static bool isBitcodeFileForTarget(const void* mem, static bool isBitcodeFileForTarget(const void* mem,
size_t length, const char* triplePrefix); size_t length,
const char* triplePrefix);
static bool isBitcodeFileForTarget(const char* path, static bool isBitcodeFileForTarget(const char* path,
const char* triplePrefix); const char* triplePrefix);
static LTOModule* makeLTOModule(const char* path, static LTOModule* makeLTOModule(const char* path,
std::string& errMsg); std::string& errMsg);
static LTOModule* makeLTOModule(int fd, const char *path, static LTOModule* makeLTOModule(int fd, const char *path,
@@ -62,16 +59,14 @@ struct LTOModule {
std::string& errMsg); std::string& errMsg);
static LTOModule* makeLTOModule(const void* mem, size_t length, static LTOModule* makeLTOModule(const void* mem, size_t length,
std::string& errMsg); std::string& errMsg);
const char* getTargetTriple(); const char* getTargetTriple();
void setTargetTriple(const char*); void setTargetTriple(const char*);
uint32_t getSymbolCount(); uint32_t getSymbolCount();
lto_symbol_attributes getSymbolAttributes(uint32_t index); lto_symbol_attributes getSymbolAttributes(uint32_t index);
const char* getSymbolName(uint32_t index); const char* getSymbolName(uint32_t index);
llvm::Module * getLLVVMModule() { return _module.get(); } llvm::Module * getLLVVMModule() { return _module.get(); }
const std::vector<const char*> &getAsmUndefinedRefs() { const std::vector<const char*> &getAsmUndefinedRefs() {
return _asm_undefines; return _asm_undefines;
} }
private: private:
@@ -82,7 +77,7 @@ private:
bool isFunction); bool isFunction);
void addPotentialUndefinedSymbol(llvm::GlobalValue* decl); void addPotentialUndefinedSymbol(llvm::GlobalValue* decl);
void addDefinedFunctionSymbol(llvm::Function* f); void addDefinedFunctionSymbol(llvm::Function* f);
void addDefinedDataSymbol(llvm::GlobalValue* v); void addDefinedDataSymbol(llvm::GlobalValue* v);
bool addAsmGlobalSymbols(std::string &errMsg); bool addAsmGlobalSymbols(std::string &errMsg);
void addAsmGlobalSymbol(const char *, void addAsmGlobalSymbol(const char *,
lto_symbol_attributes scope); lto_symbol_attributes scope);
@@ -94,30 +89,30 @@ private:
std::string& name); std::string& name);
static bool isTargetMatch(llvm::MemoryBuffer* memBuffer, static bool isTargetMatch(llvm::MemoryBuffer* memBuffer,
const char* triplePrefix); const char* triplePrefix);
static LTOModule* makeLTOModule(llvm::MemoryBuffer* buffer, static LTOModule* makeLTOModule(llvm::MemoryBuffer* buffer,
std::string& errMsg); std::string& errMsg);
static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length); static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length);
typedef llvm::StringMap<uint8_t> StringSet; typedef llvm::StringMap<uint8_t> StringSet;
struct NameAndAttributes { struct NameAndAttributes {
const char* name; const char* name;
lto_symbol_attributes attributes; lto_symbol_attributes attributes;
}; };
llvm::OwningPtr<llvm::Module> _module; llvm::OwningPtr<llvm::Module> _module;
llvm::OwningPtr<llvm::TargetMachine> _target; llvm::OwningPtr<llvm::TargetMachine> _target;
std::vector<NameAndAttributes> _symbols; std::vector<NameAndAttributes> _symbols;
// _defines and _undefines only needed to disambiguate tentative definitions // _defines and _undefines only needed to disambiguate tentative definitions
StringSet _defines; StringSet _defines;
llvm::StringMap<NameAndAttributes> _undefines; llvm::StringMap<NameAndAttributes> _undefines;
std::vector<const char*> _asm_undefines; std::vector<const char*> _asm_undefines;
llvm::MCContext _context; llvm::MCContext _context;
// Use mangler to add GlobalPrefix to names to match linker names. // Use mangler to add GlobalPrefix to names to match linker names.
llvm::Mangler _mangler; llvm::Mangler _mangler;
}; };
#endif // LTO_MODULE_H #endif // LTO_MODULE_H