mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-21 18:26:41 +00:00
Add a SymbolicFile interface between Binary and ObjectFile.
This interface allows IRObjectFile to be implemented without having dummy methods for all section and segment related methods. Both llvm-ar and llvm-nm are changed to use it. Unfortunately the mangler is still not plugged in since it requires some refactoring to make a Module hold a DataLayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201881 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
44
include/llvm/Object/IRObjectFile.h
Normal file
44
include/llvm/Object/IRObjectFile.h
Normal file
@@ -0,0 +1,44 @@
|
||||
//===- IRObjectFile.h - LLVM IR object file implementation ------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file declares the IRObjectFile template class.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_OBJECT_IR_OBJECT_FILE_H
|
||||
#define LLVM_OBJECT_IR_OBJECT_FILE_H
|
||||
|
||||
#include "llvm/Object/SymbolicFile.h"
|
||||
|
||||
namespace llvm {
|
||||
class Module;
|
||||
class GlobalValue;
|
||||
|
||||
namespace object {
|
||||
class IRObjectFile : public SymbolicFile {
|
||||
OwningPtr<Module> M;
|
||||
public:
|
||||
IRObjectFile(MemoryBuffer *Object, error_code &EC, LLVMContext &Context,
|
||||
bool BufferOwned);
|
||||
void moveSymbolNext(DataRefImpl &Symb) const LLVM_OVERRIDE;
|
||||
error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const
|
||||
LLVM_OVERRIDE;
|
||||
uint32_t getSymbolFlags(DataRefImpl Symb) const LLVM_OVERRIDE;
|
||||
const GlobalValue &getSymbolGV(DataRefImpl Symb) const;
|
||||
basic_symbol_iterator symbol_begin_impl() const LLVM_OVERRIDE;
|
||||
basic_symbol_iterator symbol_end_impl() const LLVM_OVERRIDE;
|
||||
|
||||
static inline bool classof(const Binary *v) {
|
||||
return v->isIR();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user