Skip to content

Commit db0ca41

Browse files
committed
[NFC] Add Extension Lookup to AArch64TargetParser
Currently, an extension cannot be found using the ExtID. To address this, the function `lookupExtensionByID` has been added to the `ExtensionSet` Class so it can be targeted from outside the function. This will allow for the Extensions Information to be searched for and stored externally to the ExtensionSet Class. This enables being able to search for if Architecture Features have been enabled by the user in the command line.
1 parent 443377a commit db0ca41

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

llvm/include/llvm/TargetParser/AArch64TargetParser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ inline constexpr Alias CpuAliases[] = {{"cobalt-100", "neoverse-n2"},
799799

800800
inline constexpr Alias ExtAliases[] = {{"rdma", "rdm"}};
801801

802+
const ExtensionInfo &getExtensionByID(ArchExtKind(ExtID));
803+
802804
bool getExtensionFeatures(
803805
const AArch64::ExtensionBitset &Extensions,
804806
std::vector<StringRef> &Features);

llvm/lib/TargetParser/AArch64TargetParser.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,8 @@ bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) {
280280
}
281281
return false;
282282
}
283+
284+
const AArch64::ExtensionInfo &
285+
AArch64::getExtensionByID(AArch64::ArchExtKind ExtID) {
286+
return lookupExtensionByID(ExtID);
287+
}

0 commit comments

Comments
 (0)