From a686e1b05df915030897ec670d9cb15d2a6d0221 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 27 Jan 2012 19:52:33 +0000 Subject: Introduce module attributes into the module map grammar, along with a single attribute ("system") that allows us to mark a module as being a "system" module. Each of the headers that makes up a system module is considered to be a system header, so that we (for example) suppress warnings there. If a module is being inferred for a framework, and that framework directory is within a system frameworks directory, infer it as a system framework. llvm-svn: 149143 --- clang/lib/Frontend/CompilerInstance.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index c3f3e3711ac..b8075ed87a3 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -577,12 +577,15 @@ CompilerInstance::createOutputFile(StringRef OutputPath, // Initialization Utilities -bool CompilerInstance::InitializeSourceManager(StringRef InputFile) { - return InitializeSourceManager(InputFile, getDiagnostics(), getFileManager(), - getSourceManager(), getFrontendOpts()); +bool CompilerInstance::InitializeSourceManager(StringRef InputFile, + SrcMgr::CharacteristicKind Kind){ + return InitializeSourceManager(InputFile, Kind, getDiagnostics(), + getFileManager(), getSourceManager(), + getFrontendOpts()); } bool CompilerInstance::InitializeSourceManager(StringRef InputFile, + SrcMgr::CharacteristicKind Kind, DiagnosticsEngine &Diags, FileManager &FileMgr, SourceManager &SourceMgr, @@ -594,7 +597,7 @@ bool CompilerInstance::InitializeSourceManager(StringRef InputFile, Diags.Report(diag::err_fe_error_reading) << InputFile; return false; } - SourceMgr.createMainFileID(File); + SourceMgr.createMainFileID(File, Kind); } else { llvm::OwningPtr SB; if (llvm::MemoryBuffer::getSTDIN(SB)) { @@ -604,7 +607,7 @@ bool CompilerInstance::InitializeSourceManager(StringRef InputFile, } const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(), SB->getBufferSize(), 0); - SourceMgr.createMainFileID(File); + SourceMgr.createMainFileID(File, Kind); SourceMgr.overrideFileContents(File, SB.take()); } -- cgit v1.2.3