[flang-commits] [flang] 321be24 - Revert "[flang][fir] Add support to mangle/deconstruct namelist group name"
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Fri Sep 24 09:49:56 PDT 2021
Author: Valentin Clement
Date: 2021-09-24T18:49:40+02:00
New Revision: 321be24aa6808c5829f3433407e13603901849f4
URL: https://github.com/llvm/llvm-project/commit/321be24aa6808c5829f3433407e13603901849f4
DIFF: https://github.com/llvm/llvm-project/commit/321be24aa6808c5829f3433407e13603901849f4.diff
LOG: Revert "[flang][fir] Add support to mangle/deconstruct namelist group name"
This reverts commit 3593ae4312f6156c9ca50d46cdb55a8dfad782d0.
Added:
Modified:
flang/include/flang/Optimizer/Support/InternalNames.h
flang/lib/Lower/Mangler.cpp
flang/lib/Optimizer/Support/InternalNames.cpp
flang/unittests/Optimizer/InternalNamesTest.cpp
Removed:
################################################################################
diff --git a/flang/include/flang/Optimizer/Support/InternalNames.h b/flang/include/flang/Optimizer/Support/InternalNames.h
index 36e3ed093ca42..fa98cc2a8e490 100644
--- a/flang/include/flang/Optimizer/Support/InternalNames.h
+++ b/flang/include/flang/Optimizer/Support/InternalNames.h
@@ -41,8 +41,7 @@ struct NameUniquer {
INTRINSIC_TYPE_DESC,
PROCEDURE,
TYPE_DESC,
- VARIABLE,
- NAMELIST_GROUP
+ VARIABLE
};
/// Components of an unparsed unique name
@@ -113,11 +112,6 @@ struct NameUniquer {
llvm::Optional<llvm::StringRef> host,
llvm::StringRef name);
- /// Unique a namelist group name
- static std::string doNamelistGroup(llvm::ArrayRef<llvm::StringRef> modules,
- llvm::Optional<llvm::StringRef> host,
- llvm::StringRef name);
-
/// Entry point for the PROGRAM (called by the runtime)
/// Can be overridden with the `--main-entry-name=<name>` option.
static llvm::StringRef doProgramEntry();
diff --git a/flang/lib/Lower/Mangler.cpp b/flang/lib/Lower/Mangler.cpp
index f74afc5b53dce..07d9e63e04232 100644
--- a/flang/lib/Lower/Mangler.cpp
+++ b/flang/lib/Lower/Mangler.cpp
@@ -114,12 +114,6 @@ Fortran::lower::mangle::mangleName(const Fortran::semantics::Symbol &symbol,
symbolName);
return fir::NameUniquer::doVariable(modNames, optHost, symbolName);
},
- [&](const Fortran::semantics::NamelistDetails &) {
- auto modNames = moduleNames(ultimateSymbol);
- auto optHost = hostName(ultimateSymbol);
- return fir::NameUniquer::doNamelistGroup(modNames, optHost,
- symbolName);
- },
[&](const Fortran::semantics::CommonBlockDetails &) {
return fir::NameUniquer::doCommonBlock(symbolName);
},
diff --git a/flang/lib/Optimizer/Support/InternalNames.cpp b/flang/lib/Optimizer/Support/InternalNames.cpp
index bd281638e443c..a7493d7494fee 100644
--- a/flang/lib/Optimizer/Support/InternalNames.cpp
+++ b/flang/lib/Optimizer/Support/InternalNames.cpp
@@ -205,15 +205,6 @@ fir::NameUniquer::doVariable(llvm::ArrayRef<llvm::StringRef> modules,
return result.append(toLower(name));
}
-std::string
-fir::NameUniquer::doNamelistGroup(llvm::ArrayRef<llvm::StringRef> modules,
- llvm::Optional<llvm::StringRef> host,
- llvm::StringRef name) {
- std::string result = prefix();
- result.append(doModulesHost(modules, host)).append("G");
- return result.append(toLower(name));
-}
-
llvm::StringRef fir::NameUniquer::doProgramEntry() {
if (mainEntryName.size())
return mainEntryName;
@@ -288,10 +279,6 @@ fir::NameUniquer::deconstruct(llvm::StringRef uniq) {
else
kinds.push_back(readInt(uniq, i, i + 1, end));
break;
- case 'G':
- nk = NameKind::NAMELIST_GROUP;
- name = readName(uniq, i, i + 1, end);
- break;
default:
assert(false && "unknown uniquing code");
diff --git a/flang/unittests/Optimizer/InternalNamesTest.cpp b/flang/unittests/Optimizer/InternalNamesTest.cpp
index 1a837660ec635..831d7997e3f82 100644
--- a/flang/unittests/Optimizer/InternalNamesTest.cpp
+++ b/flang/unittests/Optimizer/InternalNamesTest.cpp
@@ -162,12 +162,6 @@ TEST(InternalNamesTest, doProgramEntry) {
ASSERT_EQ(actual.str(), expectedMangledName);
}
-TEST(InternalNamesTest, doNamelistGroup) {
- llvm::StringRef actual = NameUniquer::doNamelistGroup({"mod1"}, {}, {"nlg"});
- std::string expectedMangledName = "_QMmod1Gnlg";
- ASSERT_EQ(actual, expectedMangledName);
-}
-
TEST(InternalNamesTest, deconstructTest) {
std::pair actual = NameUniquer::deconstruct("_QBhello");
auto expectedNameKind = NameUniquer::NameKind::COMMON;
@@ -214,11 +208,6 @@ TEST(InternalNamesTest, complexdeconstructTest) {
expectedNameKind = NameKind::DISPATCH_TABLE;
expectedComponents = {{}, {}, "t", {}};
validateDeconstructedName(actual, expectedNameKind, expectedComponents);
-
- actual = NameUniquer::deconstruct("_QFmstartGmpitop");
- expectedNameKind = NameKind::NAMELIST_GROUP;
- expectedComponents = {{}, {"mstart"}, "mpitop", {}};
- validateDeconstructedName(actual, expectedNameKind, expectedComponents);
}
// main() from gtest_main
More information about the flang-commits
mailing list