From bab175ec4b075c8076ba14c762900392533f6ee4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:08 +0000 Subject: Vendor import of clang trunk r290819: https://llvm.org/svn/llvm-project/cfe/trunk@290819 --- lib/Basic/Module.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/Basic/Module.cpp') diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp index 3d1a40db5ea20..80bbc24f3db32 100644 --- a/lib/Basic/Module.cpp +++ b/lib/Basic/Module.cpp @@ -33,7 +33,7 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, IsExplicit(IsExplicit), IsSystem(false), IsExternC(false), IsInferred(false), InferSubmodules(false), InferExplicitSubmodules(false), InferExportWildcard(false), ConfigMacrosExhaustive(false), - NameVisibility(Hidden) { + NoUndeclaredIncludes(false), NameVisibility(Hidden) { if (Parent) { if (!Parent->isAvailable()) IsAvailable = false; @@ -41,6 +41,8 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, IsSystem = true; if (Parent->IsExternC) IsExternC = true; + if (Parent->NoUndeclaredIncludes) + NoUndeclaredIncludes = true; IsMissingRequirement = Parent->IsMissingRequirement; Parent->SubModuleIndex[Name] = Parent->SubModules.size(); @@ -64,6 +66,8 @@ static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, .Case("blocks", LangOpts.Blocks) .Case("cplusplus", LangOpts.CPlusPlus) .Case("cplusplus11", LangOpts.CPlusPlus11) + .Case("freestanding", LangOpts.Freestanding) + .Case("gnuinlineasm", LangOpts.GNUAsm) .Case("objc", LangOpts.ObjC1) .Case("objc_arc", LangOpts.ObjCAutoRefCount) .Case("opencl", LangOpts.OpenCL) @@ -179,6 +183,11 @@ bool Module::directlyUses(const Module *Requested) const { for (auto *Use : Top->DirectUses) if (Requested->isSubModuleOf(Use)) return true; + + // Anyone is allowed to use our builtin stddef.h and its accompanying module. + if (!Requested->Parent && Requested->Name == "_Builtin_stddef_max_align_t") + return true; + return false; } -- cgit v1.2.3