From 73141fa98d34ccd5cd420301122df4e214d9238a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 8 Dec 2011 17:39:04 +0000 Subject: Within the module representation, generalize the notion of an umbrella header to also support umbrella directories. The umbrella directory for an umbrella header is the directory in which the umbrella header resides. No functionality change yet, but it's coming. llvm-svn: 146158 --- clang/lib/Basic/Module.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'clang/lib/Basic/Module.cpp') diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 97bddfa97ea..169715736bc 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -65,6 +65,13 @@ std::string Module::getFullModuleName() const { return Result; } +const DirectoryEntry *Module::getUmbrellaDir() const { + if (const FileEntry *Header = getUmbrellaHeader()) + return Header->getDir(); + + return Umbrella.dyn_cast(); +} + static void printModuleId(llvm::raw_ostream &OS, const ModuleId &Id) { for (unsigned I = 0, N = Id.size(); I != N; ++I) { if (I) @@ -81,7 +88,7 @@ void Module::print(llvm::raw_ostream &OS, unsigned Indent) const { OS << "explicit "; OS << "module " << Name << " {\n"; - if (UmbrellaHeader) { + if (const FileEntry *UmbrellaHeader = getUmbrellaHeader()) { OS.indent(Indent + 2); OS << "umbrella \""; OS.write_escaped(UmbrellaHeader->getName()); -- cgit v1.2.3