diff options
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 0523827..0d9cd10 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -906,11 +906,14 @@ namespace clang { /// \brief The set of attributes that can be attached to a module. struct Attributes { - Attributes() : IsSystem(), IsExhaustive() { } + Attributes() : IsSystem(), IsExternC(), IsExhaustive() { } /// \brief Whether this is a system module. unsigned IsSystem : 1; + /// \brief Whether this is an extern "C" module. + unsigned IsExternC : 1; + /// \brief Whether this is an exhaustive set of configuration macros. unsigned IsExhaustive : 1; }; @@ -1178,6 +1181,8 @@ namespace { AT_unknown, /// \brief The 'system' attribute. AT_system, + /// \brief The 'extern_c' attribute. + AT_extern_c, /// \brief The 'exhaustive' attribute. AT_exhaustive }; @@ -1334,7 +1339,9 @@ void ModuleMapParser::parseModuleDecl() { ActiveModule->DefinitionLoc = ModuleNameLoc; if (Attrs.IsSystem || IsSystem) ActiveModule->IsSystem = true; - + if (Attrs.IsExternC) + ActiveModule->IsExternC = true; + bool Done = false; do { switch (Tok.Kind) { @@ -2097,6 +2104,7 @@ bool ModuleMapParser::parseOptionalAttributes(Attributes &Attrs) { AttributeKind Attribute = llvm::StringSwitch<AttributeKind>(Tok.getString()) .Case("exhaustive", AT_exhaustive) + .Case("extern_c", AT_extern_c) .Case("system", AT_system) .Default(AT_unknown); switch (Attribute) { @@ -2109,6 +2117,10 @@ bool ModuleMapParser::parseOptionalAttributes(Attributes &Attrs) { Attrs.IsSystem = true; break; + case AT_extern_c: + Attrs.IsExternC = true; + break; + case AT_exhaustive: Attrs.IsExhaustive = true; break; |