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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146158 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp
index 97bddfa..1697157 100644
--- a/lib/Basic/Module.cpp
+++ b/lib/Basic/Module.cpp
@@ -65,6 +65,13 @@
   return Result;
 }
 
+const DirectoryEntry *Module::getUmbrellaDir() const {
+  if (const FileEntry *Header = getUmbrellaHeader())
+    return Header->getDir();
+  
+  return Umbrella.dyn_cast<const DirectoryEntry *>();
+}
+
 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 @@
     OS << "explicit ";
   OS << "module " << Name << " {\n";
   
-  if (UmbrellaHeader) {
+  if (const FileEntry *UmbrellaHeader = getUmbrellaHeader()) {
     OS.indent(Indent + 2);
     OS << "umbrella \"";
     OS.write_escaped(UmbrellaHeader->getName());