aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-27 19:52:33 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-27 19:52:33 +0000
commita686e1b05df915030897ec670d9cb15d2a6d0221 (patch)
tree0c45700a788869289d4dad2a57e18b4e317629bf /clang/lib/Basic
parent63fe5697f4d9f760fef8ec828d535deec296d119 (diff)
downloadllvm-a686e1b05df915030897ec670d9cb15d2a6d0221.zip
llvm-a686e1b05df915030897ec670d9cb15d2a6d0221.tar.gz
llvm-a686e1b05df915030897ec670d9cb15d2a6d0221.tar.bz2
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
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Module.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index ff09441..015f421 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/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 ";