[llvm] c4eb880 - Revert "[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 22:10:31 PDT 2023
Author: Weining Lu
Date: 2023-07-19T13:08:47+08:00
New Revision: c4eb880d433171d6571c873bd2e5510978816f5a
URL: https://github.com/llvm/llvm-project/commit/c4eb880d433171d6571c873bd2e5510978816f5a
DIFF: https://github.com/llvm/llvm-project/commit/c4eb880d433171d6571c873bd2e5510978816f5a.diff
LOG: Revert "[LoongArch] Change 'using namespace llvm;' to 'namespace llvm {' in LoongArchTargetParser.cpp. NFC"
This reverts commit 586321467a0d48573ae643e837a6c4eaf6bc75db.
Reason to revert:
These changes are inconsistent with the [[https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions|LLVM stype guide]].
Added:
Modified:
llvm/lib/TargetParser/LoongArchTargetParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/TargetParser/LoongArchTargetParser.cpp b/llvm/lib/TargetParser/LoongArchTargetParser.cpp
index 30eb6c638a20fe..18b04600dbc660 100644
--- a/llvm/lib/TargetParser/LoongArchTargetParser.cpp
+++ b/llvm/lib/TargetParser/LoongArchTargetParser.cpp
@@ -13,8 +13,8 @@
#include "llvm/TargetParser/LoongArchTargetParser.h"
-namespace llvm {
-namespace LoongArch {
+using namespace llvm;
+using namespace llvm::LoongArch;
const FeatureInfo AllFeatures[] = {
#define LOONGARCH_FEATURE(NAME, KIND) {NAME, KIND},
@@ -27,14 +27,15 @@ const ArchInfo AllArchs[] = {
#include "llvm/TargetParser/LoongArchTargetParser.def"
};
-bool isValidArchName(StringRef Arch) {
+bool LoongArch::isValidArchName(StringRef Arch) {
for (const auto A : AllArchs)
if (A.Name == Arch)
return true;
return false;
}
-bool getArchFeatures(StringRef Arch, std::vector<StringRef> &Features) {
+bool LoongArch::getArchFeatures(StringRef Arch,
+ std::vector<StringRef> &Features) {
for (const auto A : AllArchs) {
if (A.Name == Arch) {
for (const auto F : AllFeatures)
@@ -45,5 +46,3 @@ bool getArchFeatures(StringRef Arch, std::vector<StringRef> &Features) {
}
return false;
}
-} // namespace LoongArch
-} // namespace llvm
More information about the llvm-commits
mailing list