[all-commits] [llvm/llvm-project] fc52ee: [lldb][ClangUserExpression][NFCI] Pass the most sp...

Michael Buch via All-commits all-commits at lists.llvm.org
Thu Apr 11 11:29:39 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc52ee336b394d84110184d625cda1d4f84d8098
      https://github.com/llvm/llvm-project/commit/fc52ee336b394d84110184d625cda1d4f84d8098
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2024-04-11 (Thu, 11 Apr 2024)

  Changed paths:
    M lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h

  Log Message:
  -----------
  [lldb][ClangUserExpression][NFCI] Pass the most specific ExecutionContextScope possible into ClangExpressionParser (#87657)

The `ClangExpressionParser` takes an `ExecutionContextScope` which it
uses to query the `Process`/`Target`/`StackFrame` to set various
compiler options in preparation for parsing an expression.

However, `TryParse` constructs the parser with a `Process` or `Target`,
never a `StackFrame`. So when the parser tries to retrieve the current
`StackFrame` from the `exe_scope`, it doesn't succeed. In future patches
we want to query the `StackFrame` from within the
`ClangExpressionParser` constructor.

This patch simplifies `TryParse`, by removing the redundant `exe_scope`
parameter, and instead uses the `exe_ctx` to derive the most fitting
`exe_scope` to pass into `ClangExpressionParser`.

Not entirely sure how to test this. This patch is a prerequisite to get
subsequent patches that set `LangOpts` based on the current `StackFrame`
to work.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list