Skip to content

Commit a6ad865

Browse files
committed
[clang][include-tree] Make spurious import explicit in print output
1 parent dce0136 commit a6ad865

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

clang/lib/CAS/IncludeTree.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ llvm::Error IncludeTree::SpuriousImport::print(llvm::raw_ostream &OS,
696696
auto IT = getIncludeTree();
697697
if (!IT)
698698
return IT.takeError();
699+
OS << "(Spurious import) ";
699700
if (llvm::Error E = MI->print(OS, Indent, /*End=*/' '))
700701
return E;
701702
if (llvm::Error E = IT->print(OS, Indent))

clang/test/ClangScanDeps/modules-include-tree-implementation-transitive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static mod_int x;
6666
// RUN: FileCheck %s -input-file %t/tu-include-tree.txt -DPREFIX=%/t
6767
// CHECK: [[PREFIX]]/tu.m llvmcas://
6868
// CHECK-NEXT: 1:1 <built-in> llvmcas://
69-
// CHECK-NEXT: 2:1 (Module) Spurious.Missing [[PREFIX]]/frameworks/Spurious.framework/Headers/Missing.h llvmcas://
69+
// CHECK-NEXT: 2:1 (Spurious import) (Module) Spurious.Missing [[PREFIX]]/frameworks/Spurious.framework/Headers/Missing.h llvmcas://
7070
// CHECK-NEXT: 3:1 (Module for visibility only) Mod
7171

7272
// RUN: %clang @%t/cas-Mod.cc1.rsp

clang/test/ClangScanDeps/modules-include-tree-missing-submodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
// CHECK: (PCH) llvmcas://
5151
// CHECK: [[PREFIX]]/tu.c llvmcas://
5252
// CHECK: 1:1 <built-in> llvmcas://
53-
// CHECK: 2:1 (Module) Foo.Bar [[PREFIX]]/Foo.framework/Headers/Bar.h llvmcas://
53+
// CHECK: 2:1 (Spurious import) (Module) Foo.Bar [[PREFIX]]/Foo.framework/Headers/Bar.h llvmcas://
5454

5555
// RUN: %clang @%t/tu.rsp
5656

0 commit comments

Comments
 (0)