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/Targets.cpp b/Driver/Targets.cpp
index 23f8307..6e810ef 100644
--- a/Driver/Targets.cpp
+++ b/Driver/Targets.cpp
@@ -702,7 +702,8 @@
/// CreateTargetInfo - Return the set of target info objects as specified by
/// the -arch command line option.
-TargetInfo *clang::CreateTargetInfo(const std::vector<std::string>& triples,
+TargetInfo *clang::CreateTargetInfo(SourceManager& SrcMgr,
+ const std::vector<std::string>& triples,
Diagnostic *Diags) {
assert (!triples.empty() && "No target triple.");
@@ -713,7 +714,7 @@
if (!PrimaryTarget)
return NULL;
- TargetInfo *TI = new TargetInfo(PrimaryTarget, Diags);
+ TargetInfo *TI = new TargetInfo(SrcMgr, PrimaryTarget, Diags);
// Add all secondary targets.
for (unsigned i = 1, e = triples.size(); i != e; ++i) {