@@ -1132,10 +1132,9 @@ class ImportDecl final : public Decl,
1132
1132
1133
1133
SourceLoc ImportLoc;
1134
1134
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.
1139
1138
Identifier RealModuleName;
1140
1139
1141
1140
// / The resolved module.
@@ -1168,39 +1167,36 @@ class ImportDecl final : public Decl,
1168
1167
1169
1168
// / Retrieves the import path as written in the source code.
1170
1169
// /
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.
1177
1175
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 ) });
1180
1178
}
1181
1179
1182
1180
// / Retrieves the import path, replacing any module aliases with real names.
1183
1181
// /
1184
1182
// / \param scratch An \c ImportPath::Builder which may, if necessary, be used to
1185
1183
// / construct the return value. It may go unused, so you should not try to
1186
1184
// / 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.
1193
1190
ImportPath getRealImportPath (ImportPath::Builder &scratch) const ;
1194
1191
1195
1192
// / Retrieves the part of the import path that contains the module name,
1196
1193
// / as written in the source code.
1197
1194
// /
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.
1204
1200
ImportPath::Module getModulePath () const {
1205
1201
return getImportPath ().getModulePath (getImportKind ());
1206
1202
}
@@ -1211,12 +1207,11 @@ class ImportDecl final : public Decl,
1211
1207
// / \param scratch An \c ImportPath::Builder which may, if necessary, be used to
1212
1208
// / construct the return value. It may go unused, so you should not try to
1213
1209
// / 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.
1220
1215
ImportPath::Module getRealModulePath (ImportPath::Builder &scratch) const {
1221
1216
return getRealImportPath (scratch).getModulePath (getImportKind ());
1222
1217
}
0 commit comments