Skip to content

Commit

Permalink
[Support] Fix namespace after #123990
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jan 24, 2025
1 parent 474f5d2 commit 5daecd4
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions llvm/lib/Support/AArch64BuildAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "llvm/Support/AArch64BuildAttributes.h"
#include "llvm/ADT/StringSwitch.h"

namespace llvm {
namespace AArch64BuildAttributes {
using namespace llvm;
using namespace llvm::AArch64BuildAttributes;

StringRef getVendorName(unsigned Vendor) {
StringRef AArch64BuildAttributes::getVendorName(unsigned Vendor) {
switch (Vendor) {
case AEABI_FEATURE_AND_BITS:
return "aeabi_feature_and_bits";
Expand All @@ -25,14 +25,14 @@ StringRef getVendorName(unsigned Vendor) {
return "";
}
}
VendorID getVendorID(StringRef Vendor) {
VendorID AArch64BuildAttributes::getVendorID(StringRef Vendor) {
return StringSwitch<VendorID>(Vendor)
.Case("aeabi_feature_and_bits", AEABI_FEATURE_AND_BITS)
.Case("aeabi_pauthabi", AEABI_PAUTHABI)
.Default(VENDOR_UNKNOWN);
}

StringRef getOptionalStr(unsigned Optional) {
StringRef AArch64BuildAttributes::getOptionalStr(unsigned Optional) {
switch (Optional) {
case REQUIRED:
return "required";
Expand All @@ -43,18 +43,18 @@ StringRef getOptionalStr(unsigned Optional) {
return "";
}
}
SubsectionOptional getOptionalID(StringRef Optional) {
SubsectionOptional AArch64BuildAttributes::getOptionalID(StringRef Optional) {
return StringSwitch<SubsectionOptional>(Optional)
.Case("required", REQUIRED)
.Case("optional", OPTIONAL)
.Default(OPTIONAL_NOT_FOUND);
}
StringRef getSubsectionOptionalUnknownError() {
StringRef AArch64BuildAttributes::getSubsectionOptionalUnknownError() {
return "unknown AArch64 build attributes optionality, expected "
"required|optional";
}

StringRef getTypeStr(unsigned Type) {
StringRef AArch64BuildAttributes::getTypeStr(unsigned Type) {
switch (Type) {
case ULEB128:
return "uleb128";
Expand All @@ -65,17 +65,17 @@ StringRef getTypeStr(unsigned Type) {
return "";
}
}
SubsectionType getTypeID(StringRef Type) {
SubsectionType AArch64BuildAttributes::getTypeID(StringRef Type) {
return StringSwitch<SubsectionType>(Type)
.Cases("uleb128", "ULEB128", ULEB128)
.Cases("ntbs", "NTBS", NTBS)
.Default(TYPE_NOT_FOUND);
}
StringRef getSubsectionTypeUnknownError() {
StringRef AArch64BuildAttributes::getSubsectionTypeUnknownError() {
return "unknown AArch64 build attributes type, expected uleb128|ntbs";
}

StringRef getPauthABITagsStr(unsigned PauthABITag) {
StringRef AArch64BuildAttributes::getPauthABITagsStr(unsigned PauthABITag) {
switch (PauthABITag) {
case TAG_PAUTH_PLATFORM:
return "Tag_PAuth_Platform";
Expand All @@ -86,14 +86,16 @@ StringRef getPauthABITagsStr(unsigned PauthABITag) {
return "";
}
}
PauthABITags getPauthABITagsID(StringRef PauthABITag) {

PauthABITags AArch64BuildAttributes::getPauthABITagsID(StringRef PauthABITag) {
return StringSwitch<PauthABITags>(PauthABITag)
.Case("Tag_PAuth_Platform", TAG_PAUTH_PLATFORM)
.Case("Tag_PAuth_Schema", TAG_PAUTH_SCHEMA)
.Default(PAUTHABI_TAG_NOT_FOUND);
}

StringRef getFeatureAndBitsTagsStr(unsigned FeatureAndBitsTag) {
StringRef
AArch64BuildAttributes::getFeatureAndBitsTagsStr(unsigned FeatureAndBitsTag) {
switch (FeatureAndBitsTag) {
case TAG_FEATURE_BTI:
return "Tag_Feature_BTI";
Expand All @@ -106,12 +108,12 @@ StringRef getFeatureAndBitsTagsStr(unsigned FeatureAndBitsTag) {
return "";
}
}
FeatureAndBitsTags getFeatureAndBitsTagsID(StringRef FeatureAndBitsTag) {

FeatureAndBitsTags
AArch64BuildAttributes::getFeatureAndBitsTagsID(StringRef FeatureAndBitsTag) {
return StringSwitch<FeatureAndBitsTags>(FeatureAndBitsTag)
.Case("Tag_Feature_BTI", TAG_FEATURE_BTI)
.Case("Tag_Feature_PAC", TAG_FEATURE_PAC)
.Case("Tag_Feature_GCS", TAG_FEATURE_GCS)
.Default(FEATURE_AND_BITS_TAG_NOT_FOUND);
}
} // namespace AArch64BuildAttributes
} // namespace llvm

0 comments on commit 5daecd4

Please sign in to comment.