This is an archive of the discontinued LLVM Phabricator instance.

[mlir][pdll] Add extra-dirs for LSP includes.
ClosedPublic

Authored by jpienaar on Apr 10 2022, 3:28 PM.

Details

Summary

Enable specifying additional include directories to search. This is
consistent with what one can do with clangd (although there it is more
general compilation options) and Python LSP. We would in general expect
these to be provided by compilation database equivalent.

Diff Detail

Event Timeline

jpienaar created this revision.Apr 10 2022, 3:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2022, 3:28 PM
jpienaar requested review of this revision.Apr 10 2022, 3:28 PM
rriddle accepted this revision.Apr 10 2022, 8:17 PM

Nice, thanks.

mlir/lib/Tools/mlir-pdll-lsp-server/MlirPdllLspServerMain.cpp
58

Unrelated, but this should probably say PDLL. Oops

mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.h
79

nit: Can you move this into the Impl? It helps keep all of the class state contained in one place.

This revision is now accepted and ready to land.Apr 10 2022, 8:17 PM
This revision was landed with ongoing or failed builds.Apr 13 2022, 9:41 AM
This revision was automatically updated to reflect the committed changes.
jpienaar marked 2 inline comments as done.

This is causing failures on the Windows builbot: https://lab.llvm.org/buildbot/#/builders/13/builds/19626/steps/6/logs/stdio
I believe you simply need #include <string> to make MSVC happy.

C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=1 -DMLIR_ROCM_CONVERSIONS_ENABLED=1 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -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 -IC:\buildbot\mlir-x64-windows-ninja\build\tools\mlir\lib\Tools\mlir-pdll-lsp-server -IC:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server -IC:\buildbot\mlir-x64-windows-ninja\build\include -IC:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\include -IC:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\include -IC:\buildbot\mlir-x64-windows-ninja\build\tools\mlir\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  /EHs-c- /GR- -UNDEBUG -std:c++14 /showIncludes /Fotools\mlir\lib\Tools\mlir-pdll-lsp-server\CMakeFiles\MLIRPdllLspServerLib.dir\PDLLServer.cpp.obj /Fdtools\mlir\lib\Tools\mlir-pdll-lsp-server\CMakeFiles\MLIRPdllLspServerLib.dir\MLIRPdllLspServerLib.pdb /FS -c C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.cpp
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): error C2039: 'string': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(24): note: see declaration of 'std'
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): error C2065: 'string': undeclared identifier
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): error C2923: 'std::vector': 'string' is not a valid template type argument for parameter '_Ty'
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): note: see declaration of 'string'

This is causing failures on the Windows builbot: https://lab.llvm.org/buildbot/#/builders/13/builds/19626/steps/6/logs/stdio
I believe you simply need #include <string> to make MSVC happy.

C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=1 -DMLIR_ROCM_CONVERSIONS_ENABLED=1 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -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 -IC:\buildbot\mlir-x64-windows-ninja\build\tools\mlir\lib\Tools\mlir-pdll-lsp-server -IC:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server -IC:\buildbot\mlir-x64-windows-ninja\build\include -IC:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\include -IC:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\include -IC:\buildbot\mlir-x64-windows-ninja\build\tools\mlir\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  /EHs-c- /GR- -UNDEBUG -std:c++14 /showIncludes /Fotools\mlir\lib\Tools\mlir-pdll-lsp-server\CMakeFiles\MLIRPdllLspServerLib.dir\PDLLServer.cpp.obj /Fdtools\mlir\lib\Tools\mlir-pdll-lsp-server\CMakeFiles\MLIRPdllLspServerLib.dir\MLIRPdllLspServerLib.pdb /FS -c C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.cpp
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): error C2039: 'string': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(24): note: see declaration of 'std'
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): error C2065: 'string': undeclared identifier
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): error C2923: 'std::vector': 'string' is not a valid template type argument for parameter '_Ty'
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\lib\Tools\mlir-pdll-lsp-server\PDLLServer.h(32): note: see declaration of 'string'

Thanks for flagging, will address. (funnily I didn't get email from Windows buildbot yet)