@@ -1223,7 +1223,7 @@ class llvm::vfs::RedirectingFileSystemParser {
1223
1223
}
1224
1224
1225
1225
auto *DE =
1226
- dyn_cast <RedirectingFileSystem::RedirectingDirectoryEntry>(ParentEntry);
1226
+ cast <RedirectingFileSystem::RedirectingDirectoryEntry>(ParentEntry);
1227
1227
DE->addContent (std::move (E));
1228
1228
return DE->getLastContent ();
1229
1229
}
@@ -1234,9 +1234,7 @@ class llvm::vfs::RedirectingFileSystemParser {
1234
1234
StringRef Name = SrcE->getName ();
1235
1235
switch (SrcE->getKind ()) {
1236
1236
case RedirectingFileSystem::EK_Directory: {
1237
- auto *DE =
1238
- dyn_cast<RedirectingFileSystem::RedirectingDirectoryEntry>(SrcE);
1239
- assert (DE && " Must be a directory" );
1237
+ auto *DE = cast<RedirectingFileSystem::RedirectingDirectoryEntry>(SrcE);
1240
1238
// Empty directories could be present in the YAML as a way to
1241
1239
// describe a file for a current directory after some of its subdir
1242
1240
// is parsed. This only leads to redundant walks, ignore it.
@@ -1248,11 +1246,10 @@ class llvm::vfs::RedirectingFileSystemParser {
1248
1246
break ;
1249
1247
}
1250
1248
case RedirectingFileSystem::EK_File: {
1251
- auto *FE = dyn_cast<RedirectingFileSystem::RedirectingFileEntry>(SrcE);
1252
- assert (FE && " Must be a file" );
1253
1249
assert (NewParentE && " Parent entry must exist" );
1254
- auto *DE = dyn_cast<RedirectingFileSystem::RedirectingDirectoryEntry>(
1255
- NewParentE);
1250
+ auto *FE = cast<RedirectingFileSystem::RedirectingFileEntry>(SrcE);
1251
+ auto *DE =
1252
+ cast<RedirectingFileSystem::RedirectingDirectoryEntry>(NewParentE);
1256
1253
DE->addContent (
1257
1254
std::make_unique<RedirectingFileSystem::RedirectingFileEntry>(
1258
1255
Name, FE->getExternalContentsPath (), FE->getUseName ()));
0 commit comments