Skip to content

Commit 491a1cd

Browse files
authored
[AArch64]: Refactor target parser to use Bitset. (#65423)
Use Bitset instead of BitMasking for the Architecture Extensions, as the number of extensions will exceed the bitmask bits eventually.
1 parent bfddbda commit 491a1cd

File tree

5 files changed

+1103
-913
lines changed

5 files changed

+1103
-913
lines changed

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ bool AArch64TargetInfo::initFeatureMap(
979979
// Parse the CPU and add any implied features.
980980
std::optional<llvm::AArch64::CpuInfo> CpuInfo = llvm::AArch64::parseCpu(CPU);
981981
if (CpuInfo) {
982-
uint64_t Exts = CpuInfo->getImpliedExtensions();
982+
llvm::Bitset Exts = CpuInfo->getImpliedExtensions();
983983
std::vector<StringRef> CPUFeats;
984984
llvm::AArch64::getExtensionFeatures(Exts, CPUFeats);
985985
for (auto F : CPUFeats) {

clang/lib/Driver/ToolChains/Arch/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static bool DecodeAArch64Mcpu(const Driver &D, StringRef Mcpu, StringRef &CPU,
158158

159159
Features.push_back(ArchInfo->ArchFeature);
160160

161-
uint64_t Extension = CpuInfo->getImpliedExtensions();
161+
llvm::Bitset Extension = CpuInfo->getImpliedExtensions();
162162
if (!llvm::AArch64::getExtensionFeatures(Extension, Features))
163163
return false;
164164
}

0 commit comments

Comments
 (0)