================
@@ -351,6 +351,11 @@ ANALYZER_OPTION(bool, ShouldDisplayMacroExpansions, 
"expand-macros",
                 "expanded and included in the plist output.",
                 false)
 
+ANALYZER_OPTION(bool, ShouldFormatMacrosPlist, "format-macros-plist",
+                "Whether the macros being displayed in the plist "
+                "files are clang-formatted .",
+                false)
----------------
ankurkraj wrote:

I tried removing the options and making this the default setting, some plist 
tests are failing thuogh. 
I gather these expect the macro expansions to be present in the same format as 
the input one. 
I cna fix these tests to match the formatted output, but in that case there 
will be a dependency on clang-format and the tests will need an update if the 
clang-format has some changes.
How do you guys think I should proceed ?
```
llvm-project/build/bin/FileCheck 
--input-file=llvm-project/build/tools/clang/test/Analysis/Output/plist-macros-with-expansion.cpp.tmp.plist
 llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp
# executed command: llvm-project/build/bin/FileCheck 
--input-file=llvm-project/build/tools/clang/test/Analysis/Output/plist-macros-with-expansion.cpp.tmp.plist
 llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp
# .---command stderr------------
# | llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp:32:16: 
error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: <key>expansion</key><string>ptr =0</string>
# |                ^
# | 
llvm-project/build/tools/clang/test/Analysis/Output/plist-macros-with-expansion.cpp.tmp.plist:148:53:
 note: scanning from here
# |  <key>name</key><string>SET_PTR_VAR_TO_NULL</string>
# |                                                     ^
# | 
llvm-project/build/tools/clang/test/Analysis/Output/plist-macros-with-expansion.cpp.tmp.plist:149:2:
 note: possible intended match here
# |  <key>expansion</key><string>ptr = 0</string>
# |  ^
# | 
# | Input file: 
llvm-project/build/tools/clang/test/Analysis/Output/plist-macros-with-expansion.cpp.tmp.plist
# | Check file: llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |          143:  <dict> 
# |          144:  <key>line</key><integer>18</integer> 
# |          145:  <key>col</key><integer>3</integer> 
# |          146:  <key>file</key><integer>0</integer> 
# |          147:  </dict> 
# |          148:  <key>name</key><string>SET_PTR_VAR_TO_NULL</string> 
# | next:32'0                                                         X error: 
no match found
# |          149:  <key>expansion</key><string>ptr = 0</string> 
# | next:32'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:32'1      ?                                             possible 
intended match
# |          150:  </dict> 
# | next:32'0     ~~~~~~~~~
# |          151:  </array> 
# | next:32'0     ~~~~~~~~~~
# |          152:  <key>description</key><string>Dereference of null pointer 
(loaded from variable &apos;ptr&apos;)</string> 
# | next:32'0     
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          153:  <key>category</key><string>Logic error</string> 
# | next:32'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          154:  <key>type</key><string>Dereference of null pointer</string> 
# | next:32'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (4):
  Clang :: Analysis/analyzer-config.c
  Clang :: Analysis/plist-macros-with-expansion-ctu.c
  Clang :: Analysis/plist-macros-with-expansion.c
  Clang :: Analysis/plist-macros-with-expansion.cpp
  ```

https://github.com/llvm/llvm-project/pull/156046
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to