1a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor//===--- ModuleMap.h - Describe the layout of modules -----------*- C++ -*-===// 2a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// 3a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// The LLVM Compiler Infrastructure 4a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// 5a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// This file is distributed under the University of Illinois Open Source 6a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// License. See LICENSE.TXT for details. 7a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// 8a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor//===----------------------------------------------------------------------===// 9a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// 10a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// This file defines the ModuleMap interface, which describes the layout of a 11a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// module as it relates to headers. 12a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor// 13a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor//===----------------------------------------------------------------------===// 14a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 15a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 16a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#ifndef LLVM_CLANG_LEX_MODULEMAP_H 17a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#define LLVM_CLANG_LEX_MODULEMAP_H 18a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 19a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#include "clang/Basic/LangOptions.h" 201a4761edca58c6b559de825b9abfb66f7f1ba94aDouglas Gregor#include "clang/Basic/Module.h" 21a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#include "clang/Basic/SourceManager.h" 22a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#include "llvm/ADT/DenseMap.h" 23a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#include "llvm/ADT/IntrusiveRefCntPtr.h" 24a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#include "llvm/ADT/SmallVector.h" 25a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#include "llvm/ADT/StringMap.h" 2630a2e16f6c27f888dd11eba6bbbae1e980078fcbChandler Carruth#include "llvm/ADT/StringRef.h" 27a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#include <string> 28a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 29a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregornamespace clang { 30a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 31adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregorclass DirectoryEntry; 32a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregorclass FileEntry; 33a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregorclass FileManager; 34a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregorclass DiagnosticConsumer; 35a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregorclass DiagnosticsEngine; 3655ea75bf61a5d76f6453513d937944ce68181c6aArgyrios Kyrtzidisclass HeaderSearch; 37a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregorclass ModuleMapParser; 38a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 39a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregorclass ModuleMap { 40ee0cd37fe4a9f4e2ee73ae34cf93c410cb299a82Manuel Klimek SourceManager &SourceMgr; 41651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines DiagnosticsEngine &Diags; 4251f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor const LangOptions &LangOpts; 43dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor const TargetInfo *Target; 4455ea75bf61a5d76f6453513d937944ce68181c6aArgyrios Kyrtzidis HeaderSearch &HeaderInfo; 45dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor 462f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor /// \brief The directory used for Clang-supplied, builtin include headers, 472f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor /// such as "stdint.h". 482f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor const DirectoryEntry *BuiltinIncludeDir; 492f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor 5051f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor /// \brief Language options used to parse the module map itself. 5151f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor /// 5251f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor /// These are always simple C language options. 5351f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor LangOptions MMapLangOpts; 5451f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor 55d3220dbeeadc4ac54ceecea8cf63f8d8be291d2aArgyrios Kyrtzidis // The module that we are building; related to \c LangOptions::CurrentModule. 56d3220dbeeadc4ac54ceecea8cf63f8d8be291d2aArgyrios Kyrtzidis Module *CompilingModule; 57d3220dbeeadc4ac54ceecea8cf63f8d8be291d2aArgyrios Kyrtzidis 58ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasperpublic: 59ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper // The module that the .cc source file is associated with. 60ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper Module *SourceModule; 61ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper std::string SourceModuleName; 62ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper 63ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasperprivate: 64484535e45b4d301847a157e943c7823da5d40884Douglas Gregor /// \brief The top-level modules that are known. 65a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor llvm::StringMap<Module *> Modules; 662b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 67bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowlpublic: 68bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// \brief Describes the role of a module header. 69bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl enum ModuleHeaderRole { 70bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// \brief This header is normally included in the module. 71bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl NormalHeader, 72bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// \brief This header is included but private. 73bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl PrivateHeader, 74bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// \brief This header is explicitly excluded from the module. 75bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl ExcludedHeader 76bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl // Caution: Adding an enumerator needs other changes. 77bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl // Adjust the number of bits for KnownHeader::Storage. 78bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl // Adjust the bitfield HeaderFileInfo::HeaderRole size. 79bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl // Adjust the HeaderFileInfoTrait::ReadData streaming. 80bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl // Adjust the HeaderFileInfoTrait::EmitData streaming. 81bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl }; 82bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl 832b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor /// \brief A header that is known to reside within a given module, 842b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor /// whether it was included or excluded. 852b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor class KnownHeader { 86bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl llvm::PointerIntPair<Module *, 2, ModuleHeaderRole> Storage; 872b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 882b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor public: 896bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines KnownHeader() : Storage(nullptr, NormalHeader) { } 90bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl KnownHeader(Module *M, ModuleHeaderRole Role) : Storage(M, Role) { } 912b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 922b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor /// \brief Retrieve the module the header is stored in. 932b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor Module *getModule() const { return Storage.getPointer(); } 942b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 95bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// \brief The role of this header within the module. 96bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl ModuleHeaderRole getRole() const { return Storage.getInt(); } 972b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 982b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor /// \brief Whether this header is available in the module. 992b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor bool isAvailable() const { 100bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl return getRole() != ExcludedHeader && getModule()->isAvailable(); 1012b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor } 1022b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 1032b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor // \brief Whether this known header is valid (i.e., it has an 1042b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor // associated module). 1056bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines LLVM_EXPLICIT operator bool() const { 1066bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines return Storage.getPointer() != nullptr; 1076bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines } 1082b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor }; 1092b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 110bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowlprivate: 111c641709607d45bf97772e925647db6c94866c50aDaniel Jasper typedef llvm::DenseMap<const FileEntry *, SmallVector<KnownHeader, 1> > 112c641709607d45bf97772e925647db6c94866c50aDaniel Jasper HeadersMap; 1132b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor 114cdeba0b0127e0d97b10752a1e875901da4426810Lawrence Crowl /// \brief Mapping from each header to the module that owns the contents of 115a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// that header. 1162b49d1f0ad790a8a5d514af1be211591a746cb73Douglas Gregor HeadersMap Headers; 117a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 118adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregor /// \brief Mapping from directories with umbrella headers to the module 119adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregor /// that is generated from the umbrella header. 120adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregor /// 121adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregor /// This mapping is used to map headers that haven't explicitly been named 122adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregor /// in the module map over to the module that includes them via its umbrella 123adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregor /// header. 124adb979924ade3e25342c38a5b564400b4e0540c1Douglas Gregor llvm::DenseMap<const DirectoryEntry *, Module *> UmbrellaDirs; 12582e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 12682e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \brief A directory for which framework modules can be inferred. 12782e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor struct InferredDirectory { 12882e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor InferredDirectory() : InferModules(), InferSystemModules() { } 12982e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 13082e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \brief Whether to infer modules from this directory. 13182e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor unsigned InferModules : 1; 13282e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 13382e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \brief Whether the modules we infer are [system] modules. 13482e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor unsigned InferSystemModules : 1; 13582e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 1366bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// \brief If \c InferModules is non-zero, the module map file that allowed 1376bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// inferred modules. Otherwise, nullptr. 1386bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines const FileEntry *ModuleMapFile; 1396bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines 14082e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \brief The names of modules that cannot be inferred within this 14182e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// directory. 142cfa88f893915ceb8ae4ce2f17c46c24a4d67502fDmitri Gribenko SmallVector<std::string, 2> ExcludedModules; 14382e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor }; 14482e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 14582e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \brief A mapping from directories to information about inferring 14682e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// framework modules from within those directories. 14782e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor llvm::DenseMap<const DirectoryEntry *, InferredDirectory> InferredDirectories; 14882e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 1497005b907ea159c8e74e81f85269777429bc18d3cDouglas Gregor /// \brief Describes whether we haved parsed a particular file as a module 1507005b907ea159c8e74e81f85269777429bc18d3cDouglas Gregor /// map. 1517005b907ea159c8e74e81f85269777429bc18d3cDouglas Gregor llvm::DenseMap<const FileEntry *, bool> ParsedModuleMap; 1527005b907ea159c8e74e81f85269777429bc18d3cDouglas Gregor 153a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor friend class ModuleMapParser; 154a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 15590db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \brief Resolve the given export declaration into an actual export 15690db26000aefe9335370013eec64c85232d80227Douglas Gregor /// declaration. 15790db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 15890db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \param Mod The module in which we're resolving the export declaration. 15990db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 16090db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \param Unresolved The export declaration to resolve. 16190db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 16290db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \param Complain Whether this routine should complain about unresolvable 16390db26000aefe9335370013eec64c85232d80227Douglas Gregor /// exports. 16490db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 16590db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \returns The resolved export declaration, which will have a NULL pointer 16690db26000aefe9335370013eec64c85232d80227Douglas Gregor /// if the export could not be resolved. 16790db26000aefe9335370013eec64c85232d80227Douglas Gregor Module::ExportDecl 16890db26000aefe9335370013eec64c85232d80227Douglas Gregor resolveExport(Module *Mod, const Module::UnresolvedExportDecl &Unresolved, 1690be5e567e3a48592fd6b11f88cc77efb20c76f26Argyrios Kyrtzidis bool Complain) const; 170906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor 171906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \brief Resolve the given module id to an actual module. 172906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// 173906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \param Id The module-id to resolve. 174906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// 175906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \param Mod The module in which we're resolving the module-id. 176906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// 177906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \param Complain Whether this routine should complain about unresolvable 178906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// module-ids. 179906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// 180906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \returns The resolved module, or null if the module-id could not be 181906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// resolved. 182906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor Module *resolveModuleId(const ModuleId &Id, Module *Mod, bool Complain) const; 183906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor 184651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// \brief Looks up the modules that \p File corresponds to. 185651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// 186651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// If \p File represents a builtin header within Clang's builtin include 187651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// directory, this also loads all of the module maps to see if it will get 188651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// associated with a specific module (e.g. in /usr/include). 189651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines HeadersMap::iterator findKnownHeader(const FileEntry *File); 190651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines 1916bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// \brief Searches for a module whose umbrella directory contains \p File. 1926bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// 1936bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// \param File The header to search for. 1946bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// 1956bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// \param IntermediateDirs On success, contains the set of directories 1966bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// searched before finding \p File. 1976bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines KnownHeader findHeaderInUmbrellaDirs(const FileEntry *File, 1986bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines SmallVectorImpl<const DirectoryEntry *> &IntermediateDirs); 1996bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines 2006bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// \brief A convenience method to determine if \p File is (possibly nested) 2016bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// in an umbrella directory. 2026bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines bool isHeaderInUmbrellaDirs(const FileEntry *File) { 2036bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines SmallVector<const DirectoryEntry *, 2> IntermediateDirs; 2046bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines return static_cast<bool>(findHeaderInUmbrellaDirs(File, IntermediateDirs)); 2056bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines } 2066bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines 207a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregorpublic: 208a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// \brief Construct a new module map. 209a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// 210ee0cd37fe4a9f4e2ee73ae34cf93c410cb299a82Manuel Klimek /// \param SourceMgr The source manager used to find module files and headers. 211ee0cd37fe4a9f4e2ee73ae34cf93c410cb299a82Manuel Klimek /// This source manager should be shared with the header-search mechanism, 212ee0cd37fe4a9f4e2ee73ae34cf93c410cb299a82Manuel Klimek /// since they will refer to the same headers. 213a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// 214651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// \param Diags A diagnostic engine used for diagnostics. 21551f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor /// 21651f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor /// \param LangOpts Language options for this translation unit. 217dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor /// 218dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor /// \param Target The target for this translation unit. 219651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines ModuleMap(SourceManager &SourceMgr, DiagnosticsEngine &Diags, 22055ea75bf61a5d76f6453513d937944ce68181c6aArgyrios Kyrtzidis const LangOptions &LangOpts, const TargetInfo *Target, 22155ea75bf61a5d76f6453513d937944ce68181c6aArgyrios Kyrtzidis HeaderSearch &HeaderInfo); 22265f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor 22365f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor /// \brief Destroy the module map. 22465f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor /// 225a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor ~ModuleMap(); 226dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor 227dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor /// \brief Set the target information. 228dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor void setTarget(const TargetInfo &Target); 229dc58aa71026cce539ca9b5c2c52cc4efc7bd77feDouglas Gregor 2302f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor /// \brief Set the directory that contains Clang-supplied include 2312f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor /// files, such as our stdarg.h or tgmath.h. 2322f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor void setBuiltinIncludeDir(const DirectoryEntry *Dir) { 2332f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor BuiltinIncludeDir = Dir; 2342f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor } 2352f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8Douglas Gregor 23665f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor /// \brief Retrieve the module that owns the given header file, if any. 23765f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor /// 23865f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor /// \param File The header file that is likely to be included. 23965f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor /// 240c641709607d45bf97772e925647db6c94866c50aDaniel Jasper /// \param RequestingModule Specifies the module the header is intended to be 241c641709607d45bf97772e925647db6c94866c50aDaniel Jasper /// used from. Used to disambiguate if a header is present in multiple 242c641709607d45bf97772e925647db6c94866c50aDaniel Jasper /// modules. 243c641709607d45bf97772e925647db6c94866c50aDaniel Jasper /// 244bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// \returns The module KnownHeader, which provides the module that owns the 245bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// given header file. The KnownHeader is default constructed to indicate 24665f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor /// that no module owns this header file. 247c641709607d45bf97772e925647db6c94866c50aDaniel Jasper KnownHeader findModuleForHeader(const FileEntry *File, 2486bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines Module *RequestingModule = nullptr); 24965f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor 250651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// \brief Reports errors if a module must not include a specific file. 251651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// 252651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// \param RequestingModule The module including a file. 253651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// 254651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// \param FilenameLoc The location of the inclusion's filename. 255651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// 256651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// \param Filename The included filename as written. 257651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// 258651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines /// \param File The included file. 259651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines void diagnoseHeaderInclusion(Module *RequestingModule, 260651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines SourceLocation FilenameLoc, StringRef Filename, 261651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines const FileEntry *File); 262651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines 26351f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor /// \brief Determine whether the given header is part of a module 26451f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor /// marked 'unavailable'. 2650be5e567e3a48592fd6b11f88cc77efb20c76f26Argyrios Kyrtzidis bool isHeaderInUnavailableModule(const FileEntry *Header) const; 26651f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor 2676bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// \brief Determine whether the given header is unavailable as part 2686bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// of the specified module. 2696bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines bool isHeaderUnavailableInModule(const FileEntry *Header, 2706bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines const Module *RequestingModule) const; 2716bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines 272484535e45b4d301847a157e943c7823da5d40884Douglas Gregor /// \brief Retrieve a module with the given name. 273484535e45b4d301847a157e943c7823da5d40884Douglas Gregor /// 274260328c27ddbad6e6d81a84e68a9a4aedccbfbf3James Dennett /// \param Name The name of the module to look up. 275484535e45b4d301847a157e943c7823da5d40884Douglas Gregor /// 276484535e45b4d301847a157e943c7823da5d40884Douglas Gregor /// \returns The named module, if known; otherwise, returns null. 2770be5e567e3a48592fd6b11f88cc77efb20c76f26Argyrios Kyrtzidis Module *findModule(StringRef Name) const; 27890db26000aefe9335370013eec64c85232d80227Douglas Gregor 27990db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \brief Retrieve a module with the given name using lexical name lookup, 28090db26000aefe9335370013eec64c85232d80227Douglas Gregor /// starting at the given context. 28190db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 282260328c27ddbad6e6d81a84e68a9a4aedccbfbf3James Dennett /// \param Name The name of the module to look up. 28390db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 28490db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \param Context The module context, from which we will perform lexical 28590db26000aefe9335370013eec64c85232d80227Douglas Gregor /// name lookup. 28690db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 28790db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \returns The named module, if known; otherwise, returns null. 2880be5e567e3a48592fd6b11f88cc77efb20c76f26Argyrios Kyrtzidis Module *lookupModuleUnqualified(StringRef Name, Module *Context) const; 28990db26000aefe9335370013eec64c85232d80227Douglas Gregor 29090db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \brief Retrieve a module with the given name within the given context, 29190db26000aefe9335370013eec64c85232d80227Douglas Gregor /// using direct (qualified) name lookup. 29290db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 2933d7e24e1887fade254cf8b304834f30de2f8d662James Dennett /// \param Name The name of the module to look up. 29490db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 29590db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \param Context The module for which we will look for a submodule. If 29690db26000aefe9335370013eec64c85232d80227Douglas Gregor /// null, we will look for a top-level module. 29790db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 29890db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \returns The named submodule, if known; otherwose, returns null. 2990be5e567e3a48592fd6b11f88cc77efb20c76f26Argyrios Kyrtzidis Module *lookupModuleQualified(StringRef Name, Module *Context) const; 300484535e45b4d301847a157e943c7823da5d40884Douglas Gregor 301392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// \brief Find a new module or submodule, or create it if it does not already 302392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// exist. 303392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// 304392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// \param Name The name of the module to find or create. 305392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// 306392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// \param Parent The module that will act as the parent of this submodule, 307392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// or NULL to indicate that this is a top-level module. 308392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// 3096bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// \param ModuleMap The module map that defines or allows the inference of 3106bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// this module. 3116bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines /// 312392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// \param IsFramework Whether this is a framework module. 313392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// 314392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// \param IsExplicit Whether this is an explicit submodule. 315392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// 316392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// \returns The found or newly-created module, along with a boolean value 317392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor /// that will be true if the module is newly-created. 3186bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines std::pair<Module *, bool> findOrCreateModule(StringRef Name, Module *Parent, 3196bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89Stephen Hines const FileEntry *ModuleMap, 320392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor bool IsFramework, 321392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87Douglas Gregor bool IsExplicit); 32282e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 32382e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \brief Determine whether we can infer a framework module a framework 32482e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// with the given name in the given 32582e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// 32682e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \param ParentDir The directory that is the parent of the framework 32782e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// directory. 32882e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// 32982e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \param Name The name of the module. 33082e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// 33182e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \param IsSystem Will be set to 'true' if the inferred module must be a 33282e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// system module. 33382e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// 33482e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// \returns true if we are allowed to infer a framework module, and false 33582e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor /// otherwise. 33682e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor bool canInferFrameworkModule(const DirectoryEntry *ParentDir, 3370be5e567e3a48592fd6b11f88cc77efb20c76f26Argyrios Kyrtzidis StringRef Name, bool &IsSystem) const; 33882e52377bd76ed71e8c09edc5f2f452e388b16adDouglas Gregor 3392821c7f8870629b56b9c41e1c50c7a091edd544dDouglas Gregor /// \brief Infer the contents of a framework module map from the given 3402821c7f8870629b56b9c41e1c50c7a091edd544dDouglas Gregor /// framework directory. 3412821c7f8870629b56b9c41e1c50c7a091edd544dDouglas Gregor Module *inferFrameworkModule(StringRef ModuleName, 342ac252a3b0f8101a7274309e4a5cf2d5f0fdba675Douglas Gregor const DirectoryEntry *FrameworkDir, 343a1f1fad8b60e1cb9d21a40a37f2e03150bcbeb6fDouglas Gregor bool IsSystem, Module *Parent); 344f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor 345f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor /// \brief Retrieve the module map file containing the definition of the given 346f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor /// module. 347f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor /// 348f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor /// \param Module The module whose module map file will be returned, if known. 349f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor /// 350f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor /// \returns The file entry for the module map file containing the given 351f9e357d8a66c606a86a6e1aef678898b8843bd30Douglas Gregor /// module, or NULL if the module definition was inferred. 3520be5e567e3a48592fd6b11f88cc77efb20c76f26Argyrios Kyrtzidis const FileEntry *getContainingModuleMapFile(Module *Module) const; 35390db26000aefe9335370013eec64c85232d80227Douglas Gregor 35490db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \brief Resolve all of the unresolved exports in the given module. 35590db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 35690db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \param Mod The module whose exports should be resolved. 35790db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 35890db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \param Complain Whether to emit diagnostics for failures. 35990db26000aefe9335370013eec64c85232d80227Douglas Gregor /// 36090db26000aefe9335370013eec64c85232d80227Douglas Gregor /// \returns true if any errors were encountered while resolving exports, 36190db26000aefe9335370013eec64c85232d80227Douglas Gregor /// false otherwise. 36290db26000aefe9335370013eec64c85232d80227Douglas Gregor bool resolveExports(Module *Mod, bool Complain); 36390db26000aefe9335370013eec64c85232d80227Douglas Gregor 364ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// \brief Resolve all of the unresolved uses in the given module. 365ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// 366ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// \param Mod The module whose uses should be resolved. 367ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// 368ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// \param Complain Whether to emit diagnostics for failures. 369ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// 370ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// \returns true if any errors were encountered while resolving uses, 371ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper /// false otherwise. 372ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper bool resolveUses(Module *Mod, bool Complain); 373ddd2dfc1d3f4a36cbe8cd775c588623a17049f9fDaniel Jasper 374906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \brief Resolve all of the unresolved conflicts in the given module. 375906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// 376906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \param Mod The module whose conflicts should be resolved. 377906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// 378906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \param Complain Whether to emit diagnostics for failures. 379906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// 380906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \returns true if any errors were encountered while resolving conflicts, 381906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// false otherwise. 382906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor bool resolveConflicts(Module *Mod, bool Complain); 383906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor 384906d66acc5cf2679453e10a4f0a67feedd765b21Douglas Gregor /// \brief Infers the (sub)module based on the given source location and 38555988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor /// source manager. 38655988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor /// 38755988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor /// \param Loc The location within the source that we are querying, along 38855988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor /// with its source manager. 38955988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor /// 39055988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor /// \returns The module that owns this source location, or null if no 39155988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor /// module owns this source location. 39255988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor Module *inferModuleFromLocation(FullSourceLoc Loc); 39355988680ece66b8e505ee136b35e74fcb1173aeeDouglas Gregor 394e209e5026892cb07294f733c72bd51359c0f0e72Douglas Gregor /// \brief Sets the umbrella header of the given module to the given 395e209e5026892cb07294f733c72bd51359c0f0e72Douglas Gregor /// header. 396e209e5026892cb07294f733c72bd51359c0f0e72Douglas Gregor void setUmbrellaHeader(Module *Mod, const FileEntry *UmbrellaHeader); 39777d029f6a24dbf70d97e61757945df53fb250ea0Douglas Gregor 39877d029f6a24dbf70d97e61757945df53fb250ea0Douglas Gregor /// \brief Sets the umbrella directory of the given module to the given 39977d029f6a24dbf70d97e61757945df53fb250ea0Douglas Gregor /// directory. 40077d029f6a24dbf70d97e61757945df53fb250ea0Douglas Gregor void setUmbrellaDir(Module *Mod, const DirectoryEntry *UmbrellaDir); 40177d029f6a24dbf70d97e61757945df53fb250ea0Douglas Gregor 402e209e5026892cb07294f733c72bd51359c0f0e72Douglas Gregor /// \brief Adds this header to the given module. 403bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl /// \param Role The role of the header wrt the module. 404bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl void addHeader(Module *Mod, const FileEntry *Header, 405bc3f628815b3841dc99109e7f67f9afa7793bc94Lawrence Crowl ModuleHeaderRole Role); 40651f564f80d9f71e175635b452ffeeeff899e9bf1Douglas Gregor 407a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// \brief Parse the given module map file, and record any modules we 408a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// encounter. 409a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// 410a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// \param File The file to be parsed. 411a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// 4128f5d7d1d1f990f174c7f2682271a83acf64dd93dDouglas Gregor /// \param IsSystem Whether this module map file is in a system header 4138f5d7d1d1f990f174c7f2682271a83acf64dd93dDouglas Gregor /// directory, and therefore should be considered a system module. 4148f5d7d1d1f990f174c7f2682271a83acf64dd93dDouglas Gregor /// 415a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// \returns true if an error occurred, false otherwise. 4168f5d7d1d1f990f174c7f2682271a83acf64dd93dDouglas Gregor bool parseModuleMapFile(const FileEntry *File, bool IsSystem); 41765f3b5e99009f49d51eb00a859dbd2c2ee660718Douglas Gregor 418a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor /// \brief Dump the contents of the module map, for debugging purposes. 419a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor void dump(); 420c5b2e58840748145d1706c1d1481369d1863fabfDouglas Gregor 421c5b2e58840748145d1706c1d1481369d1863fabfDouglas Gregor typedef llvm::StringMap<Module *>::const_iterator module_iterator; 422c5b2e58840748145d1706c1d1481369d1863fabfDouglas Gregor module_iterator module_begin() const { return Modules.begin(); } 423c5b2e58840748145d1706c1d1481369d1863fabfDouglas Gregor module_iterator module_end() const { return Modules.end(); } 424a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor}; 425a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor 426a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor} 427a30cfe5026b12c28b7b575b48176e0a3543ce939Douglas Gregor#endif 428