]> granicus.if.org Git - clang/commitdiff
[analyzer] Embed the analyzer version into the plist output.
authorAnna Zaks <ganna@apple.com>
Mon, 15 Oct 2012 22:48:19 +0000 (22:48 +0000)
committerAnna Zaks <ganna@apple.com>
Mon, 15 Oct 2012 22:48:19 +0000 (22:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165994 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/PlistDiagnostics.cpp

index 7d9c2236f4c5e0bb14495661c35c5656355f273f..17ef4cf571e8f518cb90423fd4c358c8031fcfb7 100644 (file)
@@ -13,8 +13,9 @@
 
 #include "clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
-#include "clang/Basic/SourceManager.h"
 #include "clang/Basic/FileManager.h"
+#include "clang/Basic/SourceManager.h"
+#include "clang/Basic/Version.h"
 #include "clang/Lex/Preprocessor.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Casting.h"
@@ -409,10 +410,13 @@ void PlistDiagnostics::FlushDiagnosticsImpl(
   "<plist version=\"1.0\">\n";
 
   // Write the root object: a <dict> containing...
+  //  - "clang_version", the string representation of clang version
   //  - "files", an <array> mapping from FIDs to file names
   //  - "diagnostics", an <array> containing the path diagnostics
-  o << "<dict>\n"
-       " <key>files</key>\n"
+  o << "<dict>\n" <<
+       " <key>clang_version</key>\n";
+  EmitString(o, getClangFullVersion()) << '\n';
+  o << " <key>files</key>\n"
        " <array>\n";
 
   for (SmallVectorImpl<FileID>::iterator I=Fids.begin(), E=Fids.end();