summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-12 19:11:15 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-12 19:11:15 +0000
commite33ba16368ee981c4db7e4e4293c74744a91803b (patch)
tree70c127402ddb17638738c853195ff6903b9f1393 /llvm/lib/Bitcode
parent0035bf33c4b7c36eb7921bc415767e8a1ca6a8ab (diff)
downloadbcm5719-llvm-e33ba16368ee981c4db7e4e4293c74744a91803b.tar.gz
bcm5719-llvm-e33ba16368ee981c4db7e4e4293c74744a91803b.zip
Added versions of ReadPtr that takes an explicit SerializedPtrID. This allows
clients of the Deserializer to read the pointer ID before they are ready to deserialize the object (which can mean registering a pointer reference with the backpatcher). Changed some methods that took an argument "SerializedPtrID" to "const SerializedPtrID&" (pass-by-reference). This is to accommodate a future revision of SerializedPtrID where it may be much fatter than an unsigned integer. llvm-svn: 44021
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/Deserialize.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/Deserialize.cpp b/llvm/lib/Bitcode/Reader/Deserialize.cpp
index 2e8b4ef08c4..ea6b27a62e9 100644
--- a/llvm/lib/Bitcode/Reader/Deserialize.cpp
+++ b/llvm/lib/Bitcode/Reader/Deserialize.cpp
@@ -324,7 +324,9 @@ void Deserializer::ReadCStr(std::vector<char>& buff, bool isNullTerm) {
buff.push_back('\0');
}
-void Deserializer::RegisterPtr(SerializedPtrID PtrId, const void* Ptr) {
+void Deserializer::RegisterPtr(const SerializedPtrID& PtrId,
+ const void* Ptr) {
+
MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
assert (!HasFinalPtr(E) && "Pointer already registered.");
@@ -336,9 +338,9 @@ void Deserializer::RegisterPtr(SerializedPtrID PtrId, const void* Ptr) {
SetPtr(E,Ptr);
}
-void Deserializer::ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch) {
- SerializedPtrID PtrId = ReadPtrID();
-
+void Deserializer::ReadUIntPtr(uintptr_t& PtrRef,
+ const SerializedPtrID& PtrId,
+ bool AllowBackpatch) {
if (PtrId == 0) {
PtrRef = 0;
return;
OpenPOWER on IntegriCloud