This is an archive of the discontinued LLVM Phabricator instance.

[clang][cli] Extract FileSystem and Migrator options parsing/generation
ClosedPublic

Authored by jansvoboda11 on Feb 8 2021, 9:39 AM.

Details

Summary

This patch splits out the last two option groups (Filesystem and Migrator) into their own Parse/Generate functions.

This effectively removes the need for parseSimpleArgs and marshalling block in CompilerInvocation::generateCC1CommandLine.

The two new Parse/Generate functions are not part of the round-trip, because they contain no custom code and the very next patch starts round-tripping the whole CompilerInvocation.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Feb 8 2021, 9:39 AM
jansvoboda11 requested review of this revision.Feb 8 2021, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2021, 9:39 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Feb 8 2021, 11:01 AM
This revision was landed with ongoing or failed builds.Feb 10 2021, 4:36 AM
This revision was automatically updated to reflect the committed changes.
dmajor added a subscriber: dmajor.Feb 10 2021, 4:51 AM

This broke the windows bot: http://lab.llvm.org:8011/#/builders/86/builds/7540/steps/6/logs/stdio

FAILED: tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/CompilerInvocation.cpp.obj 
C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\clang\lib\Frontend -IC:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\clang\lib\Frontend -IC:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\clang\include -Itools\clang\include -Iinclude -IC:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Zc:strictStrings /Oi /Zc:rvalueCast /bigobj /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /MD /O2 /Ob2 /DNDEBUG    /EHs-c- /GR- -std:c++14 /showIncludes /Fotools\clang\lib\Frontend\CMakeFiles\obj.clangFrontend.dir\CompilerInvocation.cpp.obj /Fdtools\clang\lib\Frontend\CMakeFiles\obj.clangFrontend.dir\ /FS -c C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\clang\lib\Frontend\CompilerInvocation.cpp
tools\clang\include\clang/Driver/Options.inc(6004): error C2065: 'FileSystemOpts': undeclared identifier
tools\clang\include\clang/Driver/Options.inc(6005): note: see reference to function template instantiation 'auto GenerateFileSystemArgs::<lambda_2f26d53f66ebc0b2209fc818ab99b309>::operator ()<T>(const T &) const' being compiled

Thanks, I'm pushing a fix. If it doesn't fix the build, I'll revert.

Thank you for the quick followup!