Skip to content

Commit 5a0e470

Browse files
committed
[clang][cas] Make missing include-tree id an error
This was review feedback on a previous PR that somehow went missing. Bring it back. (cherry picked from commit f1ccf9d) (cherry picked from commit 0b727cd)
1 parent 50087ab commit 5a0e470

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

clang/lib/Tooling/DependencyScanning/IncludeTreeActionController.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,14 @@ Error IncludeTreeActionController::finalizeModuleBuild(
392392

393393
Error IncludeTreeActionController::finalizeModuleInvocation(
394394
CompilerInvocation &CI, const ModuleDeps &MD) {
395-
if (auto ID = MD.IncludeTreeID) {
396-
configureInvocationForCaching(CI, CASOpts, std::move(*ID),
397-
/*CASFSWorkingDir=*/"",
398-
/*ProduceIncludeTree=*/true);
399-
}
395+
if (!MD.IncludeTreeID)
396+
return llvm::createStringError(llvm::inconvertibleErrorCode(),
397+
"missing include-tree for module '%s'",
398+
MD.ID.ModuleName.c_str());
399+
400+
configureInvocationForCaching(CI, CASOpts, *MD.IncludeTreeID,
401+
/*CASFSWorkingDir=*/"",
402+
/*ProduceIncludeTree=*/true);
400403

401404
DepscanPrefixMapping::remapInvocationPaths(CI, PrefixMapper);
402405
return Error::success();

0 commit comments

Comments
 (0)