Skip to content

Commit f1ccf9d

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.
1 parent 6034ccd commit f1ccf9d

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
@@ -393,11 +393,14 @@ Error IncludeTreeActionController::finalizeModuleBuild(
393393

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

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

0 commit comments

Comments
 (0)