-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][deps] add support for dependency scanning with cc1 command line
Allow users to run a dependency scan with a cc1 command line in addition to a driver command line. DependencyScanningAction was already being run with a cc1 command line, but DependencyScanningWorker::computeDependencies assumed that it was always provided a driver command line. Now DependencyScanningWorker::computeDependencies can handle cc1 command lines too. Reviewed By: jansvoboda11 Differential Revision: https://reviews.llvm.org/D156234
- Loading branch information
1 parent
00769d6
commit 6b4de7b
Showing
2 changed files
with
83 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Check that clang-scan-deps works with cc1 command lines | ||
|
||
// RUN: rm -rf %t | ||
// RUN: split-file %s %t | ||
|
||
|
||
//--- modules_cc1.cpp | ||
#include "header.h" | ||
|
||
//--- header.h | ||
|
||
//--- module.modulemap | ||
module header1 { header "header.h" } | ||
|
||
//--- cdb.json.template | ||
[{ | ||
"file": "DIR/modules_cc1.cpp", | ||
"directory": "DIR", | ||
"command": "clang -cc1 DIR/modules_cc1.cpp -fimplicit-module-maps -o modules_cc1.o" | ||
}] | ||
|
||
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json | ||
// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 -mode preprocess-dependency-directives > %t/result | ||
// RUN: cat %t/result | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t | ||
|
||
// CHECK: modules_cc1.o: | ||
// CHECK-NEXT: [[PREFIX]]/modules_cc1.cpp | ||
// CHECK-NEXT: [[PREFIX]]/module.modulemap | ||
// CHECK-NEXT: [[PREFIX]]/header.h |