diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2023-09-29 18:06:54 -0700 |
---|---|---|
committer | Med Ismail Bennani <ismail@bennani.ma> | 2023-09-29 18:56:02 -0700 |
commit | 466ea89fc6d8bfd197cbc1055bbc38e730e9d523 (patch) | |
tree | 0fe4fecb16ac54ad867ee52e8c64f75553719113 /clang/lib/Basic/SourceManager.cpp | |
parent | 8d203100e898f6822c9feba65578df0d267dd247 (diff) | |
download | llvm-466ea89fc6d8bfd197cbc1055bbc38e730e9d523.zip llvm-466ea89fc6d8bfd197cbc1055bbc38e730e9d523.tar.gz llvm-466ea89fc6d8bfd197cbc1055bbc38e730e9d523.tar.bz2 |
[lldb] Fix failures when evaluating C++ expression and loading modules
This patch tentatively fixes the various test failures introduced
following 0ea3d88bdb16:
https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/6316/
From my understanding, the main issue here is that we can't find some headers
when evaluating C++ expressions since those headers have been promoted
to be system modules, and to be shipped as part of the toolchain.
Prior to 0ea3d88bdb16, the `BuiltinHeadersInSystemModules` flag for in
the clang `LangOpts` struct was always set, however, after it landed,
the flag becomes opt-in, depending on toolchain that is used with the
compiler instance. This gets set in `clang::createInvocation` down to
`Darwin::addClangTargetOptions`, as this is used mostly on Apple platforms.
However, since `ClangExpressionParser` makes a dummy `CompilerInstance`,
and sets the various language options arbitrarily, instead of using the
`clang::createInvocation`, the flag remains unset, which causes the
various error messages:
```
AssertionError: 'error: module.modulemap:96:11: header 'stdarg.h' not found
96 | header "stdarg.h" // note: supplied by the compiler
| ^
```
Given that this flag was opt-out previously, this patch brings back that
behavior by setting it in lldb's `ClangExpressionParser` constructor,
until we actually decide to pull the language options from the compiler driver.
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions