mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
add bitcode reader support for blockaddress. We can now fully
round trip blockaddress through .ll and .bc files, so add a testcase. There are still a bunch of places in the optimizer and other places that need to be updated to work with these constructs, but at least the basics are in now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -94,7 +94,7 @@ public:
|
||||
class BitcodeReaderMDValueList {
|
||||
std::vector<WeakVH> MDValuePtrs;
|
||||
|
||||
LLVMContext& Context;
|
||||
LLVMContext &Context;
|
||||
public:
|
||||
BitcodeReaderMDValueList(LLVMContext& C) : Context(C) {}
|
||||
|
||||
@ -122,7 +122,7 @@ public:
|
||||
};
|
||||
|
||||
class BitcodeReader : public ModuleProvider {
|
||||
LLVMContext& Context;
|
||||
LLVMContext &Context;
|
||||
MemoryBuffer *Buffer;
|
||||
BitstreamReader StreamFile;
|
||||
BitstreamCursor Stream;
|
||||
@ -163,6 +163,12 @@ class BitcodeReader : public ModuleProvider {
|
||||
/// map contains info about where to find deferred function body (in the
|
||||
/// stream) and what linkage the original function had.
|
||||
DenseMap<Function*, std::pair<uint64_t, unsigned> > DeferredFunctionInfo;
|
||||
|
||||
/// BlockAddrFwdRefs - These are blockaddr references to basic blocks. These
|
||||
/// are resolved lazily when functions are loaded.
|
||||
typedef std::pair<unsigned, GlobalVariable*> BlockAddrRefTy;
|
||||
DenseMap<Function*, std::vector<BlockAddrRefTy> > BlockAddrFwdRefs;
|
||||
|
||||
public:
|
||||
explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext& C)
|
||||
: Context(C), Buffer(buffer), ErrorString(0), ValueList(C), MDValueList(C) {
|
||||
|
Reference in New Issue
Block a user