[analyzer] Refactor PathDiagnosticLocation: Make PathDiagnosticLocation(SourceLocation...) private. Most of the effort here goes to making BugReport refer to a PathDiagnosticLocation instead of FullSourceLocation. 

(Another step closer to the goal of having Diagnostics which can recover from invalid SourceLocations.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140182 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp b/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
index b3b2f31..7f74a7d 100644
--- a/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
@@ -67,11 +67,15 @@
     return;
                      
   SourceRange R = msg.getSourceRange();
-
+  BugReporter &BR = C.getBugReporter();
+  const LocationContext *LC = C.getPredecessor()->getLocationContext();
+  const SourceManager &SM = BR.getSourceManager();
+  const Expr *E = msg.getMsgOrPropExpr();
+  PathDiagnosticLocation L = PathDiagnosticLocation::createBegin(E, SM, LC);
   C.getBugReporter().EmitBasicReport("Use -drain instead of -release",
     "API Upgrade (Apple)",
     "Use -drain instead of -release when using NSAutoreleasePool "
-    "and garbage collection", R.getBegin(), &R, 1);
+    "and garbage collection", L, &R, 1);
 }
 
 void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) {