From 7ff29148ac7883881e62dc9e1714057c68ad4436 Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Thu, 13 Aug 2015 17:13:33 +0000 Subject: [Modules] Add Darwin-specific compatibility module map parsing hacks This preserves backwards compatibility for two hacks in the Darwin system module map files: 1. The use of 'requires excluded' to make headers non-modular, which should really be mapped to 'textual' now that we have this feature. 2. Silently removes a bogus cplusplus requirement from IOKit.avc. Once we start diagnosing missing requirements and headers on auto-imports these would have broken compatibility with existing Darwin SDKs. llvm-svn: 244912 --- clang/lib/Basic/Module.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/Basic/Module.cpp') diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 4314b41eb34..4188cefc849 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -139,6 +139,15 @@ std::string Module::getFullModuleName() const { return Result; } +bool Module::fullModuleNameIs(ArrayRef nameParts) const { + for (const Module *M = this; M; M = M->Parent) { + if (nameParts.empty() || M->Name != nameParts.back()) + return false; + nameParts = nameParts.drop_back(); + } + return nameParts.empty(); +} + Module::DirectoryName Module::getUmbrellaDir() const { if (Header U = getUmbrellaHeader()) return {"", U.Entry->getDir()}; -- cgit v1.2.3