//===----------------------------------------------------------------------===//
#include "llvm/Bitcode/Deserialize.h"
-
-#ifdef DEBUG_BACKPATCH
-#include "llvm/Support/Streams.h"
-#endif
-
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
Deserializer::Deserializer(BitstreamReader& stream)
: Stream(stream), RecIdx(0), FreeList(NULL), AbbrevNo(0), RecordCode(0) {
- StreamStart = Stream.GetCurrentBitNo();
+ StreamStart = Stream.GetCurrentBitNo();
}
Deserializer::~Deserializer() {
case bitc::END_BLOCK: {
bool x = Stream.ReadBlockEnd();
- assert (!x && "Error at block end.");
+ assert(!x && "Error at block end."); x=x;
BlockStack.pop_back();
continue;
}
cstr[i] = (char) ReadInt();
if (isNullTerm)
- cstr[len+1] = '\0';
+ cstr[len] = '\0';
return cstr;
}
assert (!HasFinalPtr(E) && "Pointer already registered.");
#ifdef DEBUG_BACKPATCH
- llvm::cerr << "RegisterPtr: " << PtrId << " => " << Ptr << "\n";
+ errs() << "RegisterPtr: " << PtrId << " => " << Ptr << "\n";
#endif
SetPtr(E,Ptr);
PtrRef = GetFinalPtr(E);
#ifdef DEBUG_BACKPATCH
- llvm::cerr << "ReadUintPtr: " << PtrId
- << " <-- " << (void*) GetFinalPtr(E) << '\n';
+ errs() << "ReadUintPtr: " << PtrId
+ << " <-- " << (void*) GetFinalPtr(E) << '\n';
#endif
}
else {
"Client forbids backpatching for this pointer.");
#ifdef DEBUG_BACKPATCH
- llvm::cerr << "ReadUintPtr: " << PtrId << " (NO PTR YET)\n";
+ errs() << "ReadUintPtr: " << PtrId << " (NO PTR YET)\n";
#endif
// Register backpatch. Check the freelist for a BPNode.