Skip to content

Commit 4abf024

Browse files
committed
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
1 parent b2303de commit 4abf024

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

llvm/docs/HowToUseAttributes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ An ``AttributeList`` object is designed to be passed around by value.
5757

5858
Note: It is advised that you do *not* use the ``AttributeList`` "introspection"
5959
methods (e.g. ``Raw``, ``getRawPointer``, etc.). These methods break
60-
encapsulation, and may be removed in a future release (i.e. LLVM 4.0).
60+
encapsulation, and may be removed in a future release.
6161

6262
``AttrBuilder``
6363
===============
@@ -73,7 +73,7 @@ should be passed by reference.
7373

7474
Note: It is advised that you do *not* use the ``AttrBuilder::addRawValue()``
7575
method or the ``AttrBuilder(uint64_t Val)`` constructor. These are for
76-
backwards compatibility and may be removed in a future release (i.e. LLVM 4.0).
76+
backwards compatibility and may be removed in a future release.
7777

7878
And that's basically it! A lot of functionality is hidden behind these classes,
7979
but the interfaces are pretty straight forward.

llvm/include/llvm/Bitcode/LLVMBitCodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ enum ModuleCodes {
8585
MODULE_CODE_ASM = 4, // ASM: [strchr x N]
8686
MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N]
8787

88-
// FIXME: Remove DEPLIB in 4.0.
88+
// Deprecated, but still needed to read old bitcode files.
8989
MODULE_CODE_DEPLIB = 6, // DEPLIB: [strchr x N]
9090

