@@ -1717,13 +1717,13 @@ static void findCSKYMultilibs(const Driver &D, const llvm::Triple &TargetTriple,
1717
1717
}
1718
1718
1719
1719
// / Extend the multi-lib re-use selection mechanism for RISC-V.
1720
- // / This funciton will try to re-use multi-lib if they are compatible.
1720
+ // / This function will try to re-use multi-lib if they are compatible.
1721
1721
// / Definition of compatible:
1722
1722
// / - ABI must be the same.
1723
1723
// / - multi-lib is a subset of current arch, e.g. multi-lib=march=rv32im
1724
1724
// / is a subset of march=rv32imc.
1725
1725
// / - march that contains atomic extension can't reuse multi-lib that
1726
- // / doesn't has atomic, vice versa. e.g. multi-lib=march=rv32im and
1726
+ // / doesn't have atomic, vice versa. e.g. multi-lib=march=rv32im and
1727
1727
// / march=rv32ima are not compatible, because software and hardware
1728
1728
// / atomic operation can't work together correctly.
1729
1729
static bool
@@ -1734,21 +1734,20 @@ RISCVMultilibSelect(const MultilibSet &RISCVMultilibSet, StringRef Arch,
1734
1734
if (RISCVMultilibSet.select (Flags, SelectedMultilibs))
1735
1735
return true ;
1736
1736
1737
- llvm::StringMap<bool > FlagSet;
1738
1737
Multilib::flags_list NewFlags;
1739
1738
std::vector<MultilibBuilder> NewMultilibs;
1740
1739
1741
- auto ParseResult = llvm::RISCVISAInfo::parseArchString (
1742
- Arch, /* EnableExperimentalExtension=*/ true ,
1743
- /* ExperimentalExtensionVersionCheck=*/ false );
1740
+ llvm::Expected<std::unique_ptr<llvm::RISCVISAInfo>> ParseResult =
1741
+ llvm::RISCVISAInfo::parseArchString (
1742
+ Arch, /* EnableExperimentalExtension=*/ true ,
1743
+ /* ExperimentalExtensionVersionCheck=*/ false );
1744
1744
if (!ParseResult) {
1745
- // Ignore any error here, we assume it will handled in another place.
1745
+ // Ignore any error here, we assume it will be handled in another place.
1746
1746
consumeError (ParseResult.takeError ());
1747
1747
return false ;
1748
1748
}
1749
- auto &ISAInfo = *ParseResult;
1750
1749
1751
- auto CurrentExts = ISAInfo-> getExtensions () ;
1750
+ auto &ISAInfo = *ParseResult ;
1752
1751
1753
1752
addMultilibFlag (ISAInfo->getXLen () == 32 , " -m32" , NewFlags);
1754
1753
addMultilibFlag (ISAInfo->getXLen () == 64 , " -m64" , NewFlags);
@@ -1762,7 +1761,7 @@ RISCVMultilibSelect(const MultilibSet &RISCVMultilibSet, StringRef Arch,
1762
1761
}
1763
1762
1764
1763
llvm::StringSet<> AllArchExts;
1765
- // Reconstruct multi-lib list, and break march option into seperated
1764
+ // Reconstruct multi-lib list, and break march option into separated
1766
1765
// extension. e.g. march=rv32im -> +i +m
1767
1766
for (auto M : RISCVMultilibSet) {
1768
1767
bool Skip = false ;
@@ -1777,21 +1776,23 @@ RISCVMultilibSelect(const MultilibSet &RISCVMultilibSet, StringRef Arch,
1777
1776
}
1778
1777
1779
1778
// Break down -march into individual extension.
1780
- auto MLConfigParseResult = llvm::RISCVISAInfo::parseArchString (
1781
- Flag.drop_front (7 ), /* EnableExperimentalExtension=*/ true ,
1782
- /* ExperimentalExtensionVersionCheck=*/ false );
1779
+ llvm::Expected<std::unique_ptr<llvm::RISCVISAInfo>> MLConfigParseResult =
1780
+ llvm::RISCVISAInfo::parseArchString (
1781
+ Flag.drop_front (7 ), /* EnableExperimentalExtension=*/ true ,
1782
+ /* ExperimentalExtensionVersionCheck=*/ false );
1783
1783
if (!MLConfigParseResult) {
1784
1784
// Ignore any error here, we assume it will handled in another place.
1785
1785
llvm::consumeError (MLConfigParseResult.takeError ());
1786
1786
1787
- // We might got parsing error if rv32e in the list, we could just skip
1787
+ // We might get parsing error if rv32e in the list, we could just skip
1788
1788
// that and process the rest of multi-lib configs.
1789
1789
Skip = true ;
1790
1790
continue ;
1791
1791
}
1792
1792
auto &MLConfigISAInfo = *MLConfigParseResult;
1793
1793
1794
- auto MLConfigArchExts = MLConfigISAInfo->getExtensions ();
1794
+ const llvm::RISCVISAInfo::OrderedExtensionMap &MLConfigArchExts =
1795
+ MLConfigISAInfo->getExtensions ();
1795
1796
for (auto MLConfigArchExt : MLConfigArchExts) {
1796
1797
auto ExtName = MLConfigArchExt.first ;
1797
1798
NewMultilib.flag (Twine (" -" , ExtName).str ());
0 commit comments