Skip to content

Commit 274429a

Browse files
committed
Address review comments
1 parent 175e9ce commit 274429a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ static void optimizeCWD(CowCompilerInvocation &BuildInvocation, StringRef CWD) {
162162
static bool areOptionsInSharedDir(CowCompilerInvocation &BuildInvocation,
163163
const ArrayRef<StringRef> SharedDirs) {
164164
const auto &HSOpts = BuildInvocation.getHeaderSearchOpts();
165-
if (!isPathInSharedDir(SharedDirs, HSOpts.Sysroot))
166-
return false;
165+
assert(isPathInSharedDir(SharedDirs, HSOpts.Sysroot) &&
166+
"Sysroots differ between module dependencies and current TU");
167167

168-
if (!isPathInSharedDir(SharedDirs, HSOpts.ResourceDir))
169-
return false;
168+
assert(isPathInSharedDir(SharedDirs, HSOpts.ResourceDir) &&
169+
"ResourceDirs differ between module dependencies and current TU");
170170

171171
for (const auto &Entry : HSOpts.UserEntries) {
172172
if (!Entry.IgnoreSysRoot)
@@ -799,7 +799,6 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) {
799799
auto FullFilePath = ASTReader::ResolveImportedPath(
800800
PathBuf, IFI.UnresolvedImportedFilename, MF->BaseDirectory);
801801
MD.IsShareable = isPathInSharedDir(SharedDirs, *FullFilePath);
802-
PathBuf.resize_for_overwrite(256);
803802
}
804803
if (!(IFI.TopLevel && IFI.ModuleMap))
805804
return;

0 commit comments

Comments
 (0)