9191
// GLOBALVAR: [pointer type, isconst, initid,
@@ -121,7 +121,7 @@ enum ModuleCodes {
121121

122122
/// PARAMATTR blocks have code for defining a parameter attribute set.
123123
enum AttributeCodes {
124-
// FIXME: Remove `PARAMATTR_CODE_ENTRY_OLD' in 4.0
124+
// Deprecated, but still needed to read old bitcode files.
125125
PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0,
126126
// paramidx1, attr1...]
127127
PARAMATTR_CODE_ENTRY = 2, // ENTRY: [attrgrp0, attrgrp1, ...]

llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static Optional<const char *> GetCodeName(unsigned CodeID, unsigned BlockID,
130130
STRINGIFY_CODE(MODULE_CODE, DATALAYOUT)
131131
STRINGIFY_CODE(MODULE_CODE, ASM)
132132
STRINGIFY_CODE(MODULE_CODE, SECTIONNAME)
133-
STRINGIFY_CODE(MODULE_CODE, DEPLIB) // FIXME: Remove in 4.0
133+
STRINGIFY_CODE(MODULE_CODE, DEPLIB) // Deprecated, present in old bitcode
134134
STRINGIFY_CODE(MODULE_CODE, GLOBALVAR)
135135
STRINGIFY_CODE(MODULE_CODE, FUNCTION)
136136
STRINGIFY_CODE(MODULE_CODE, ALIAS)

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,8 +1317,6 @@ static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) {
13171317
/// 'encodeLLVMAttributesForBitcode'.
13181318
static void decodeLLVMAttributesForBitcode(AttrBuilder &B,
13191319
uint64_t EncodedAttrs) {
1320-
// FIXME: Remove in 4.0.
1321-
13221320
// The alignment is stored as a 16-bit raw value from bits 31--16. We shift
13231321
// the bits above 31 down by 11 bits.
13241322
unsigned Alignment = (EncodedAttrs & (0xffffULL << 16)) >> 16;
@@ -1369,7 +1367,7 @@ Error BitcodeReader::parseAttributeBlock() {
13691367
default: // Default behavior: ignore.
13701368
break;
13711369
case bitc::PARAMATTR_CODE_ENTRY_OLD: // ENTRY: [paramidx0, attr0, ...]
1372-
// FIXME: Remove in 4.0.
1370+
// Deprecated, but still needed to read old bitcode files.
13731371
if (Record.size() & 1)
13741372
return error("Invalid record");
13751373

@@ -1777,7 +1775,7 @@ Error BitcodeReader::parseTypeTableBody() {
17771775
break;
17781776
}
17791777
case bitc::TYPE_CODE_FUNCTION_OLD: {
1780-
// FIXME: attrid is dead, remove it in LLVM 4.0
1778+
// Deprecated, but still needed to read old bitcode files.
17811779
// FUNCTION: [vararg, attrid, retty, paramty x N]
17821780
if (Record.size() < 3)
17831781
return error("Invalid record");
@@ -2700,8 +2698,10 @@ Error BitcodeReader::parseConstants() {
27002698
if (!IdxTy)
27012699
return error("Invalid record");
27022700
Op1 = ValueList.getConstantFwdRef(Record[3], IdxTy);
2703-
} else // TODO: Remove with llvm 4.0
2701+
} else {
2702+
// Deprecated, but still needed to read old bitcode files.
27042703
Op1 = ValueList.getConstantFwdRef(Record[2], Type::getInt32Ty(Context));
2704+
}
27052705
if (!Op1)
27062706
return error("Invalid record");
27072707
V = ConstantExpr::getExtractElement(Op0, Op1);
@@ -2721,8 +2721,10 @@ Error BitcodeReader::parseConstants() {
27212721
if (!IdxTy)
27222722
return error("Invalid record");
27232723
Op2 = ValueList.getConstantFwdRef(Record[3], IdxTy);
2724-
} else // TODO: Remove with llvm 4.0
2724+
} else {
2725+
// Deprecated, but still needed to read old bitcode files.
27252726
Op2 = ValueList.getConstantFwdRef(Record[2], Type::getInt32Ty(Context));
2727+
}
27262728
if (!Op2)
27272729
return error("Invalid record");
27282730
V = ConstantExpr::getInsertElement(Op0, Op1, Op2);
@@ -2762,7 +2764,7 @@ Error BitcodeReader::parseConstants() {
27622764
break;
27632765
}
27642766
// This maintains backward compatibility, pre-asm dialect keywords.
2765-
// FIXME: Remove with the 4.0 release.
2767+
// Deprecated, but still needed to read old bitcode files.
27662768
case bitc::CST_CODE_INLINEASM_OLD: {
27672769
if (Record.size() < 2)
27682770
return error("Invalid record");
@@ -3163,8 +3165,8 @@ Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
31633165
}
31643166
GlobalValue::VisibilityTypes Visibility = GlobalValue::DefaultVisibility;
31653167
// Local linkage must have default visibility.
3168+
// auto-upgrade `hidden` and `protected` for old bitcode.
31663169
if (Record.size() > 6 && !GlobalValue::isLocalLinkage(Linkage))
3167-
// FIXME: Change to an error if non-default in 4.0.
31683170
Visibility = getDecodedVisibility(Record[6]);
31693171

31703172
GlobalVariable::ThreadLocalMode TLM = GlobalVariable::NotThreadLocal;
@@ -3293,8 +3295,8 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
32933295
Func->setSection(SectionTable[Record[6] - 1]);
32943296
}
32953297
// Local linkage must have default visibility.
3298+
// auto-upgrade `hidden` and `protected` for old bitcode.
32963299
if (!Func->hasLocalLinkage())
3297-
// FIXME: Change to an error if non-default in 4.0.
32983300
Func->setVisibility(getDecodedVisibility(Record[7]));
32993301
if (Record.size() > 8 && Record[8]) {
33003302
if (Record[8] - 1 >= GCTable.size())
@@ -3401,12 +3403,11 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord(
34013403

34023404
assert(NewGA->getValueType() == flattenPointerTypes(FullTy) &&
34033405
"Incorrect fully structured type provided for GlobalIndirectSymbol");
3404-
// Old bitcode files didn't have visibility field.
34053406
// Local linkage must have default visibility.
3407+
// auto-upgrade `hidden` and `protected` for old bitcode.
34063408
if (OpNum != Record.size()) {
34073409
auto VisInd = OpNum++;
34083410
if (!NewGA->hasLocalLinkage())
3409-
// FIXME: Change to an error if non-default in 4.0.
34103411
NewGA->setVisibility(getDecodedVisibility(Record[VisInd]));
34113412
}
34123413
if (BitCode == bitc::MODULE_CODE_ALIAS ||
@@ -3659,7 +3660,7 @@ Error BitcodeReader::parseModule(uint64_t ResumeBit,
36593660
break;
36603661
}
36613662
case bitc::MODULE_CODE_DEPLIB: { // DEPLIB: [strchr x N]
3662-
// FIXME: Remove in 4.0.
3663+
// Deprecated, but still needed to read old bitcode files.
36633664
std::string S;
36643665
if (convertToString(Record, 0, S))
36653666
return error("Invalid record");

llvm/lib/Bitcode/Reader/MetadataLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
11321132
break;
11331133
}
11341134
case bitc::METADATA_OLD_FN_NODE: {
1135-
// FIXME: Remove in 4.0.
1135+
// Deprecated, but still needed to read old bitcode files.
11361136
// This is a LocalAsMetadata record, the only type of function-local
11371137
// metadata.
11381138
if (Record.size() % 2 == 1)
@@ -1162,7 +1162,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
11621162
break;
11631163
}
11641164
case bitc::METADATA_OLD_NODE: {
1165-
// FIXME: Remove in 4.0.
1165+
// Deprecated, but still needed to read old bitcode files.
11661166
if (Record.size() % 2 == 1)
11671167
return error("Invalid record");
11681168

llvm/lib/IR/DataLayout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ void DataLayout::parseSpecifier(StringRef Desc) {
260260

261261
switch (Specifier) {
262262
case 's':
263-
// Ignored for backward compatibility.
264-
// FIXME: remove this on LLVM 4.0.
263+
// Deprecated, but ignoring here to preserve loading older textual llvm
264+
// ASM file
265265
break;
266266
case 'E':
267267
BigEndian = true;

0 commit comments

Comments
 (0)