@@ -1243,7 +1243,7 @@ class llvm::vfs::RedirectingFileSystemParser {
1243
1243
}
1244
1244
1245
1245
auto *DE =
1246
- dyn_cast <RedirectingFileSystem::RedirectingDirectoryEntry>(ParentEntry);
1246
+ cast <RedirectingFileSystem::RedirectingDirectoryEntry>(ParentEntry);
1247
1247
DE->addContent (std::move (E));
1248
1248
return DE->getLastContent ();
1249
1249
}
@@ -1254,9 +1254,7 @@ class llvm::vfs::RedirectingFileSystemParser {
1254
1254
StringRef Name = SrcE->getName ();
1255
1255
switch (SrcE->getKind ()) {
1256
1256
case RedirectingFileSystem::EK_Directory: {
1257
- auto *DE =
1258
- dyn_cast<RedirectingFileSystem::RedirectingDirectoryEntry>(SrcE);
1259
- assert (DE && " Must be a directory" );
1257
+ auto *DE = cast<RedirectingFileSystem::RedirectingDirectoryEntry>(SrcE);
1260
1258
// Empty directories could be present in the YAML as a way to
1261
1259
// describe a file for a current directory after some of its subdir
1262
1260
// is parsed. This only leads to redundant walks, ignore it.
@@ -1268,11 +1266,10 @@ class llvm::vfs::RedirectingFileSystemParser {
1268
1266
break ;
1269
1267
}
1270
1268
case RedirectingFileSystem::EK_File: {
1271
- auto *FE = dyn_cast<RedirectingFileSystem::RedirectingFileEntry>(SrcE);
1272
- assert (FE && " Must be a file" );
1273
1269
assert (NewParentE && " Parent entry must exist" );
1274
- auto *DE = dyn_cast<RedirectingFileSystem::RedirectingDirectoryEntry>(
1275
- NewParentE);
1270
+ auto *FE = cast<RedirectingFileSystem::RedirectingFileEntry>(SrcE);
1271
+ auto *DE =
1272
+ cast<RedirectingFileSystem::RedirectingDirectoryEntry>(NewParentE);
1276
1273
DE->addContent (
1277
1274
llvm::make_unique<RedirectingFileSystem::RedirectingFileEntry>(
1278
1275
Name, FE->getExternalContentsPath (), FE->getUseName ()));
0 commit comments