[all-commits] [llvm/llvm-project] 6fcb85: [lldb][import-std-module] Prefer the non-module di...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Mon Oct 4 10:16:31 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6fcb857746c19b5ed46afdf732b839082326f9d4
      https://github.com/llvm/llvm-project/commit/6fcb857746c19b5ed46afdf732b839082326f9d4
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2021-10-04 (Mon, 04 Oct 2021)

  Changed paths:
    M lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    A lldb/test/API/commands/expression/import-std-module/module-build-errors/Makefile
    A lldb/test/API/commands/expression/import-std-module/module-build-errors/TestStdModuleBuildErrors.py
    A lldb/test/API/commands/expression/import-std-module/module-build-errors/main.cpp
    A lldb/test/API/commands/expression/import-std-module/module-build-errors/root/usr/include/c++/v1/algorithm
    A lldb/test/API/commands/expression/import-std-module/module-build-errors/root/usr/include/c++/v1/module.modulemap
    A lldb/test/API/commands/expression/import-std-module/module-build-errors/root/usr/include/c++/v1/vector
    A lldb/test/API/commands/expression/import-std-module/module-build-errors/root/usr/include/stdio.h
    M lldb/test/API/commands/expression/import-std-module/retry-with-std-module/TestRetryWithStdModule.py

  Log Message:
  -----------
  [lldb][import-std-module] Prefer the non-module diagnostics when in fallback mode

The `fallback` setting for import-std-module is supposed to allow running
expression that require an imported C++ module without causing any regressions
for users (neither in terms of functionality nor performance). This is done by
first trying to normally parse/evaluate an expression and when an error occurred
during this first attempt, we retry with the loaded 'std' module.

When we run into a system with a 'std' module that for some reason doesn't build
or otherwise causes parse errors, then this currently means that the second
parse attempt will overwrite the error diagnostics of the first parse attempt.
Given that the module build errors are outside of the scope of what the user can
influence, it makes more sense to show the errors from the first parse attempt
that are only concerned with the actual user input.

Reviewed By: aprantl

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




More information about the All-commits mailing list