From 50b136dae90eb37f9fc9517a8638020db4f04f9c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 28 Oct 2009 05:53:48 +0000 Subject: 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 --- lib/Bitcode/Reader/BitcodeReader.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/Bitcode/Reader/BitcodeReader.h') diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h index eefc7bdc28..7b3a1ae893 100644 --- a/lib/Bitcode/Reader/BitcodeReader.h +++ b/lib/Bitcode/Reader/BitcodeReader.h @@ -94,7 +94,7 @@ public: class BitcodeReaderMDValueList { std::vector 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 > DeferredFunctionInfo; + + /// BlockAddrFwdRefs - These are blockaddr references to basic blocks. These + /// are resolved lazily when functions are loaded. + typedef std::pair BlockAddrRefTy; + DenseMap > BlockAddrFwdRefs; + public: explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext& C) : Context(C), Buffer(buffer), ErrorString(0), ValueList(C), MDValueList(C) { -- cgit v1.2.3-18-g5258