Skip to content

Commit b21ee48

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 2524146 commit b21ee48

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
@@ -853,6 +853,8 @@ inline constexpr Alias CpuAliases[] = {{"cobalt-100", "neoverse-n2"},
853853

854854
inline constexpr Alias ExtAliases[] = {{"rdma", "rdm"}};
855855

856+
const ExtensionInfo &getExtensionByID(ArchExtKind(ExtID));
857+
856858
bool getExtensionFeatures(
857859
const AArch64::ExtensionBitset &Extensions,
858860
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)