Add full auto-upgrade support for LLVM 2.7 bitcode metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113764 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-09-13 18:00:48 +00:00
parent 2c5f19db2e
commit 9b10dfb7d6
2 changed files with 49 additions and 31 deletions

View File

@@ -173,11 +173,18 @@ class BitcodeReader : public GVMaterializer {
/// are resolved lazily when functions are loaded.
typedef std::pair<unsigned, GlobalVariable*> BlockAddrRefTy;
DenseMap<Function*, std::vector<BlockAddrRefTy> > BlockAddrFwdRefs;
/// LLVM2_7MetadataDetected - True if metadata produced by LLVM 2.7 or
/// earlier was detected, in which case we behave slightly differently,
/// for compatibility.
/// FIXME: Remove in LLVM 3.0.
bool LLVM2_7MetadataDetected;
public:
explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C)
: Context(C), TheModule(0), Buffer(buffer), BufferOwned(false),
ErrorString(0), ValueList(C), MDValueList(C) {
ErrorString(0), ValueList(C), MDValueList(C),
LLVM2_7MetadataDetected(false) {
HasReversedFunctionsWithBodies = false;
}
~BitcodeReader() {