Rename lookupModuleAlias to getRealModuleName

This commit is contained in:
elsh
2021-09-30 13:29:02 -07:00
parent b5f8c7901c
commit 6b4951e31e
3 changed files with 6 additions and 5 deletions

View File

@@ -475,13 +475,14 @@ public:
Identifier getIdentifier(StringRef Str) const;
/// Convert a given alias map to a map of Identifiers between module aliases and their actual names.
/// For example, if '-module-alias A=X -module-alias B=Y' input is passed in, the aliases A and B are
/// For example, if '-module-alias Foo=X -module-alias Bar=Y' input is passed in, the aliases Foo and Bar are
/// the names of the imported or referenced modules in source files in the main module, and X and Y
/// are the real (physical) module names on disk.
void setModuleAliases(const llvm::StringMap<StringRef> &aliasMap);
/// Retrieve the actual module name given a module alias name key.
Identifier lookupModuleAlias(Identifier key) const;
/// Retrieve the actual module name if a module alias is used via '-module-alias Foo=X', where Foo is
/// a module alias and X is the real (physical) name. Returns \p key if no aliasing is used.
Identifier getRealModuleName(Identifier key) const;
/// Decide how to interpret two precedence groups.
Associativity associateInfixOperators(PrecedenceGroupDecl *left,

View File

@@ -1651,7 +1651,7 @@ void ASTContext::setModuleAliases(const llvm::StringMap<StringRef> &aliasMap) {
}
}
Identifier ASTContext::lookupModuleAlias(Identifier key) const {
Identifier ASTContext::getRealModuleName(Identifier key) const {
auto found = ModuleAliasMap.find(key);
if (found != ModuleAliasMap.end()) {
return found->second;

View File

@@ -1565,7 +1565,7 @@ ImportedModule::removeDuplicates(SmallVectorImpl<ImportedModule> &imports) {
Identifier ModuleDecl::getRealName() const {
// This will return the real name for an alias (if used) or getName()
return getASTContext().lookupModuleAlias(getName());
return getASTContext().getRealModuleName(getName());
}
Identifier ModuleDecl::getABIName() const {