File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -66,19 +66,10 @@ bool swift::emitImportedModules(ModuleDecl *mainModule,
66
66
if (!ID)
67
67
continue ;
68
68
69
- // Check if module aliasing was used for an imported module; for example,
70
- // if '-module-alias Foo=Bar' was passed and this module has 'import Foo',
71
- // its corresponding real module name 'Bar' should be emitted.
72
- ImportPath::Module::Builder builderWithRealModuleName;
73
- auto modulePath = ID->getModulePath (/* outRealModuleName=*/ &builderWithRealModuleName);
74
-
75
- if (!builderWithRealModuleName.get ().empty ()) {
76
- // Module aliasing was used, so use its real module name
77
- Modules.insert (builderWithRealModuleName.get ().front ().Item .str ());
78
- } else {
79
- // only the top-level name is needed (i.e. A in A.B.C)
80
- Modules.insert (modulePath[0 ].Item .str ());
81
- }
69
+ ImportPath::Module::Builder scratch;
70
+ auto modulePath = ID->getRealModulePath (scratch);
71
+ // only the top-level name is needed (i.e. A in A.B.C)
72
+ Modules.insert (modulePath[0 ].Item .str ());
82
73
}
83
74
84
75
// And now look in the C code we're possibly using.
You can’t perform that action at this time.
0 commit comments