LLVM
4.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
llvm.src
include
llvm
Object
IRObjectFile.h
Go to the documentation of this file.
1
//===- IRObjectFile.h - LLVM IR object file implementation ------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file declares the IRObjectFile template class.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_OBJECT_IROBJECTFILE_H
15
#define LLVM_OBJECT_IROBJECTFILE_H
16
17
#include "
llvm/ADT/PointerUnion.h
"
18
#include "
llvm/Object/ModuleSymbolTable.h
"
19
#include "
llvm/Object/SymbolicFile.h
"
20
21
namespace
llvm {
22
class
Mangler;
23
class
Module;
24
class
GlobalValue;
25
class
Triple;
26
27
namespace
object {
28
class
ObjectFile;
29
30
class
IRObjectFile
:
public
SymbolicFile
{
31
std::vector<std::unique_ptr<Module>> Mods;
32
ModuleSymbolTable
SymTab;
33
IRObjectFile
(
MemoryBufferRef
Object,
34
std::vector<std::unique_ptr<Module>> Mods);
35
36
public
:
37
~IRObjectFile
()
override
;
38
void
moveSymbolNext
(
DataRefImpl
&Symb)
const override
;
39
std::error_code
printSymbolName
(
raw_ostream
&OS,
40
DataRefImpl
Symb)
const override
;
41
uint32_t
getSymbolFlags
(
DataRefImpl
Symb)
const override
;
42
basic_symbol_iterator
symbol_begin
()
const override
;
43
basic_symbol_iterator
symbol_end
()
const override
;
44
45
StringRef
getTargetTriple
()
const
;
46
47
static
inline
bool
classof
(
const
Binary
*v) {
48
return
v->
isIR
();
49
}
50
51
/// \brief Finds and returns bitcode embedded in the given object file, or an
52
/// error code if not found.
53
static
ErrorOr<MemoryBufferRef>
findBitcodeInObject
(
const
ObjectFile
&Obj);
54
55
/// \brief Finds and returns bitcode in the given memory buffer (which may
56
/// be either a bitcode file or a native object file with embedded bitcode),
57
/// or an error code if not found.
58
static
ErrorOr<MemoryBufferRef>
59
findBitcodeInMemBuffer
(
MemoryBufferRef
Object);
60
61
static
Expected<std::unique_ptr<IRObjectFile>
>
create
(
MemoryBufferRef
Object,
62
LLVMContext
&
Context
);
63
};
64
}
65
}
66
67
#endif
SymbolicFile.h
llvm::ErrorOr
Represents either an error or a value T.
Definition:
ErrorOr.h:68
Context
LLVMContext & Context
Definition:
NVVMIntrRange.cpp:72
llvm::object::SymbolicFile
Definition:
SymbolicFile.h:128
llvm::object::DataRefImpl
Definition:
SymbolicFile.h:24
llvm::object::ObjectFile
This class is the base class for all object file types.
Definition:
ObjectFile.h:178
llvm::object::Binary
Definition:
Binary.h:29
llvm::Expected
Tagged union holding either a T or a Error.
Definition:
Support/Error.h:631
llvm::object::IRObjectFile::symbol_begin
basic_symbol_iterator symbol_begin() const override
Definition:
IRObjectFile.cpp:65
llvm::object::Binary::isIR
bool isIR() const
Definition:
Binary.h:126
llvm::object::IRObjectFile::findBitcodeInMemBuffer
static ErrorOr< MemoryBufferRef > findBitcodeInMemBuffer(MemoryBufferRef Object)
Finds and returns bitcode in the given memory buffer (which may be either a bitcode file or a native ...
Definition:
IRObjectFile.cpp:97
llvm::ModuleSymbolTable
Definition:
ModuleSymbolTable.h:30
llvm::object::IRObjectFile::printSymbolName
std::error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override
Definition:
IRObjectFile.cpp:55
llvm::object::IRObjectFile::create
static Expected< std::unique_ptr< IRObjectFile > > create(MemoryBufferRef Object, LLVMContext &Context)
Definition:
IRObjectFile.cpp:117
llvm::object::IRObjectFile::symbol_end
basic_symbol_iterator symbol_end() const override
Definition:
IRObjectFile.cpp:71
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition:
LLVMContext.h:48
llvm::object::content_iterator
Definition:
SymbolicFile.h:57
llvm::object::IRObjectFile::getTargetTriple
StringRef getTargetTriple() const
Definition:
IRObjectFile.cpp:78
llvm::object::IRObjectFile::classof
static bool classof(const Binary *v)
Definition:
IRObjectFile.h:47
llvm::object::IRObjectFile::~IRObjectFile
~IRObjectFile() override
Definition:
IRObjectFile.cpp:45
uint32_t
llvm::object::IRObjectFile
Definition:
IRObjectFile.h:30
llvm::MemoryBufferRef
Definition:
MemoryBuffer.h:158
llvm::object::IRObjectFile::moveSymbolNext
void moveSymbolNext(DataRefImpl &Symb) const override
Definition:
IRObjectFile.cpp:51
ModuleSymbolTable.h
llvm::object::IRObjectFile::findBitcodeInObject
static ErrorOr< MemoryBufferRef > findBitcodeInObject(const ObjectFile &Obj)
Finds and returns bitcode embedded in the given object file, or an error code if not found...
Definition:
IRObjectFile.cpp:84
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition:
raw_ostream.h:44
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:
StringRef.h:47
PointerUnion.h
llvm::object::IRObjectFile::getSymbolFlags
uint32_t getSymbolFlags(DataRefImpl Symb) const override
Definition:
IRObjectFile.cpp:61
Generated on Wed Mar 8 2017 17:11:24 for LLVM by
1.8.6