forked from OSchip/llvm-project
[Modules] Make sure that the synthesized file "__inferred_module.map" doesn't show up as dependency of a module file.
Follow-up for rdar://15459210 llvm-svn: 203882
This commit is contained in:
parent
ce9b49e5ec
commit
68ccbe01b0
|
@ -183,7 +183,10 @@ public:
|
|||
/// system input files as well.
|
||||
///
|
||||
/// \returns true to continue receiving the next input file, false to stop.
|
||||
virtual bool visitInputFile(StringRef Filename, bool isSystem) { return true;}
|
||||
virtual bool visitInputFile(StringRef Filename, bool isSystem,
|
||||
bool isOverridden) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Simple wrapper class for chaining listeners.
|
||||
|
@ -214,7 +217,8 @@ public:
|
|||
void ReadCounter(const serialization::ModuleFile &M, unsigned Value) override;
|
||||
bool needsInputFileVisitation() override;
|
||||
bool needsSystemInputFileVisitation() override;
|
||||
bool visitInputFile(StringRef Filename, bool isSystem) override;
|
||||
bool visitInputFile(StringRef Filename, bool isSystem,
|
||||
bool isOverridden) override;
|
||||
};
|
||||
|
||||
/// \brief ASTReaderListener implementation to validate the information of
|
||||
|
|
|
@ -79,7 +79,8 @@ public:
|
|||
bool needsSystemInputFileVisitation() override {
|
||||
return Parent.includeSystemHeaders();
|
||||
}
|
||||
bool visitInputFile(StringRef Filename, bool isSystem) override;
|
||||
bool visitInputFile(StringRef Filename, bool isSystem,
|
||||
bool isOverridden) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -258,8 +259,11 @@ void DFGImpl::OutputDependencyFile() {
|
|||
}
|
||||
|
||||
bool DFGASTReaderListener::visitInputFile(llvm::StringRef Filename,
|
||||
bool IsSystem) {
|
||||
bool IsSystem, bool IsOverridden) {
|
||||
assert(!IsSystem || needsSystemInputFileVisitation());
|
||||
if (IsOverridden)
|
||||
return true;
|
||||
|
||||
Parent.AddFilename(Filename);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -119,9 +119,10 @@ bool ChainedASTReaderListener::needsSystemInputFileVisitation() {
|
|||
Second->needsSystemInputFileVisitation();
|
||||
}
|
||||
bool ChainedASTReaderListener::visitInputFile(StringRef Filename,
|
||||
bool isSystem) {
|
||||
return First->visitInputFile(Filename, isSystem) ||
|
||||
Second->visitInputFile(Filename, isSystem);
|
||||
bool isSystem,
|
||||
bool isOverridden) {
|
||||
return First->visitInputFile(Filename, isSystem, isOverridden) ||
|
||||
Second->visitInputFile(Filename, isSystem, isOverridden);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -2120,8 +2121,11 @@ ASTReader::ReadControlBlock(ModuleFile &F,
|
|||
if (Listener && Listener->needsInputFileVisitation()) {
|
||||
unsigned N = Listener->needsSystemInputFileVisitation() ? NumInputs
|
||||
: NumUserInputs;
|
||||
for (unsigned I = 0; I < N; ++I)
|
||||
Listener->visitInputFile(getInputFileName(F, I+1), I >= NumUserInputs);
|
||||
for (unsigned I = 0; I < N; ++I) {
|
||||
bool IsSystem = I >= NumUserInputs;
|
||||
InputFileInfo FI = readInputFileInfo(F, I+1);
|
||||
Listener->visitInputFile(FI.Filename, IsSystem, FI.Overridden);
|
||||
}
|
||||
}
|
||||
|
||||
return Success;
|
||||
|
@ -3932,7 +3936,8 @@ bool ASTReader::readASTFileControlBlock(StringRef Filename,
|
|||
bool shouldContinue = false;
|
||||
switch ((InputFileRecordTypes)Cursor.readRecord(Code, Record, &Blob)) {
|
||||
case INPUT_FILE:
|
||||
shouldContinue = Listener.visitInputFile(Blob, isSystemFile);
|
||||
bool Overridden = static_cast<bool>(Record[3]);
|
||||
shouldContinue = Listener.visitInputFile(Blob, isSystemFile, Overridden);
|
||||
break;
|
||||
}
|
||||
if (!shouldContinue)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// Test that the virtual file "__inferred_module.map" doesn't show up as dependency.
|
||||
|
||||
// RUN: rm -rf %t-mcp
|
||||
// RUN: %clang_cc1 -isysroot %S/Inputs/System -triple x86_64-apple-darwin10 -dependency-file %t.d -MT %s.o -F %S/Inputs -fsyntax-only -fmodules -fmodules-cache-path=%t-mcp %s
|
||||
// RUN: FileCheck %s < %t.d
|
||||
// CHECK-NOT: __inferred_module
|
||||
|
||||
@import Module;
|
Loading…
Reference in New Issue