Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient.  Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.

Modified all users of Diagnostics to comply with this new interface.

Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).

Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/TranslationUnit.cpp b/Driver/TranslationUnit.cpp
index 627657a..6f35a32 100644
--- a/Driver/TranslationUnit.cpp
+++ b/Driver/TranslationUnit.cpp
@@ -102,7 +102,7 @@
   Sezr.EnterBlock();
   
   // Emit the SourceManager.
-  Sezr.Emit(Context->SourceMgr);
+  Sezr.Emit(Context->getSourceManager());
   
   // Emit the LangOptions.
   Sezr.Emit(LangOpts);
@@ -184,7 +184,7 @@
   assert (FoundBlock);
 
   // Read the SourceManager.
-  SourceManager::CreateAndRegister(Dezr,FMgr);
+  SourceManager& SrcMgr = *SourceManager::CreateAndRegister(Dezr,FMgr);
   
   // Read the LangOptions.
   TU->LangOpts.Read(Dezr);
@@ -196,7 +196,7 @@
     std::vector<std::string> triples;
     triples.push_back(triple);
     delete [] triple;
-    Dezr.RegisterPtr(PtrID,CreateTargetInfo(triples,NULL));
+    Dezr.RegisterPtr(PtrID,CreateTargetInfo(SrcMgr,triples,NULL));
   }
   
   // For Selectors, we must read the identifier table first because the