miyuki created this revision.
miyuki added reviewers: NoQ, dcoughlin, george.karpenkov.
Herald added subscribers: Szelethus, mikhail.ramalho, a.sidorin, szepet, 
eraman, xazax.hun.

A recent change https://reviews.llvm.org/D50545 started using diff to
compare plist output against reference output. There are two
differences that are expected: clang version and absolute source file
paths, these differences have been eliminated by adding several -I
(ignore) regular expressions to the diff commands.

Unfortunately such approach is still fragile: in our downstream
version of Clang we use a slightly different format for the version
string and it does not match the regular expression used in the tests.

This patch adds a new analyzer option, -analyzer-output-no-fragile
which disables output of malleable parts into plist files and adjusts
the tests accordingly.


https://reviews.llvm.org/D52036

Files:
  include/clang/Driver/CC1Options.td
  include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
  lib/Frontend/CompilerInvocation.cpp
  lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
  test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist
  test/Analysis/Inputs/expected-plists/conditional-path-notes.c.plist
  test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
  test/Analysis/Inputs/expected-plists/edges-new.mm.plist
  test/Analysis/Inputs/expected-plists/generics.m.plist
  test/Analysis/Inputs/expected-plists/inline-plist.c.plist
  test/Analysis/Inputs/expected-plists/inline-unique-reports.c.plist
  test/Analysis/Inputs/expected-plists/method-call-path-notes.cpp.plist
  test/Analysis/Inputs/expected-plists/model-file.cpp.plist
  test/Analysis/Inputs/expected-plists/null-deref-path-notes.m.plist
  test/Analysis/Inputs/expected-plists/nullability-notes.m.plist
  test/Analysis/Inputs/expected-plists/objc-arc.m.plist
  test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist
  test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
  test/Analysis/Inputs/expected-plists/plist-output.m.plist
  test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
  test/Analysis/Inputs/expected-plists/unix-fns.c.plist
  test/Analysis/NewDelete-path-notes.cpp
  test/Analysis/conditional-path-notes.c
  
test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist
  test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics.cpp.plist
  test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp
  test/Analysis/copypaste/plist-diagnostics.cpp
  test/Analysis/cxx-for-range.cpp
  
test/Analysis/diagnostics/Inputs/expected-plists/deref-track-symbolic-region.c.plist
  
test/Analysis/diagnostics/Inputs/expected-plists/report-issues-within-main-file.cpp.plist
  test/Analysis/diagnostics/Inputs/expected-plists/undef-value-caller.c.plist
  test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.c.plist
  test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.m.plist
  test/Analysis/diagnostics/deref-track-symbolic-region.c
  test/Analysis/diagnostics/report-issues-within-main-file.cpp
  test/Analysis/diagnostics/undef-value-caller.c
  test/Analysis/diagnostics/undef-value-param.c
  test/Analysis/diagnostics/undef-value-param.m
  test/Analysis/edges-new.mm
  test/Analysis/generics.m
  test/Analysis/inline-plist.c
  test/Analysis/inline-unique-reports.c
  
test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.c.plist
  
test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist
  test/Analysis/inlining/Inputs/expected-plists/path-notes.c.plist
  test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist
  test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist
  test/Analysis/inlining/eager-reclamation-path-notes.c
  test/Analysis/inlining/eager-reclamation-path-notes.cpp
  test/Analysis/inlining/path-notes.c
  test/Analysis/inlining/path-notes.cpp
  test/Analysis/inlining/path-notes.m
  test/Analysis/method-call-path-notes.cpp
  test/Analysis/model-file.cpp
  test/Analysis/null-deref-path-notes.m
  test/Analysis/nullability-notes.m
  test/Analysis/objc-arc.m
  test/Analysis/plist-macros.cpp
  test/Analysis/plist-output-alternate.m
  test/Analysis/plist-output.m
  test/Analysis/retain-release-path-notes.m
  test/Analysis/unix-fns.c

