@@ -326,10 +326,10 @@ Error DataLayout::parseSpecifier(StringRef Desc) {
326
326
continue ;
327
327
}
328
328
329
- char Specifier = Tok.front ();
329
+ char SpecifierChar = Tok.front ();
330
330
Tok = Tok.substr (1 );
331
331
332
- switch (Specifier ) {
332
+ switch (SpecifierChar ) {
333
333
case ' s' :
334
334
// Deprecated, but ignoring here to preserve loading older textual llvm
335
335
// ASM file
@@ -408,21 +408,21 @@ Error DataLayout::parseSpecifier(StringRef Desc) {
408
408
case ' v' :
409
409
case ' f' :
410
410
case ' a' : {
411
- PrimitiveSpecifier PrimSpecifier ;
412
- switch (Specifier ) {
411
+ TypeSpecifier Specifier ;
412
+ switch (SpecifierChar ) {
413
413
default :
414
414
llvm_unreachable (" Unexpected specifier!" );
415
415
case ' i' :
416
- PrimSpecifier = PrimitiveSpecifier ::Integer;
416
+ Specifier = TypeSpecifier ::Integer;
417
417
break ;
418
418
case ' v' :
419
- PrimSpecifier = PrimitiveSpecifier ::Vector;
419
+ Specifier = TypeSpecifier ::Vector;
420
420
break ;
421
421
case ' f' :
422
- PrimSpecifier = PrimitiveSpecifier ::Float;
422
+ Specifier = TypeSpecifier ::Float;
423
423
break ;
424
424
case ' a' :
425
- PrimSpecifier = PrimitiveSpecifier ::Aggregate;
425
+ Specifier = TypeSpecifier ::Aggregate;
426
426
break ;
427
427
}
428
428
@@ -432,7 +432,7 @@ Error DataLayout::parseSpecifier(StringRef Desc) {
432
432
if (Error Err = getInt (Tok, Size))
433
433
return Err;
434
434
435
- if (PrimSpecifier == PrimitiveSpecifier ::Aggregate && Size != 0 )
435
+ if (Specifier == TypeSpecifier ::Aggregate && Size != 0 )
436
436
return reportError (
437
437
" Sized aggregate specification in datalayout string" );
438
438
@@ -445,16 +445,15 @@ Error DataLayout::parseSpecifier(StringRef Desc) {
445
445
unsigned ABIAlign;
446
446
if (Error Err = getIntInBytes (Tok, ABIAlign))
447
447
return Err;
448
- if (PrimSpecifier != PrimitiveSpecifier ::Aggregate && !ABIAlign)
448
+ if (Specifier != TypeSpecifier ::Aggregate && !ABIAlign)
449
449
return reportError (
450
450
" ABI alignment specification must be >0 for non-aggregate types" );
451
451
452
452
if (!isUInt<16 >(ABIAlign))
453
453
return reportError (" Invalid ABI alignment, must be a 16bit integer" );
454
454
if (ABIAlign != 0 && !isPowerOf2_64 (ABIAlign))
455
455
return reportError (" Invalid ABI alignment, must be a power of 2" );
456
- if (PrimSpecifier == PrimitiveSpecifier::Integer && Size == 8 &&
457
- ABIAlign != 1 )
456
+ if (Specifier == TypeSpecifier::Integer && Size == 8 && ABIAlign != 1 )
458
457
return reportError (
459
458
" Invalid ABI alignment, i8 must be naturally aligned" );
460
459
@@ -473,9 +472,8 @@ Error DataLayout::parseSpecifier(StringRef Desc) {
473
472
if (PrefAlign != 0 && !isPowerOf2_64 (PrefAlign))
474
473
return reportError (" Invalid preferred alignment, must be a power of 2" );
475
474
476
- if (Error Err =
477
- setPrimitiveSpec (PrimSpecifier, Size, assumeAligned (ABIAlign),
478
- assumeAligned (PrefAlign)))
475
+ if (Error Err = setPrimitiveSpec (Specifier, Size, assumeAligned (ABIAlign),
476
+ assumeAligned (PrefAlign)))
479
477
return Err;
480
478
481
479
break ;
@@ -592,9 +590,8 @@ findPrimitiveSpecLowerBound(
592
590
});
593
591
}
594
592
595
- Error DataLayout::setPrimitiveSpec (PrimitiveSpecifier Specifier,
596
- uint32_t BitWidth, Align ABIAlign,
597
- Align PrefAlign) {
593
+ Error DataLayout::setPrimitiveSpec (TypeSpecifier Specifier, uint32_t BitWidth,
594
+ Align ABIAlign, Align PrefAlign) {
598
595
// AlignmentsTy::ABIAlign and AlignmentsTy::PrefAlign were once stored as
599
596
// uint16_t, it is unclear if there are requirements for alignment to be less
600
597
// than 2^16 other than storage. In the meantime we leave the restriction as
@@ -608,17 +605,17 @@ Error DataLayout::setPrimitiveSpec(PrimitiveSpecifier Specifier,
608
605
609
606
SmallVectorImpl<PrimitiveSpec> *Specs;
610
607
switch (Specifier) {
611
- case PrimitiveSpecifier ::Aggregate:
608
+ case TypeSpecifier ::Aggregate:
612
609
StructABIAlignment = ABIAlign;
613
610
StructPrefAlignment = PrefAlign;
614
611
return Error::success ();
615
- case PrimitiveSpecifier ::Integer:
612
+ case TypeSpecifier ::Integer:
616
613
Specs = &IntSpecs;
617
614
break ;
618
- case PrimitiveSpecifier ::Float:
615
+ case TypeSpecifier ::Float:
619
616
Specs = &FloatSpecs;
620
617
break ;
621
- case PrimitiveSpecifier ::Vector:
618
+ case TypeSpecifier ::Vector:
622
619
Specs = &VectorSpecs;
623
620
break ;
624
621
}
0 commit comments