From a1f1fad8b60e1cb9d21a40a37f2e03150bcbeb6f 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149143 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Module.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/Basic/Module.cpp') diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp index ff09441802..015f421f9d 100644 --- a/lib/Basic/Module.cpp +++ b/lib/Basic/Module.cpp @@ -24,9 +24,9 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, bool IsFramework, bool IsExplicit) : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), Umbrella(), IsAvailable(true), IsFromModuleFile(false), - IsFramework(IsFramework), IsExplicit(IsExplicit), InferSubmodules(false), - InferExplicitSubmodules(false), InferExportWildcard(false), - NameVisibility(Hidden) + IsFramework(IsFramework), IsExplicit(IsExplicit), IsSystem(false), + InferSubmodules(false), InferExplicitSubmodules(false), + InferExportWildcard(false), NameVisibility(Hidden) { if (Parent) { if (!Parent->isAvailable()) @@ -172,8 +172,15 @@ void Module::print(llvm::raw_ostream &OS, unsigned Indent) const { OS << "framework "; if (IsExplicit) OS << "explicit "; - OS << "module " << Name << " {\n"; + OS << "module " << Name; + if (IsSystem) { + OS.indent(Indent + 2); + OS << " [system]"; + } + + OS << " {\n"; + if (!Requires.empty()) { OS.indent(Indent + 2); OS << "requires "; -- cgit v1.2.3-18-g5258