Re: r329465 - Recommit r329442: Generate Libclang invocation reproducers using a new

2018-04-09 Thread Hans Wennborg via cfe-commits
ve2\llvm-clang-x86_64-expensive-checks-win\build\tools\clang\test\Index\Output\create-libclang-parsing-reproducer.c.tmp/libclang-*"
>  "-v"
> # command stderr:
> YAML:1:366: error: Unrecognized escape code!
>
> {"toolchain":"C:\\ps4-buildslave2\\llvm-clang-x86_64-expensive-checks-win\\build","libclang.operation":"parse","libclang.opts":1,"args":["clang","-fno-spell-checking","C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Index\create-libclang-parsing-reproducer.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"]}
>
>   
>   
>   
>   
>  ^
>
> LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure 
> the file exists and is readable.  Calling loadDataForExe
>
>
>
> LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure 
> the file exists and is readable.  Calling loadDataForExe
>
>
>
> LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure 
> the file exists and is readable.  Calling loadDataForExe
>
>
>
> #0 0x7ff9225a0806 (C:\WINDOWS\SYSTEM32\MSVCP140D.dll+0x30806)
>
> #1 0x7ff7b10e5062 std::vector const *> >::operator[](unsigned __int64) c:\program files (x86)\microsoft 
> visual studio 14.0\vc\include\vector:1235:0
>
> #2 0x7ff7b10df32e cc1gen_reproducer_main(class llvm::ArrayRef *>,char const *,void *) 
> c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\cc1gen_reproducer_main.cpp:182:0
>
> #3 0x7ff7b109cc6e ExecuteCC1Tool 
> c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\driver.cpp:316:0
>
> #4 0x7ff7b109d4a1 main 
> c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\driver.cpp:394:0
>
> #5 0x7ff7b9d35064 invoke_main 
> f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:65:0
>
> #6 0x7ff7b9d34f27 __scrt_common_main_seh 
> f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253:0
>
> #7 0x7ff7b9d34dee __scrt_common_main 
> f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:296:0
>
> #8 0x7ff7b9d35089 mainCRTStartup 
> f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
>
> #9 0x7ff92c481fe4 (C:\WINDOWS\System32\KERNEL32.DLL+0x11fe4)
>
> #10 0x7ff92eeff061 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6f061)
>
>
> error: command failed with exit status: 0x8003
> $ 
> "C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\FileCheck.EXE"
>  
> "C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Index\create-libclang-parsing-reproducer.c"
> # command stderr:
> FileCheck error: '-' is empty.
>
> FileCheck command line:  
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\FileCheck.EXE
>  
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Index\create-libclang-parsing-reproducer.c
>
>
> error: command failed with exit status: 2
>
> --
>
> 
>
> Douglas Yung
>
>> -Original Message-
>> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
>> Alex Lorenz via cfe-commits
>> Sent: Friday, April 06, 2018 17:03
>> To: cfe-commits@lists.llvm.org
>> Subject: r329465 - Recommit r329442: Generate Libclang invocation reproducers
>> using a new
>>
>> Author: arphaman
>> Date: Fri Apr  6 17:03:27 2018
>> New Revision: 329465
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=329465=rev
>> Log:
>> Recommit r329442: Generate Libclang invocation reproducers using a new -
>> cc1gen-reproducer driver option
>>
>> The recommit fixes:
>> - An MSAN failure (CCPrintOptions wasn't initialized in the Driver)
>> - Ensures that the strings in the libclang invocation files are escaped
>>
>> Original message:
>>
>> This commit is a follow up to the previous work that recorded Libclang
>> invocations into temporary files: r319702.
>>
>> It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode 
>> is
>> to generate Clang reproducer files for Libclang tool invocat

RE: r329465 - Recommit r329442: Generate Libclang invocation reproducers using a new

2018-04-07 Thread via cfe-commits
;,"-fno-spell-checking","C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Index\create-libclang-parsing-reproducer.c","-Xclang","-detailed-preprocessing-record","-fallow-editor-placeholders"]}





 ^

LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure 
the file exists and is readable.  Calling loadDataForExe



LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure 
the file exists and is readable.  Calling loadDataForExe



LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure 
the file exists and is readable.  Calling loadDataForExe



#0 0x7ff9225a0806 (C:\WINDOWS\SYSTEM32\MSVCP140D.dll+0x30806)

#1 0x7ff7b10e5062 std::vector >::operator[](unsigned __int64) c:\program files (x86)\microsoft visual 
studio 14.0\vc\include\vector:1235:0

#2 0x7ff7b10df32e cc1gen_reproducer_main(class llvm::ArrayRef,char const *,void *) 
c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\cc1gen_reproducer_main.cpp:182:0

#3 0x7ff7b109cc6e ExecuteCC1Tool 
c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\driver.cpp:316:0

#4 0x7ff7b109d4a1 main 
c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\driver.cpp:394:0

#5 0x7ff7b9d35064 invoke_main 
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:65:0

#6 0x7ff7b9d34f27 __scrt_common_main_seh 
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253:0

#7 0x7ff7b9d34dee __scrt_common_main 
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:296:0

#8 0x7ff7b9d35089 mainCRTStartup 
f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0

#9 0x7ff92c481fe4 (C:\WINDOWS\System32\KERNEL32.DLL+0x11fe4)

#10 0x7ff92eeff061 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6f061)


error: command failed with exit status: 0x8003
$ 
"C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\FileCheck.EXE"
 
"C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Index\create-libclang-parsing-reproducer.c"
# command stderr:
FileCheck error: '-' is empty.

FileCheck command line:  
C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\FileCheck.EXE
 
C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Index\create-libclang-parsing-reproducer.c


error: command failed with exit status: 2

--

********

Douglas Yung

> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Alex Lorenz via cfe-commits
> Sent: Friday, April 06, 2018 17:03
> To: cfe-commits@lists.llvm.org
> Subject: r329465 - Recommit r329442: Generate Libclang invocation reproducers
> using a new
> 
> Author: arphaman
> Date: Fri Apr  6 17:03:27 2018
> New Revision: 329465
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=329465=rev
> Log:
> Recommit r329442: Generate Libclang invocation reproducers using a new -
> cc1gen-reproducer driver option
> 
> The recommit fixes:
> - An MSAN failure (CCPrintOptions wasn't initialized in the Driver)
> - Ensures that the strings in the libclang invocation files are escaped
> 
> Original message:
> 
> This commit is a follow up to the previous work that recorded Libclang
> invocations into temporary files: r319702.
> 
> It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode is
> to generate Clang reproducer files for Libclang tool invocation. The JSON
> format in the invocation files is not really intended to be stable, so
> Libclang and Clang should be of the same version when generating reproducers.
> The new mode emits the information about the temporary files and Libclang-
> specific information to stdout using JSON.
> 
> rdar://35322614
> 
> Differential Revision: https://reviews.llvm.org/D40983
> 
> Added:
> cfe/trunk/test/Index/create-libclang-completion-reproducer.c
> cfe/trunk/test/Index/create-libclang-parsing-reproducer.c
> cfe/trunk/tools/driver/cc1gen_reproducer_main.cpp
> Modified:
> cfe/trunk/include/clang/Driver/Driver.h
> cfe/trunk/lib/Driver/Driver.cpp
> cfe/trunk/tools/driver/CMakeLists.txt
> cfe/trunk/tools/driver/driver.cpp
> cfe/trunk/tools/libclang/CIndexer.cpp
> 
> Modified: cfe/trunk/include/clang/Driver/Driver.h
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/include/clang/Driver/Driver.h?rev=329465=329464=329465
> =diff
> ==

r329465 - Recommit r329442: Generate Libclang invocation reproducers using a new

2018-04-06 Thread Alex Lorenz via cfe-commits
Author: arphaman
Date: Fri Apr  6 17:03:27 2018
New Revision: 329465

URL: http://llvm.org/viewvc/llvm-project?rev=329465=rev
Log:
Recommit r329442: Generate Libclang invocation reproducers using a new
-cc1gen-reproducer driver option

The recommit fixes:
- An MSAN failure (CCPrintOptions wasn't initialized in the Driver)
- Ensures that the strings in the libclang invocation files are escaped

Original message:

This commit is a follow up to the previous work that recorded Libclang 
invocations
into temporary files: r319702.

It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode is 
to generate
Clang reproducer files for Libclang tool invocation. The JSON format in the 
invocation
files is not really intended to be stable, so Libclang and Clang should be of 
the same version
when generating reproducers.
The new mode emits the information about the temporary files and 
Libclang-specific information
to stdout using JSON.

rdar://35322614

Differential Revision: https://reviews.llvm.org/D40983

Added:
cfe/trunk/test/Index/create-libclang-completion-reproducer.c
cfe/trunk/test/Index/create-libclang-parsing-reproducer.c
cfe/trunk/tools/driver/cc1gen_reproducer_main.cpp
Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/tools/driver/CMakeLists.txt
cfe/trunk/tools/driver/driver.cpp
cfe/trunk/tools/libclang/CIndexer.cpp

Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=329465=329464=329465=diff
==
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Fri Apr  6 17:03:27 2018
@@ -405,11 +405,19 @@ public:
   int ExecuteCompilation(Compilation ,
  SmallVectorImpl< std::pair > );
 
-  /// generateCompilationDiagnostics - Generate diagnostics information 
+  /// Contains the files in the compilation diagnostic report generated by
+  /// generateCompilationDiagnostics.
+  struct CompilationDiagnosticReport {
+llvm::SmallVector TemporaryFiles;
+  };
+
+  /// generateCompilationDiagnostics - Generate diagnostics information
   /// including preprocessed source file(s).
-  /// 
-  void generateCompilationDiagnostics(Compilation ,
-  const Command );
+  ///
+  void generateCompilationDiagnostics(
+  Compilation , const Command ,
+  StringRef AdditionalInformation = "",
+  CompilationDiagnosticReport *GeneratedReport = nullptr);
 
   /// @}
   /// @name Helper Methods

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=329465=329464=329465=diff
==
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Apr  6 17:03:27 2018
@@ -89,14 +89,14 @@ Driver::Driver(StringRef ClangExecutable
 : Opts(createDriverOptTable()), Diags(Diags), VFS(std::move(VFS)),
   Mode(GCCMode), SaveTemps(SaveTempsNone), BitcodeEmbed(EmbedNone),
   LTOMode(LTOK_None), ClangExecutable(ClangExecutable),
-  SysRoot(DEFAULT_SYSROOT), 
-  DriverTitle("clang LLVM compiler"), CCPrintOptionsFilename(nullptr),
-  CCPrintHeadersFilename(nullptr), CCLogDiagnosticsFilename(nullptr),
-  CCCPrintBindings(false), CCPrintHeaders(false), CCLogDiagnostics(false),
+  SysRoot(DEFAULT_SYSROOT), DriverTitle("clang LLVM compiler"),
+  CCPrintOptionsFilename(nullptr), CCPrintHeadersFilename(nullptr),
+  CCLogDiagnosticsFilename(nullptr), CCCPrintBindings(false),
+  CCPrintOptions(false), CCPrintHeaders(false), CCLogDiagnostics(false),
   CCGenDiagnostics(false), DefaultTargetTriple(DefaultTargetTriple),
-  CCCGenericGCCName(""), Saver(Alloc),
-  CheckInputsExist(true), CCCUsePCH(true),
-  GenReproducer(false), SuppressMissingInputWarning(false) {
+  CCCGenericGCCName(""), Saver(Alloc), CheckInputsExist(true),
+  CCCUsePCH(true), GenReproducer(false),
+  SuppressMissingInputWarning(false) {
 
   // Provide a sane fallback if no VFS is specified.
   if (!this->VFS)
@@ -,8 +,9 @@ bool Driver::getCrashDiagnosticFile(Stri
 // When clang crashes, produce diagnostic information including the fully
 // preprocessed source file(s).  Request that the developer attach the
 // diagnostic information to a bug report.
-void Driver::generateCompilationDiagnostics(Compilation ,
-const Command ) {
+void Driver::generateCompilationDiagnostics(
+Compilation , const Command ,
+StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {
   if (C.getArgs().hasArg(options::OPT_fno_crash_diagnostics))
 return;
 
@@ -1238,6 +1239,8 @@ void Driver::generateCompilationDiagnost