forked from OSchip/llvm-project
Remove references to the 4.0 release as a major breaking (NFC)
This is cleaning up comments (mostly in the bitcode handling) about removing some backward compatibility aspect in the 4.0 release. Historically, "4.0" was used during the development of the 3.x versions as "this future major breaking change version". At the time the major number was used to indicate the compatibility. When we reached 3.9 we decided to change the numbering, instead of going to 3.10 we went to 4.0 but after changing the meaning of the major number to not mean anything anymore with respect to bitcode backward compatibility. The current policy (https://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility) indicates only now: The current LLVM version supports loading any bitcode since version 3.0. Differential Revision: https://reviews.llvm.org/D82514
This commit is contained in:
parent
b2303debfa
commit
4abf024336
|
@ -57,7 +57,7 @@ An ``AttributeList`` object is designed to be passed around by value.
|
|||
|
||||
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 @@ should be passed by reference.
|
|||
|
||||
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.
|
||||
|
|
|
@ -85,7 +85,7 @@ enum ModuleCodes {
|
|||
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 @@ enum ModuleCodes {
|
|||
|
||||
/// 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, ...]
|
||||
|
|
|
@ -130,7 +130,7 @@ static Optional<const char *> GetCodeName(unsigned CodeID, unsigned BlockID,
|
|||
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)
|
||||
|
|
|
@ -1317,8 +1317,6 @@ static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) {
|
|||
/// '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 @@ Error BitcodeReader::parseAttributeBlock() {
|
|||
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 @@ Error BitcodeReader::parseTypeTableBody() {
|
|||
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");
|
||||
|
@ -2700,8 +2698,10 @@ Error BitcodeReader::parseConstants() {
|
|||
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);
|
||||
|
@ -2721,8 +2721,10 @@ Error BitcodeReader::parseConstants() {
|
|||
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);
|
||||
|
@ -2762,7 +2764,7 @@ Error BitcodeReader::parseConstants() {
|
|||
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");
|
||||
|
@ -3163,8 +3165,8 @@ Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
|
|||
}
|
||||
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;
|
||||
|
@ -3293,8 +3295,8 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
|
|||
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())
|
||||
|
@ -3401,12 +3403,11 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord(
|
|||
|
||||
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 ||
|
||||
|
@ -3659,7 +3660,7 @@ Error BitcodeReader::parseModule(uint64_t ResumeBit,
|
|||
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");
|
||||
|
|
|
@ -1132,7 +1132,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
|
|||
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 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
|
|||
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");
|
||||
|
||||
|
|
|
@ -260,8 +260,8 @@ void DataLayout::parseSpecifier(StringRef Desc) {
|
|||
|
||||
switch (Specifier) {
|
||||
case 's':
|
||||
// Ignored for backward compatibility.
|
||||
// FIXME: remove this on LLVM 4.0.
|
||||
// Deprecated, but ignoring here to preserve loading older textual llvm
|
||||
// ASM file
|
||||
break;
|
||||
case 'E':
|
||||
BigEndian = true;
|
||||
|
|
Loading…
Reference in New Issue