@@ -489,23 +489,27 @@ class ASTContext final {
489489 // / are the real (physical) module names on disk.
490490 void setModuleAliases (const llvm::StringMap<StringRef> &aliasMap);
491491
492- // / Look up the module alias map by the given \p key.
492+ // / Look up option used in \c getRealModuleName when module aliasing is applied.
493+ enum class ModuleAliasLookupOption {
494+ alwaysRealName,
495+ realNameFromAlias,
496+ aliasFromRealName
497+ };
498+
499+ // / Look up the module alias map by the given \p key and a lookup \p option.
500+ // /
501+ // / \param key A module alias or real name to look up the map by.
502+ // / \param option A look up option \c ModuleAliasLookupOption. Defaults to alwaysRealName.
493503 // /
494- // / \param key A module alias or real name to look up the map by
495- // / \param alwaysReturnRealName Indicates whether it should always retrieve the real module name
496- // / given \p key. Defaults to true. This takes a higher precedence than
497- // / \p lookupAliasFromReal.
498- // / \param lookupAliasFromReal Indicates whether to look up an alias by treating \p key
499- // / as a real name. Defaults to false.
500504 // / \return The real name or alias mapped to the key.
501- // / If \p alwaysReturnRealName is true, return the real module name if \p key is an alias
502- // / or the key itself since that's the real name.
503- // / If \p lookupAliasFromReal is true, and \p alwaysReturnRealName is false, return
504- // / only if \p key is a real name, else an empty Identifier.
505- // / If no aliasing is used, return \p key.
505+ // / If no aliasing is used, return \p key regardless of \p option.
506+ // / If \p option is alwaysRealName, return the real module name whether the \p key is an alias
507+ // / or a real name.
508+ // / If \p option is realNameFromAlias, only return a real name if \p key is an alias.
509+ // / If \p option is aliasFromRealName, only return an alias if \p key is a real name.
510+ // / Else return a real name or an alias mapped to the \p key.
506511 Identifier getRealModuleName (Identifier key,
507- bool alwaysReturnRealName = true ,
508- bool lookupAliasFromReal = false ) const ;
512+ ModuleAliasLookupOption option = ModuleAliasLookupOption::alwaysRealName) const ;
509513
510514 // / Decide how to interpret two precedence groups.
511515 Associativity associateInfixOperators (PrecedenceGroupDecl *left,
0 commit comments