Index: test/Analysis/unix-fns.c
===================================================================
--- test/Analysis/unix-fns.c
+++ test/Analysis/unix-fns.c
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API,optin.portability %s -analyzer-store=region -analyzer-output=plist -analyzer-config faux-bodies=true  -fblocks -verify -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/unix-fns.c.plist
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API,optin.portability %s -analyzer-store=region -analyzer-output=plist -analyzer-output-no-fragile -analyzer-config faux-bodies=true  -fblocks -verify -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/unix-fns.c.plist
 // RUN: mkdir -p %t.dir
 // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.API,osx.API,optin.portability -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s
 // RUN: rm -fR %t.dir
Index: test/Analysis/retain-release-path-notes.m
===================================================================
--- test/Analysis/retain-release-path-notes.m
+++ test/Analysis/retain-release-path-notes.m
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -verify %s
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file %s -o %t
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/retain-release-path-notes.m.plist
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/retain-release-path-notes.m.plist
 
 /***
 This file is for testing the path-sensitive notes for retain/release errors.
Index: test/Analysis/plist-output.m
===================================================================
--- test/Analysis/plist-output.m
+++ test/Analysis/plist-output.m
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=osx.cocoa.RetainCount,deadcode.DeadStores,core -analyzer-output=plist -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/plist-output.m.plist
+// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=osx.cocoa.RetainCount,deadcode.DeadStores,core -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-output.m.plist
 
 void test_null_init(void) {
   int *p = 0;
Index: test/Analysis/plist-output-alternate.m
===================================================================
--- test/Analysis/plist-output-alternate.m
+++ test/Analysis/plist-output-alternate.m
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -fblocks -analyzer-output=plist -o %t %s
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/plist-output-alternate.m.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -fblocks -analyzer-output=plist -analyzer-output-no-fragile -o %t %s
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/plist-output-alternate.m.plist
 
 void test_null_init(void) {
   int *p = 0;
Index: test/Analysis/plist-macros.cpp
===================================================================
--- test/Analysis/plist-macros.cpp
+++ test/Analysis/plist-macros.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/plist-macros.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-macros.cpp.plist
 
 
 typedef __typeof(sizeof(int)) size_t;
Index: test/Analysis/objc-arc.m
===================================================================
--- test/Analysis/objc-arc.m
+++ test/Analysis/objc-arc.m
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-output=plist-multi-file -o %t.plist %s
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/objc-arc.m.plist
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-output=plist-multi-file -analyzer-output-no-fragile -o %t.plist %s
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/objc-arc.m.plist
 
 typedef signed char BOOL;
 typedef struct _NSZone NSZone;
Index: test/Analysis/nullability-notes.m
===================================================================
--- test/Analysis/nullability-notes.m
+++ test/Analysis/nullability-notes.m
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=text -verify %s
-// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=plist -o %t.plist %s
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/nullability-notes.m.plist
+// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist %s
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/nullability-notes.m.plist
 
 #include "Inputs/system-header-simulator-for-nullability.h"
 
Index: test/Analysis/null-deref-path-notes.m
===================================================================
--- test/Analysis/null-deref-path-notes.m
+++ test/Analysis/null-deref-path-notes.m
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=text -fblocks -verify -Wno-objc-root-class %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -fblocks -Wno-objc-root-class %s -o %t
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/null-deref-path-notes.m.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-output-no-fragile -fblocks -Wno-objc-root-class %s -o %t
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/null-deref-path-notes.m.plist
 
 @interface Root {
 @public
Index: test/Analysis/model-file.cpp
===================================================================
--- test/Analysis/model-file.cpp
+++ test/Analysis/model-file.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config faux-bodies=true,model-path=%S/Inputs/Models -analyzer-output=plist-multi-file -verify %s -o %t
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/model-file.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config faux-bodies=true,model-path=%S/Inputs/Models -analyzer-output=plist-multi-file -analyzer-output-no-fragile -verify %s -o %t
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/model-file.cpp.plist
 
 typedef int* intptr;
 
Index: test/Analysis/method-call-path-notes.cpp
===================================================================
--- test/Analysis/method-call-path-notes.cpp
+++ test/Analysis/method-call-path-notes.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file  %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/method-call-path-notes.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/method-call-path-notes.cpp.plist
 
 // Test warning about null or uninitialized pointer values used as instance member
 // calls.
Index: test/Analysis/inlining/path-notes.m
===================================================================
--- test/Analysis/inlining/path-notes.m
+++ test/Analysis/inlining/path-notes.m
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=text -analyzer-config suppress-null-return-paths=false -fblocks -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -fblocks %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/path-notes.m.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config suppress-null-return-paths=false -fblocks %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/path-notes.m.plist
 
 typedef struct dispatch_queue_s *dispatch_queue_t;
 typedef void (^dispatch_block_t)(void);
Index: test/Analysis/inlining/path-notes.cpp
===================================================================
--- test/Analysis/inlining/path-notes.cpp
+++ test/Analysis/inlining/path-notes.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config c++-inlining=destructors -std=c++11 -verify -Wno-tautological-undefined-compare %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config c++-inlining=destructors -std=c++11 %s -o %t.plist -Wno-tautological-undefined-compare
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/path-notes.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config c++-inlining=destructors -std=c++11 %s -o %t.plist -Wno-tautological-undefined-compare
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/path-notes.cpp.plist
 
 class Foo {
 public:
Index: test/Analysis/inlining/path-notes.c
===================================================================
--- test/Analysis/inlining/path-notes.c
+++ test/Analysis/inlining/path-notes.c
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config suppress-null-return-paths=false -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/path-notes.c.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config suppress-null-return-paths=false %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/path-notes.c.plist
 
 void zero(int **p) {
   *p = 0;
Index: test/Analysis/inlining/eager-reclamation-path-notes.cpp
===================================================================
--- test/Analysis/inlining/eager-reclamation-path-notes.cpp
+++ test/Analysis/inlining/eager-reclamation-path-notes.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist
 
 typedef struct {
   int getValue();
Index: test/Analysis/inlining/eager-reclamation-path-notes.c
===================================================================
--- test/Analysis/inlining/eager-reclamation-path-notes.c
+++ test/Analysis/inlining/eager-reclamation-path-notes.c
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/eager-reclamation-path-notes.c.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config graph-trim-interval=5 %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/eager-reclamation-path-notes.c.plist
 
 void use(int *ptr, int val) {
   *ptr = val; // expected-warning {{Dereference of null pointer (loaded from variable 'ptr')}}
Index: test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist
===================================================================
--- test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist
+++ test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1993,9 +1991,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/inlining/path-notes.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist
===================================================================
--- test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist
+++ test/Analysis/inlining/Inputs/expected-plists/path-notes.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -5219,9 +5217,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/inlining/path-notes.cpp</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/inlining/Inputs/expected-plists/path-notes.c.plist
===================================================================
--- test/Analysis/inlining/Inputs/expected-plists/path-notes.c.plist
+++ test/Analysis/inlining/Inputs/expected-plists/path-notes.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -3772,9 +3770,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/inlining/path-notes.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist
===================================================================
--- test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist
+++ test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -369,9 +367,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/inlining/eager-reclamation-path-notes.cpp</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.c.plist
===================================================================
--- test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.c.plist
+++ test/Analysis/inlining/Inputs/expected-plists/eager-reclamation-path-notes.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -645,9 +643,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/inlining/eager-reclamation-path-notes.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/inline-unique-reports.c
===================================================================
--- test/Analysis/inline-unique-reports.c
+++ test/Analysis/inline-unique-reports.c
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -o %t > /dev/null 2>&1
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/inline-unique-reports.c.plist
+// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -analyzer-output-no-fragile -o %t > /dev/null 2>&1
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/inline-unique-reports.c.plist
 
 static inline bug(int *p) {
   *p = 0xDEADBEEF;
Index: test/Analysis/inline-plist.c
===================================================================
--- test/Analysis/inline-plist.c
+++ test/Analysis/inline-plist.c
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference,core.DivideZero -fblocks -analyzer-output=text -analyzer-config suppress-null-return-paths=false -verify -analyzer-config eagerly-assume=false %s
-// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=core.NullDereference,core.DivideZero -fblocks -analyzer-output=plist -analyzer-config suppress-null-return-paths=false -o %t
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/inline-plist.c.plist
+// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=core.NullDereference,core.DivideZero -fblocks -analyzer-output=plist -analyzer-output-no-fragile -analyzer-config suppress-null-return-paths=false -o %t
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/inline-plist.c.plist
 
 // <rdar://problem/10967815>
 void mmm(int y) {
Index: test/Analysis/generics.m
===================================================================
--- test/Analysis/generics.m
+++ test/Analysis/generics.m
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -analyzer-output=plist -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/generics.m.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/generics.m.plist
 
 #if !__has_feature(objc_generics)
 #  error Compiler does not support Objective-C generics?
Index: test/Analysis/edges-new.mm
===================================================================
--- test/Analysis/edges-new.mm
+++ test/Analysis/edges-new.mm
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,deadcode.DeadStores,osx.cocoa.RetainCount,unix.Malloc,unix.MismatchedDeallocator -analyzer-output=plist -o %t -w %s
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/edges-new.mm.plist
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,deadcode.DeadStores,osx.cocoa.RetainCount,unix.Malloc,unix.MismatchedDeallocator -analyzer-output=plist -analyzer-output-no-fragile -o %t -w %s
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/edges-new.mm.plist
 
 //===----------------------------------------------------------------------===//
 // Forward declarations (from headers).
Index: test/Analysis/diagnostics/undef-value-param.m
===================================================================
--- test/Analysis/diagnostics/undef-value-param.m
+++ test/Analysis/diagnostics/undef-value-param.m
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -analyzer-output=text -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -analyzer-output=plist-multi-file %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/undef-value-param.m.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/undef-value-param.m.plist
 
 typedef signed char BOOL;
 @protocol NSObject  - (BOOL)isEqual:(id)object; @end
Index: test/Analysis/diagnostics/undef-value-param.c
===================================================================
--- test/Analysis/diagnostics/undef-value-param.c
+++ test/Analysis/diagnostics/undef-value-param.c
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file  %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/undef-value-param.c.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/undef-value-param.c.plist
 
 void foo_irrelevant(int c) {
     if (c)
Index: test/Analysis/diagnostics/undef-value-caller.c
===================================================================
--- test/Analysis/diagnostics/undef-value-caller.c
+++ test/Analysis/diagnostics/undef-value-caller.c
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t %s
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/undef-value-caller.c.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -analyzer-output-no-fragile -o %t %s
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/undef-value-caller.c.plist
 
 #include "undef-value-callee.h"
 
Index: test/Analysis/diagnostics/report-issues-within-main-file.cpp
===================================================================
--- test/Analysis/diagnostics/report-issues-within-main-file.cpp
+++ test/Analysis/diagnostics/report-issues-within-main-file.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-config report-in-main-source-file=true %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/report-issues-within-main-file.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-output-no-fragile -analyzer-config report-in-main-source-file=true %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/report-issues-within-main-file.cpp.plist
 #include "Inputs/include/report-issues-within-main-file.h"
 
 void mainPlusHeader() {
Index: test/Analysis/diagnostics/deref-track-symbolic-region.c
===================================================================
--- test/Analysis/diagnostics/deref-track-symbolic-region.c
+++ test/Analysis/diagnostics/deref-track-symbolic-region.c
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file  %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/deref-track-symbolic-region.c.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/deref-track-symbolic-region.c.plist
 
 struct S {
   int *x;
Index: test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.m.plist
===================================================================
--- test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.m.plist
+++ test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1019,9 +1017,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/diagnostics/undef-value-param.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.c.plist
===================================================================
--- test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.c.plist
+++ test/Analysis/diagnostics/Inputs/expected-plists/undef-value-param.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1336,9 +1334,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/diagnostics/undef-value-param.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/diagnostics/Inputs/expected-plists/undef-value-caller.c.plist
===================================================================
--- test/Analysis/diagnostics/Inputs/expected-plists/undef-value-caller.c.plist
+++ test/Analysis/diagnostics/Inputs/expected-plists/undef-value-caller.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -133,10 +131,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/diagnostics/undef-value-caller.c</string>
-   <string>/clang/test/Analysis/diagnostics/undef-value-callee.h</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/diagnostics/Inputs/expected-plists/report-issues-within-main-file.cpp.plist
===================================================================
--- test/Analysis/diagnostics/Inputs/expected-plists/report-issues-within-main-file.cpp.plist
+++ test/Analysis/diagnostics/Inputs/expected-plists/report-issues-within-main-file.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1826,10 +1824,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-  <string>/clang/test/Analysis/diagnostics/report-issues-within-main-file.cpp</string>
-  <string>/clang/test/Analysis/diagnostics/Inputs/include/report-issues-within-main-file.h</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/diagnostics/Inputs/expected-plists/deref-track-symbolic-region.c.plist
===================================================================
--- test/Analysis/diagnostics/Inputs/expected-plists/deref-track-symbolic-region.c.plist
+++ test/Analysis/diagnostics/Inputs/expected-plists/deref-track-symbolic-region.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -649,9 +647,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/diagnostics/deref-track-symbolic-region.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/cxx-for-range.cpp
===================================================================
--- test/Analysis/cxx-for-range.cpp
+++ test/Analysis/cxx-for-range.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core -analyzer-output=plist-multi-file -o %t.plist -verify -analyzer-config eagerly-assume=false %s
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/cxx-for-range.cpp.plist
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-output-no-fragile -o %t.plist -verify -analyzer-config eagerly-assume=false %s
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/cxx-for-range.cpp.plist
 
 extern void work();
 
Index: test/Analysis/copypaste/plist-diagnostics.cpp
===================================================================
--- test/Analysis/copypaste/plist-diagnostics.cpp
+++ test/Analysis/copypaste/plist-diagnostics.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-output=plist -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/plist-diagnostics.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-output=plist -analyzer-output-no-fragile -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-diagnostics.cpp.plist
 
 void log();
 
Index: test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp
===================================================================
--- test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp
+++ test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-output=plist -analyzer-config notes-as-events=true -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-output=plist -analyzer-output-no-fragile -analyzer-config notes-as-events=true -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist
 
 void log();
 
Index: test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics.cpp.plist
===================================================================
--- test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics.cpp.plist
+++ test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -91,9 +89,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/copypaste/plist-diagnostics.cpp</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist
===================================================================
--- test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist
+++ test/Analysis/copypaste/Inputs/expected-plists/plist-diagnostics-notes-as-events.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -90,9 +88,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/conditional-path-notes.c
===================================================================
--- test/Analysis/conditional-path-notes.c
+++ test/Analysis/conditional-path-notes.c
@@ -1,6 +1,6 @@
 // RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=text -verify
-// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -o %t
-// RUN: cat %t | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/conditional-path-notes.c.plist
+// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -analyzer-output-no-fragile -o %t
+// RUN: cat %t | diff -u -w - %S/Inputs/expected-plists/conditional-path-notes.c.plist
 
 void testCondOp(int *p) {
   int *x = p ? p : p;
Index: test/Analysis/NewDelete-path-notes.cpp
===================================================================
--- test/Analysis/NewDelete-path-notes.cpp
+++ test/Analysis/NewDelete-path-notes.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -verify %s
 // RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -analyzer-config c++-allocator-inlining=true -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist %s -o %t.plist
-// RUN: cat %t.plist | diff -u -w -I "<string>/" -I "<string>.:" -I "version" - %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist
+// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist -analyzer-output-no-fragile %s -o %t.plist
+// RUN: cat %t.plist | diff -u -w - %S/Inputs/expected-plists/NewDelete-path-notes.cpp.plist
 
 void test() {
   int *p = new int;
Index: test/Analysis/Inputs/expected-plists/unix-fns.c.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/unix-fns.c.plist
+++ test/Analysis/Inputs/expected-plists/unix-fns.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -3013,9 +3011,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-  <string>/clang/test/Analysis/unix-fns.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
+++ test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -5260,9 +5258,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/retain-release-path-notes.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/plist-output.m.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/plist-output.m.plist
+++ test/Analysis/Inputs/expected-plists/plist-output.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -6212,9 +6210,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/plist-output.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
+++ test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1512,9 +1510,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/plist-output-alternate.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist
+++ test/Analysis/Inputs/expected-plists/plist-macros.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1753,9 +1751,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/plist-macros.cpp</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/objc-arc.m.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/objc-arc.m.plist
+++ test/Analysis/Inputs/expected-plists/objc-arc.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -2081,9 +2079,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/objc-arc.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/nullability-notes.m.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/nullability-notes.m.plist
+++ test/Analysis/Inputs/expected-plists/nullability-notes.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -197,9 +195,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/nullability-notes.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/null-deref-path-notes.m.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/null-deref-path-notes.m.plist
+++ test/Analysis/Inputs/expected-plists/null-deref-path-notes.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1020,9 +1018,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/null-deref-path-notes.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/model-file.cpp.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/model-file.cpp.plist
+++ test/Analysis/Inputs/expected-plists/model-file.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -300,10 +298,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/model-file.cpp</string>
-   <string>/clang/test/Analysis/Inputs/Models/notzero.model</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/method-call-path-notes.cpp.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/method-call-path-notes.cpp.plist
+++ test/Analysis/Inputs/expected-plists/method-call-path-notes.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -837,9 +835,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/method-call-path-notes.cpp</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/inline-unique-reports.c.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/inline-unique-reports.c.plist
+++ test/Analysis/Inputs/expected-plists/inline-unique-reports.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -270,9 +268,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/inline-unique-reports.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/inline-plist.c.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/inline-plist.c.plist
+++ test/Analysis/Inputs/expected-plists/inline-plist.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1978,9 +1976,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/inline-plist.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/generics.m.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/generics.m.plist
+++ test/Analysis/Inputs/expected-plists/generics.m.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -7188,9 +7186,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/generics.m</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/edges-new.mm.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/edges-new.mm.plist
+++ test/Analysis/Inputs/expected-plists/edges-new.mm.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -21444,9 +21442,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/edges-new.mm</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
+++ test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1671,9 +1669,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/cxx-for-range.cpp</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/conditional-path-notes.c.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/conditional-path-notes.c.plist
+++ test/Analysis/Inputs/expected-plists/conditional-path-notes.c.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -1764,9 +1762,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/conditional-path-notes.c</string>
- </array>
 </dict>
 </plist>
Index: test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist
===================================================================
--- test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist
+++ test/Analysis/Inputs/expected-plists/NewDelete-path-notes.cpp.plist
@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
- <key>clang_version</key>
-<string>clang version 8.0.0 </string>
  <key>diagnostics</key>
  <array>
   <dict>
@@ -456,9 +454,5 @@
   </dict>
   </dict>
  </array>
- <key>files</key>
- <array>
-   <string>/clang/test/Analysis/NewDelete-path-notes.cpp</string>
- </array>
 </dict>
 </plist>
Index: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
===================================================================
--- lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
+++ lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
@@ -34,6 +34,7 @@
     const LangOptions &LangOpts;
     const bool SupportsCrossFileDiagnostics;
     const bool SerializeStatistics;
+    const bool DisableFragileOutput;
   public:
     PlistDiagnostics(AnalyzerOptions &AnalyzerOpts,
                      const std::string& prefix,
@@ -66,7 +67,8 @@
   : OutputFile(output),
     LangOpts(LO),
     SupportsCrossFileDiagnostics(supportsMultipleFiles),
-    SerializeStatistics(AnalyzerOpts.shouldSerializeStats()) {}
+    SerializeStatistics(AnalyzerOpts.shouldSerializeStats()),
+    DisableFragileOutput(AnalyzerOpts.DisableFragileOutput) {}
 
 void ento::createPlistDiagnosticConsumer(AnalyzerOptions &AnalyzerOpts,
                                          PathDiagnosticConsumers &C,
@@ -425,9 +427,11 @@
   //  - "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>clang_version</key>\n";
-  EmitString(o, getClangFullVersion()) << '\n';
+  o << "<dict>\n";
+  if (!DisableFragileOutput) {
+    o << " <key>clang_version</key>\n";
+    EmitString(o, getClangFullVersion()) << '\n';
+  }
   o << " <key>diagnostics</key>\n"
        " <array>\n";
 
@@ -587,11 +591,13 @@
 
   o << " </array>\n";
 
-  o << " <key>files</key>\n"
-       " <array>\n";
-  for (FileID FID : Fids)
-    EmitString(o << "  ", SM->getFileEntryForID(FID)->getName()) << '\n';
-  o << " </array>\n";
+  if (!DisableFragileOutput) {
+    o << " <key>files</key>\n"
+        " <array>\n";
+    for (FileID FID : Fids)
+      EmitString(o << "  ", SM->getFileEntryForID(FID)->getName()) << '\n';
+    o << " </array>\n";
+  }
 
   if (llvm::AreStatisticsEnabled() && SerializeStatistics) {
     o << " <key>statistics</key>\n";
Index: lib/Frontend/CompilerInvocation.cpp
===================================================================
--- lib/Frontend/CompilerInvocation.cpp
+++ lib/Frontend/CompilerInvocation.cpp
@@ -281,6 +281,7 @@
   Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help);
   Opts.ShowEnabledCheckerList = Args.hasArg(OPT_analyzer_list_enabled_checkers);
   Opts.DisableAllChecks = Args.hasArg(OPT_analyzer_disable_all_checks);
+  Opts.DisableFragileOutput = Args.hasArg(OPT_analyzer_output_no_fragile);
 
   Opts.visualizeExplodedGraphWithGraphViz =
     Args.hasArg(OPT_analyzer_viz_egraph_graphviz);
Index: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
===================================================================
--- include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
+++ include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
@@ -154,6 +154,11 @@
   /// command-line options will get checked.
   unsigned DisableAllChecks : 1;
 
+  /// Do not output Clang version and source paths.
+  ///
+  /// This option is primarily for using in the testsuite.
+  unsigned DisableFragileOutput : 1;
+
   unsigned ShowCheckerHelp : 1;
   unsigned ShowEnabledCheckerList : 1;
   unsigned AnalyzeAll : 1;
Index: include/clang/Driver/CC1Options.td
===================================================================
--- include/clang/Driver/CC1Options.td
+++ include/clang/Driver/CC1Options.td
@@ -63,6 +63,9 @@
 def analyzer_output_EQ : Joined<["-"], "analyzer-output=">,
   Alias<analyzer_output>;
 
+def analyzer_output_no_fragile : Flag<["-"], "analyzer-output-no-fragile">,
+  HelpText<"Do not output version and path information">;
+
 def analyzer_purge : Separate<["-"], "analyzer-purge">,
   HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">;
 def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias<analyzer_purge>;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to