mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Added support for processing abbreviations in the Deserializer.
Added some #ifdef-controlled messages for debugging backpatching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43771 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -13,6 +13,10 @@
|
||||
|
||||
#include "llvm/Bitcode/Deserialize.h"
|
||||
|
||||
#ifdef DEBUG_BACKPATCH
|
||||
#include "llvm/Support/Streams.h"
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
Deserializer::Deserializer(BitstreamReader& stream)
|
||||
@ -71,6 +75,11 @@ void Deserializer::ReadRecord() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Code == bitc::DEFINE_ABBREV) {
|
||||
Stream.ReadAbbrevRecord();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -136,6 +145,10 @@ void Deserializer::RegisterPtr(unsigned PtrId, const void* Ptr) {
|
||||
|
||||
assert (!HasFinalPtr(E) && "Pointer already registered.");
|
||||
|
||||
#ifdef DEBUG_BACKPATCH
|
||||
llvm::cerr << "RegisterPtr: " << PtrId << " => " << Ptr << "\n";
|
||||
#endif
|
||||
|
||||
SetPtr(E,Ptr);
|
||||
}
|
||||
|
||||
@ -145,8 +158,12 @@ void Deserializer::ReadUIntPtr(uintptr_t& PtrRef) {
|
||||
if (PtrId == 0) {
|
||||
PtrRef = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG_BACKPATCH
|
||||
llvm::cerr << "ReadUintPtr: " << PtrId << "\n";
|
||||
#endif
|
||||
|
||||
MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
|
||||
|
||||
if (HasFinalPtr(E))
|
||||
|
Reference in New Issue
Block a user