[llvm] 5863214 - [LoongArch] Change 'using namespace llvm;' to 'namespace llvm {' in LoongArchTargetParser.cpp. NFC
Weining Lu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 01:53:35 PDT 2023
Author: Weining Lu
Date: 2023-07-18T16:51:26+08:00
New Revision: 586321467a0d48573ae643e837a6c4eaf6bc75db
URL: https://github.com/llvm/llvm-project/commit/586321467a0d48573ae643e837a6c4eaf6bc75db
DIFF: https://github.com/llvm/llvm-project/commit/586321467a0d48573ae643e837a6c4eaf6bc75db.diff
LOG: [LoongArch] Change 'using namespace llvm;' to 'namespace llvm {' in LoongArchTargetParser.cpp. NFC
And change 'using namespace llvm::LoongArch' to 'namespace LoongArch {'
to simplify the code a little bit.
Added:
Modified:
llvm/lib/TargetParser/LoongArchTargetParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/TargetParser/LoongArchTargetParser.cpp b/llvm/lib/TargetParser/LoongArchTargetParser.cpp
index 18b04600dbc660..30eb6c638a20fe 100644
--- a/llvm/lib/TargetParser/LoongArchTargetParser.cpp
+++ b/llvm/lib/TargetParser/LoongArchTargetParser.cpp
@@ -13,8 +13,8 @@
#include "llvm/TargetParser/LoongArchTargetParser.h"
-using namespace llvm;
-using namespace llvm::LoongArch;
+namespace llvm {
+namespace LoongArch {
const FeatureInfo AllFeatures[] = {
#define LOONGARCH_FEATURE(NAME, KIND) {NAME, KIND},
@@ -27,15 +27,14 @@ const ArchInfo AllArchs[] = {
#include "llvm/TargetParser/LoongArchTargetParser.def"
};
-bool LoongArch::isValidArchName(StringRef Arch) {
+bool isValidArchName(StringRef Arch) {
for (const auto A : AllArchs)
if (A.Name == Arch)
return true;
return false;
}
-bool LoongArch::getArchFeatures(StringRef Arch,
- std::vector<StringRef> &Features) {
+bool getArchFeatures(StringRef Arch, std::vector<StringRef> &Features) {
for (const auto A : AllArchs) {
if (A.Name == Arch) {
for (const auto F : AllFeatures)
@@ -46,3 +45,5 @@ bool LoongArch::getArchFeatures(StringRef Arch,
}
return false;
}
+} // namespace LoongArch
+} // namespace llvm
More information about the llvm-commits
mailing list