[clang] [clang][Lex][NFC] Remove redundant assertion in module map home lookup (PR #242800)

Chen Miao via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 15 02:49:21 PST 2026


https://github.com/ChenMiaoi created https://github.com/llvm/llvm-project/pull/242800

Commit https://github.com/llvm/llvm-project/commit/8d323d150610 changed the framework directory lookup to update `Dir` only on success, preserving its non-empty value on failure. Remove the redundant assertion and the outdated FIXME about directory removal causing it to fail.

>From 2368bbcab25d44e1650a8d841eddcb90bd51c427 Mon Sep 17 00:00:00 2001
From: Chen Miao <chenmiao.ku at gmail.com>
Date: Sun, 15 Nov 2026 18:47:59 +0800
Subject: [PATCH] [clang][Lex][NFC] Remove redundant assertion in module map
 home lookup

Commit https://github.com/llvm/llvm-project/commit/8d323d150610
changed the framework directory lookup to update `Dir` only on success,
preserving its non-empty value on failure. Remove the redundant assertion
and the outdated FIXME about directory removal causing it to fail.
---
 clang/lib/Lex/HeaderSearch.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 235dc1aad38be9..d8219f626e3674 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -2126,9 +2126,6 @@ HeaderSearch::getModuleMapHomeDir(FileEntryRef File,
       if (DirName.ends_with(".framework"))
         if (auto MaybeDir = FileMgr.getOptionalDirectoryRef(DirName))
           Dir = *MaybeDir;
-      // FIXME: This assert can fail if there's a race between the above check
-      // and the removal of the directory.
-      assert(Dir && "parent must exist");
     }
   }
   return Dir;



More information about the cfe-commits mailing list