@@ -1317,8 +1317,6 @@ static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) {
1317
1317
// / 'encodeLLVMAttributesForBitcode'.
1318
1318
static void decodeLLVMAttributesForBitcode (AttrBuilder &B,
1319
1319
uint64_t EncodedAttrs) {
1320
- // FIXME: Remove in 4.0.
1321
-
1322
1320
// The alignment is stored as a 16-bit raw value from bits 31--16. We shift
1323
1321
// the bits above 31 down by 11 bits.
1324
1322
unsigned Alignment = (EncodedAttrs & (0xffffULL << 16 )) >> 16 ;
@@ -1369,7 +1367,7 @@ Error BitcodeReader::parseAttributeBlock() {
1369
1367
default : // Default behavior: ignore.
1370
1368
break ;
1371
1369
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 .
1373
1371
if (Record.size () & 1 )
1374
1372
return error (" Invalid record" );
1375
1373
@@ -1777,7 +1775,7 @@ Error BitcodeReader::parseTypeTableBody() {
1777
1775
break ;
1778
1776
}
1779
1777
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.
1781
1779
// FUNCTION: [vararg, attrid, retty, paramty x N]
1782
1780
if (Record.size () < 3 )
1783
1781
return error (" Invalid record" );
@@ -2700,8 +2698,10 @@ Error BitcodeReader::parseConstants() {
2700
2698
if (!IdxTy)
2701
2699
return error (" Invalid record" );
2702
2700
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.
2704
2703
Op1 = ValueList.getConstantFwdRef (Record[2 ], Type::getInt32Ty (Context));
2704
+ }
2705
2705
if (!Op1)
2706
2706
return error (" Invalid record" );
2707
2707
V = ConstantExpr::getExtractElement (Op0, Op1);
@@ -2721,8 +2721,10 @@ Error BitcodeReader::parseConstants() {
2721
2721
if (!IdxTy)
2722
2722
return error (" Invalid record" );
2723
2723
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.
2725
2726
Op2 = ValueList.getConstantFwdRef (Record[2 ], Type::getInt32Ty (Context));
2727
+ }
2726
2728
if (!Op2)
2727
2729
return error (" Invalid record" );
2728
2730
V = ConstantExpr::getInsertElement (Op0, Op1, Op2);
@@ -2762,7 +2764,7 @@ Error BitcodeReader::parseConstants() {
2762
2764
break ;
2763
2765
}
2764
2766
// 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 .
2766
2768
case bitc::CST_CODE_INLINEASM_OLD: {
2767
2769
if (Record.size () < 2 )
2768
2770
return error (" Invalid record" );
@@ -3163,8 +3165,8 @@ Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
3163
3165
}
3164
3166
GlobalValue::VisibilityTypes Visibility = GlobalValue::DefaultVisibility;
3165
3167
// Local linkage must have default visibility.
3168
+ // auto-upgrade `hidden` and `protected` for old bitcode.
3166
3169
if (Record.size () > 6 && !GlobalValue::isLocalLinkage (Linkage))
3167
- // FIXME: Change to an error if non-default in 4.0.
3168
3170
Visibility = getDecodedVisibility (Record[6 ]);
3169
3171
3170
3172
GlobalVariable::ThreadLocalMode TLM = GlobalVariable::NotThreadLocal;
@@ -3293,8 +3295,8 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
3293
3295
Func->setSection (SectionTable[Record[6 ] - 1 ]);
3294
3296
}
3295
3297
// Local linkage must have default visibility.
3298
+ // auto-upgrade `hidden` and `protected` for old bitcode.
3296
3299
if (!Func->hasLocalLinkage ())
3297
- // FIXME: Change to an error if non-default in 4.0.
3298
3300
Func->setVisibility (getDecodedVisibility (Record[7 ]));
3299
3301
if (Record.size () > 8 && Record[8 ]) {
3300
3302
if (Record[8 ] - 1 >= GCTable.size ())
@@ -3401,12 +3403,11 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord(
3401
3403
3402
3404
assert (NewGA->getValueType () == flattenPointerTypes (FullTy) &&
3403
3405
" Incorrect fully structured type provided for GlobalIndirectSymbol" );
3404
- // Old bitcode files didn't have visibility field.
3405
3406
// Local linkage must have default visibility.
3407
+ // auto-upgrade `hidden` and `protected` for old bitcode.
3406
3408
if (OpNum != Record.size ()) {
3407
3409
auto VisInd = OpNum++;
3408
3410
if (!NewGA->hasLocalLinkage ())
3409
- // FIXME: Change to an error if non-default in 4.0.
3410
3411
NewGA->setVisibility (getDecodedVisibility (Record[VisInd]));
3411
3412
}
3412
3413
if (BitCode == bitc::MODULE_CODE_ALIAS ||
@@ -3659,7 +3660,7 @@ Error BitcodeReader::parseModule(uint64_t ResumeBit,
3659
3660
break ;
3660
3661
}
3661
3662
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 .
3663
3664
std::string S;
3664
3665
if (convertToString (Record, 0 , S))
3665
3666
return error (" Invalid record" );
0 commit comments