[Lldb-commits] [PATCH] D32100: [Expression parser] Return both types and variables

Sean Callanan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 14 15:56:35 PDT 2017


spyffe created this revision.

Many times a user wants to access a type when there's a variable of the same name, or a variable when there's a type of the same name.  Depending on the precise context, currently the expression parser can fail to resolve one or the other.

This is because `ClangExpressionDeclMap` has logic to limit the amount of information it searches, and that logic sometimes cuts down the search prematurely.  This patch removes some of those early exits.

In that sense, this patch trades performance (early exit is faster) for correctness.

I've also included two new test cases showing examples of this behavior – as well as modifying an existing test case that gets it wrong.


https://reviews.llvm.org/D32100

Files:
  packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile
  packages/Python/lldbsuite/test/lang/cpp/llvm-style/TestLLVMStyle.py
  packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc
  packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
  packages/Python/lldbsuite/test/lang/cpp/symbols/Makefile
  packages/Python/lldbsuite/test/lang/cpp/symbols/TestSymbpls.py
  packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32100.95358.patch
Type: text/x-patch
Size: 30654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170414/2bf538f7/attachment-0001.bin>


More information about the lldb-commits mailing list