aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/Deserialize.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-06 22:21:14 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-06 22:21:14 +0000
commitcd0c32865cecf85f43ec20021de331f048a66115 (patch)
tree4838e9cf91db2c51025e407b5c5e38356c60bac4 /llvm/lib/Bitcode/Reader/Deserialize.cpp
parent581f006f5dea030c96a8289e4c32bd884cea5b51 (diff)
downloadllvm-cd0c32865cecf85f43ec20021de331f048a66115.zip
llvm-cd0c32865cecf85f43ec20021de331f048a66115.tar.gz
llvm-cd0c32865cecf85f43ec20021de331f048a66115.tar.bz2
Augmented ReadPtr and ReadOwnedPtr to control whether or not a pointer is allowed to be backpatched
or can be registered with the deserializer to backpatch other pointers. llvm-svn: 43783
Diffstat (limited to 'llvm/lib/Bitcode/Reader/Deserialize.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/Deserialize.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/Deserialize.cpp b/llvm/lib/Bitcode/Reader/Deserialize.cpp
index 5642f37..d4ed26b 100644
--- a/llvm/lib/Bitcode/Reader/Deserialize.cpp
+++ b/llvm/lib/Bitcode/Reader/Deserialize.cpp
@@ -152,7 +152,7 @@ void Deserializer::RegisterPtr(unsigned PtrId, const void* Ptr) {
SetPtr(E,Ptr);
}
-void Deserializer::ReadUIntPtr(uintptr_t& PtrRef) {
+void Deserializer::ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch) {
unsigned PtrId = ReadInt();
if (PtrId == 0) {
@@ -169,6 +169,9 @@ void Deserializer::ReadUIntPtr(uintptr_t& PtrRef) {
if (HasFinalPtr(E))
PtrRef = GetFinalPtr(E);
else {
+ assert (AllowBackpatch &&
+ "Client forbids backpatching for this pointer.");
+
// Register backpatch. Check the freelist for a BPNode.
BPNode* N;