diff --git a/llvm/docs/HowToUseAttributes.rst b/llvm/docs/HowToUseAttributes.rst --- a/llvm/docs/HowToUseAttributes.rst +++ b/llvm/docs/HowToUseAttributes.rst @@ -57,7 +57,7 @@ Note: It is advised that you do *not* use the ``AttributeList`` "introspection" methods (e.g. ``Raw``, ``getRawPointer``, etc.). These methods break -encapsulation, and may be removed in a future release (i.e. LLVM 4.0). +encapsulation, and may be removed in a future release. ``AttrBuilder`` =============== @@ -73,7 +73,7 @@ Note: It is advised that you do *not* use the ``AttrBuilder::addRawValue()`` method or the ``AttrBuilder(uint64_t Val)`` constructor. These are for -backwards compatibility and may be removed in a future release (i.e. LLVM 4.0). +backwards compatibility and may be removed in a future release. And that's basically it! A lot of functionality is hidden behind these classes, but the interfaces are pretty straight forward. diff --git a/llvm/include/llvm/Bitcode/LLVMBitCodes.h b/llvm/include/llvm/Bitcode/LLVMBitCodes.h --- a/llvm/include/llvm/Bitcode/LLVMBitCodes.h +++ b/llvm/include/llvm/Bitcode/LLVMBitCodes.h @@ -85,7 +85,7 @@ MODULE_CODE_ASM = 4, // ASM: [strchr x N] MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N] - // FIXME: Remove DEPLIB in 4.0. + // Deprecated, but still needed to read old bitcode files. MODULE_CODE_DEPLIB = 6, // DEPLIB: [strchr x N] // GLOBALVAR: [pointer type, isconst, initid, @@ -121,7 +121,7 @@ /// PARAMATTR blocks have code for defining a parameter attribute set. enum AttributeCodes { - // FIXME: Remove `PARAMATTR_CODE_ENTRY_OLD' in 4.0 + // Deprecated, but still needed to read old bitcode files. PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0, // paramidx1, attr1...] PARAMATTR_CODE_ENTRY = 2, // ENTRY: [attrgrp0, attrgrp1, ...] diff --git a/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp b/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp --- a/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp @@ -130,7 +130,7 @@ STRINGIFY_CODE(MODULE_CODE, DATALAYOUT) STRINGIFY_CODE(MODULE_CODE, ASM) STRINGIFY_CODE(MODULE_CODE, SECTIONNAME) - STRINGIFY_CODE(MODULE_CODE, DEPLIB) // FIXME: Remove in 4.0 + STRINGIFY_CODE(MODULE_CODE, DEPLIB) // Deprecated, present in old bitcode STRINGIFY_CODE(MODULE_CODE, GLOBALVAR) STRINGIFY_CODE(MODULE_CODE, FUNCTION) STRINGIFY_CODE(MODULE_CODE, ALIAS) diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1317,8 +1317,6 @@ /// 'encodeLLVMAttributesForBitcode'. static void decodeLLVMAttributesForBitcode(AttrBuilder &B, uint64_t EncodedAttrs) { - // FIXME: Remove in 4.0. - // The alignment is stored as a 16-bit raw value from bits 31--16. We shift // the bits above 31 down by 11 bits. unsigned Alignment = (EncodedAttrs & (0xffffULL << 16)) >> 16; @@ -1369,7 +1367,7 @@ default: // Default behavior: ignore. break; case bitc::PARAMATTR_CODE_ENTRY_OLD: // ENTRY: [paramidx0, attr0, ...] - // FIXME: Remove in 4.0. + // Deprecated, but still needed to read old bitcode files. if (Record.size() & 1) return error("Invalid record"); @@ -1777,7 +1775,7 @@ break; } case bitc::TYPE_CODE_FUNCTION_OLD: { - // FIXME: attrid is dead, remove it in LLVM 4.0 + // Deprecated, but still needed to read old bitcode files. // FUNCTION: [vararg, attrid, retty, paramty x N] if (Record.size() < 3) return error("Invalid record"); @@ -2702,8 +2700,10 @@ if (!IdxTy) return error("Invalid record"); Op1 = ValueList.getConstantFwdRef(Record[3], IdxTy); - } else // TODO: Remove with llvm 4.0 + } else { + // Deprecated, but still needed to read old bitcode files. Op1 = ValueList.getConstantFwdRef(Record[2], Type::getInt32Ty(Context)); + } if (!Op1) return error("Invalid record"); V = ConstantExpr::getExtractElement(Op0, Op1); @@ -2723,8 +2723,10 @@ if (!IdxTy) return error("Invalid record"); Op2 = ValueList.getConstantFwdRef(Record[3], IdxTy); - } else // TODO: Remove with llvm 4.0 + } else { + // Deprecated, but still needed to read old bitcode files. Op2 = ValueList.getConstantFwdRef(Record[2], Type::getInt32Ty(Context)); + } if (!Op2) return error("Invalid record"); V = ConstantExpr::getInsertElement(Op0, Op1, Op2); @@ -2766,7 +2768,7 @@ break; } // This maintains backward compatibility, pre-asm dialect keywords. - // FIXME: Remove with the 4.0 release. + // Deprecated, but still needed to read old bitcode files. case bitc::CST_CODE_INLINEASM_OLD: { if (Record.size() < 2) return error("Invalid record"); @@ -3167,8 +3169,8 @@ } GlobalValue::VisibilityTypes Visibility = GlobalValue::DefaultVisibility; // Local linkage must have default visibility. + // auto-upgrade `hidden` and `protected` for old bitcode. if (Record.size() > 6 && !GlobalValue::isLocalLinkage(Linkage)) - // FIXME: Change to an error if non-default in 4.0. Visibility = getDecodedVisibility(Record[6]); GlobalVariable::ThreadLocalMode TLM = GlobalVariable::NotThreadLocal; @@ -3297,8 +3299,8 @@ Func->setSection(SectionTable[Record[6] - 1]); } // Local linkage must have default visibility. + // auto-upgrade `hidden` and `protected` for old bitcode. if (!Func->hasLocalLinkage()) - // FIXME: Change to an error if non-default in 4.0. Func->setVisibility(getDecodedVisibility(Record[7])); if (Record.size() > 8 && Record[8]) { if (Record[8] - 1 >= GCTable.size()) @@ -3405,12 +3407,11 @@ assert(NewGA->getValueType() == flattenPointerTypes(FullTy) && "Incorrect fully structured type provided for GlobalIndirectSymbol"); - // Old bitcode files didn't have visibility field. // Local linkage must have default visibility. + // auto-upgrade `hidden` and `protected` for old bitcode. if (OpNum != Record.size()) { auto VisInd = OpNum++; if (!NewGA->hasLocalLinkage()) - // FIXME: Change to an error if non-default in 4.0. NewGA->setVisibility(getDecodedVisibility(Record[VisInd])); } if (BitCode == bitc::MODULE_CODE_ALIAS || @@ -3663,7 +3664,7 @@ break; } case bitc::MODULE_CODE_DEPLIB: { // DEPLIB: [strchr x N] - // FIXME: Remove in 4.0. + // Deprecated, but still needed to read old bitcode files. std::string S; if (convertToString(Record, 0, S)) return error("Invalid record"); diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1132,7 +1132,7 @@ break; } case bitc::METADATA_OLD_FN_NODE: { - // FIXME: Remove in 4.0. + // Deprecated, but still needed to read old bitcode files. // This is a LocalAsMetadata record, the only type of function-local // metadata. if (Record.size() % 2 == 1) @@ -1162,7 +1162,7 @@ break; } case bitc::METADATA_OLD_NODE: { - // FIXME: Remove in 4.0. + // Deprecated, but still needed to read old bitcode files. if (Record.size() % 2 == 1) return error("Invalid record"); diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -261,7 +261,6 @@ switch (Specifier) { case 's': // Ignored for backward compatibility. - // FIXME: remove this on LLVM 4.0. break; case 'E': BigEndian = true;