@@ -522,8 +522,7 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) {
522
522
523
523
llvm::Expected<std::unique_ptr<RISCVISAInfo>>
524
524
RISCVISAInfo::parseArchString (StringRef Arch, bool EnableExperimentalExtension,
525
- bool ExperimentalExtensionVersionCheck,
526
- bool IgnoreUnknown) {
525
+ bool ExperimentalExtensionVersionCheck) {
527
526
// RISC-V ISA strings must be [a-z0-9_]
528
527
if (!llvm::all_of (
529
528
Arch, [](char C) { return isDigit (C) || isLower (C) || C == ' _' ; }))
@@ -567,7 +566,7 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
567
566
NewArch += ArchWithoutProfile.str ();
568
567
}
569
568
return parseArchString (NewArch, EnableExperimentalExtension,
570
- ExperimentalExtensionVersionCheck, IgnoreUnknown );
569
+ ExperimentalExtensionVersionCheck);
571
570
}
572
571
}
573
572
@@ -601,16 +600,8 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
601
600
// Baseline is `i` or `e`
602
601
if (auto E = getExtensionVersion (
603
602
StringRef (&Baseline, 1 ), Exts, Major, Minor, ConsumeLength,
604
- EnableExperimentalExtension, ExperimentalExtensionVersionCheck)) {
605
- if (!IgnoreUnknown)
606
- return std::move (E);
607
- // If IgnoreUnknown, then ignore an unrecognised version of the baseline
608
- // ISA and just use the default supported version.
609
- consumeError (std::move (E));
610
- auto Version = findDefaultVersion (StringRef (&Baseline, 1 ));
611
- Major = Version->Major ;
612
- Minor = Version->Minor ;
613
- }
603
+ EnableExperimentalExtension, ExperimentalExtensionVersionCheck))
604
+ return std::move (E);
614
605
615
606
// Postpone AddExtension until end of this function
616
607
SeenExtMap[StringRef (&Baseline, 1 ).str ()] = {Major, Minor};
@@ -677,11 +668,10 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
677
668
Ext = StringRef ();
678
669
679
670
assert (!Type.empty () && " Empty type?" );
680
- if (!IgnoreUnknown && Name.size () == Type.size ())
671
+ if (Name.size () == Type.size ())
681
672
return createStringError (errc::invalid_argument,
682
673
Desc + " name missing after '" + Type + " '" );
683
674
} else {
684
- // FIXME: Could it be ignored by IgnoreUnknown?
685
675
return createStringError (errc::invalid_argument,
686
676
" invalid standard user-level extension '" +
687
677
Twine (Ext.front ()) + " '" );
@@ -690,27 +680,17 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
690
680
unsigned Major, Minor, ConsumeLength;
691
681
if (auto E = getExtensionVersion (Name, Vers, Major, Minor, ConsumeLength,
692
682
EnableExperimentalExtension,
693
- ExperimentalExtensionVersionCheck)) {
694
- if (!IgnoreUnknown)
695
- return E;
696
-
697
- consumeError (std::move (E));
698
- if (Name.size () == 1 )
699
- Ext = Ext.substr (ConsumeLength);
700
- continue ;
701
- }
683
+ ExperimentalExtensionVersionCheck))
684
+ return E;
702
685
703
686
if (Name.size () == 1 )
704
687
Ext = Ext.substr (ConsumeLength);
705
688
706
689
// Check if duplicated extension.
707
- if (!IgnoreUnknown && SeenExtMap.contains (Name.str ()))
690
+ if (SeenExtMap.contains (Name.str ()))
708
691
return createStringError (errc::invalid_argument,
709
692
" duplicated " + Desc + " '" + Name + " '" );
710
693
711
- if (IgnoreUnknown && !RISCVISAInfo::isSupportedExtension (Name))
712
- continue ;
713
-
714
694
SeenExtMap[Name.str ()] = {Major, Minor};
715
695
} while (!Ext.empty ());
716
696
}
0 commit comments