@@ -1132,10 +1132,9 @@ class ImportDecl final : public Decl,
11321132
11331133 SourceLoc ImportLoc;
11341134 SourceLoc KindLoc;
1135- // Used to store the real module name corresponding to this import decl
1136- // in case module aliasing is used. For example if '-module-alias Foo=Bar'
1137- // was passed and this decl is 'import Foo', the real name 'Bar' will be
1138- // stored.
1135+ // / Used to store the real module name corresponding to this import decl in
1136+ // / case module aliasing is used. For example if '-module-alias Foo=Bar' was
1137+ // / passed and this decl is 'import Foo', the real name 'Bar' will be stored.
11391138 Identifier RealModuleName;
11401139
11411140 // / The resolved module.
@@ -1168,39 +1167,36 @@ class ImportDecl final : public Decl,
11681167
11691168 // / Retrieves the import path as written in the source code.
11701169 // /
1171- // / \returns An \c ImportPath corresponding to this import decl. If module
1172- // / aliasing was used, this will contain the aliased name of the module;
1173- // / for instance, if you wrote 'import Foo' but passed
1174- // / '-module-alias Foo=Bar', this import path will include 'Foo'. This
1175- // / return value is always owned by the AST context, so it can be
1176- // / persisted.
1170+ // / \returns An \c ImportPath corresponding to this import decl. If module aliasing
1171+ // / was used, this will contain the aliased name of the module; for instance,
1172+ // / if you wrote 'import Foo' but passed '-module-alias Foo=Bar', this import
1173+ // / path will include 'Foo'. This return value is always owned by \c ImportDecl
1174+ // / (which is owned by the AST context), so it can be persisted.
11771175 ImportPath getImportPath () const {
1178- return ImportPath ({ getTrailingObjects<ImportPath::Element>(),
1179- static_cast <size_t >(Bits.ImportDecl .NumPathElements ) });
1176+ return ImportPath ({ getTrailingObjects<ImportPath::Element>(),
1177+ static_cast <size_t >(Bits.ImportDecl .NumPathElements ) });
11801178 }
11811179
11821180 // / Retrieves the import path, replacing any module aliases with real names.
11831181 // /
11841182 // / \param scratch An \c ImportPath::Builder which may, if necessary, be used to
11851183 // / construct the return value. It may go unused, so you should not try to
11861184 // / read the result from it; use the return value instead.
1187- // / \returns An \c ImportPath corresponding to this import decl. If module
1188- // / aliasing was used, this will contain the real name of the module;
1189- // / for instance, if you wrote 'import Foo' but passed
1190- // / '-module-alias Foo=Bar', this import path will include 'Bar'. This
1191- // / return value may be owned by \p scratch, so it should not be used
1192- // / after \p scratch is destroyed.
1185+ // / \returns An \c ImportPath corresponding to this import decl. If module aliasing
1186+ // / was used, this will contain the real name of the module; for instance,
1187+ // / if you wrote 'import Foo' but passed '-module-alias Foo=Bar', this import
1188+ // / path will include 'Bar'. This return value may be owned by \p scratch,
1189+ // / so it should not be used after \p scratch is destroyed.
11931190 ImportPath getRealImportPath (ImportPath::Builder &scratch) const ;
11941191
11951192 // / Retrieves the part of the import path that contains the module name,
11961193 // / as written in the source code.
11971194 // /
1198- // / \returns A \c ModulePath corresponding to this import decl. If module
1199- // / aliasing was used, this will contain the aliased name of the module;
1200- // / for instance, if you wrote 'import Foo' but passed
1201- // / '-module-alias Foo=Bar', this module path will include 'Foo'. This
1202- // / return value is always owned by the AST context, so it can be
1203- // / persisted.
1195+ // / \returns A \c ImportPath::Module corresponding to this import decl. If module
1196+ // / aliasing was used, this will contain the aliased name of the module; for
1197+ // / instance, if you wrote 'import Foo' but passed '-module-alias Foo=Bar',
1198+ // / this module path will contain 'Foo'. This return value is always owned by
1199+ // / \c ImportDecl (which is owned by the AST context), so it can be persisted.
12041200 ImportPath::Module getModulePath () const {
12051201 return getImportPath ().getModulePath (getImportKind ());
12061202 }
@@ -1211,12 +1207,11 @@ class ImportDecl final : public Decl,
12111207 // / \param scratch An \c ImportPath::Builder which may, if necessary, be used to
12121208 // / construct the return value. It may go unused, so you should not try to
12131209 // / read the result from it; use the return value instead.
1214- // / \returns An \c ImportPath corresponding to this import decl. If module
1215- // / aliasing was used, this will contain the real name of the module;
1216- // / for instance, if you wrote 'import Foo' but passed
1217- // / '-module-alias Foo=Bar', this import path will include 'Bar'. This
1218- // / return value may be owned by \p scratch, so it should not be used
1219- // / after \p scratch is destroyed.
1210+ // / \returns An \c ImportPath::Module corresponding to this import decl. If module
1211+ // / aliasing was used, this will contain the real name of the module; for
1212+ // / instance, if you wrote 'import Foo' but passed '-module-alias Foo=Bar',
1213+ // / the returned path will contain 'Bar'. This return value may be owned
1214+ // / by \p scratch, so it should not be used after \p scratch is destroyed.
12201215 ImportPath::Module getRealModulePath (ImportPath::Builder &scratch) const {
12211216 return getRealImportPath (scratch).getModulePath (getImportKind ());
12221217 }
0 commit comments