From 70c2fc0823bcc3970fdebf18ba69449d7822af86 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 9 Sep 2010 23:12:39 +0000 Subject: Discard metadata produced by LLVM 2.7. The value enumeration it used is different from what the code now uses in a two ways: NamedMDNodes were considered Values and included in the numbering, and the function-local metadata counter wasn't reset between functions. The later problem breaks lazy deserialization, so instead of trying to emulate the old numbering, just drop the old metadata. The only in-tree use case is debug info with LTO, where the QOI loss is considered acceptable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113557 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Bitcode/LLVMBitCodes.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'include/llvm/Bitcode/LLVMBitCodes.h') diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h index 942c032..4f9b783 100644 --- a/include/llvm/Bitcode/LLVMBitCodes.h +++ b/include/llvm/Bitcode/LLVMBitCodes.h @@ -110,12 +110,20 @@ namespace bitc { enum MetadataCodes { METADATA_STRING = 1, // MDSTRING: [values] - METADATA_NODE = 2, // MDNODE: [n x (type num, value num)] - METADATA_FN_NODE = 3, // FN_MDNODE: [n x (type num, value num)] + // FIXME: Remove NODE in favor of NODE2 in LLVM 3.0 + METADATA_NODE = 2, // NODE with potentially invalid metadata + // FIXME: Remove FN_NODE in favor of FN_NODE2 in LLVM 3.0 + METADATA_FN_NODE = 3, // FN_NODE with potentially invalid metadata METADATA_NAME = 4, // STRING: [values] - METADATA_NAMED_NODE = 5, // NAMEDMDNODE: [n x mdnodes] + // FIXME: Remove NAMED_NODE in favor of NAMED_NODE2 in LLVM 3.0 + METADATA_NAMED_NODE = 5, // NAMED_NODE with potentially invalid metadata METADATA_KIND = 6, // [n x [id, name]] - METADATA_ATTACHMENT = 7 // [m x [value, [n x [id, mdnode]]] + // FIXME: Remove ATTACHMENT in favor of ATTACHMENT2 in LLVM 3.0 + METADATA_ATTACHMENT = 7, // ATTACHMENT with potentially invalid metadata + METADATA_NODE2 = 8, // NODE2: [n x (type num, value num)] + METADATA_FN_NODE2 = 9, // FN_NODE2: [n x (type num, value num)] + METADATA_NAMED_NODE2 = 10, // NAMED_NODE2: [n x mdnodes] + METADATA_ATTACHMENT2 = 11 // [m x [value, [n x [id, mdnode]]] }; // The constants block (CONSTANTS_BLOCK_ID) describes emission for each // constant and maintains an implicit current type value. @@ -223,7 +231,8 @@ namespace bitc { FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol] // FIXME: Remove STORE in favor of STORE2 in LLVM 3.0 FUNC_CODE_INST_STORE = 21, // STORE: [valty,val,ptr, align, vol] - FUNC_CODE_INST_CALL = 22, // CALL: [attr, fnty, fnid, args...] + // FIXME: Remove CALL in favor of CALL2 in LLVM 3.0 + FUNC_CODE_INST_CALL = 22, // CALL with potentially invalid metadata FUNC_CODE_INST_VAARG = 23, // VAARG: [valistty, valist, instty] // This store code encodes the pointer type, rather than the value type // this is so information only available in the pointer type (e.g. address @@ -241,8 +250,13 @@ namespace bitc { FUNC_CODE_INST_INBOUNDS_GEP= 30, // INBOUNDS_GEP: [n x operands] FUNC_CODE_INST_INDIRECTBR = 31, // INDIRECTBR: [opty, op0, op1, ...] - FUNC_CODE_DEBUG_LOC = 32, // DEBUG_LOC: [Line,Col,ScopeVal, IAVal] - FUNC_CODE_DEBUG_LOC_AGAIN = 33 // DEBUG_LOC_AGAIN + // FIXME: Remove DEBUG_LOC in favor of DEBUG_LOC2 in LLVM 3.0 + FUNC_CODE_DEBUG_LOC = 32, // DEBUG_LOC with potentially invalid metadata + FUNC_CODE_DEBUG_LOC_AGAIN = 33, // DEBUG_LOC_AGAIN + + FUNC_CODE_INST_CALL2 = 34, // CALL2: [attr, fnty, fnid, args...] + + FUNC_CODE_DEBUG_LOC2 = 35 // DEBUG_LOC2: [Line,Col,ScopeVal, IAVal] }; } // End bitc namespace } // End llvm namespace -- cgit v1.1