HomePhabricator

[modules] Remove some redundant work when building a lookup table for a…

Description

[modules] Remove some redundant work when building a lookup table for a DeclContext.

When we need to build the lookup table for a DeclContext, we used to pull in
all lexical declarations for the context; instead, just build a lookup table
for the local lexical declarations. We previously didn't guarantee that the
imported declarations would be in the returned map, but in some cases we'd
happen to put them all in there regardless. Now we're even lazier about this.

This unnecessary work was papering over some other bugs:

  • LookupVisibleDecls would use the DC for name lookups in the TU in C, and this was not guaranteed to find all imported names (generally, the DC for the TU in C is not a reliable place to perform lookups). We now use an identifier-based lookup mechanism for this.
  • We didn't actually load in the list of eagerly-deserialized declarations when importing a module (so external definitions in a module wouldn't be emitted by users of those modules unless they happened to be deserialized by the user of the module).

Details

Auditors
ki.stfu
Committed
rsmithMar 19 2015, 7:17 PM
Parents
rL232792: SampleProfile: Check for missing debug locations
Branches
Unknown
Tags
Unknown

Event Timeline

ki.stfu added subscribers: Unknown Object (MLST), rsmith, ki.stfu.Mar 20 2015, 9:02 AM

Hello @rsmith,

This commit broke the 53 lldb tests. For example:

======================================================================
FAIL: test_with_dwarf_and_run_command (TestDataFormatterSynthVal.DataFormatterSynthValueTestCase)
   Test using Python synthetic children provider to provide a value.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 653, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 543, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 479, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py", line 31, in test_with_dwarf_and_run_command
    self.data_formatter_commands()
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py", line 96, in data_formatter_commands
    self.expect("expression struct S { myInt theInt{12}; }; S()", substrs = ['(theInt = 12)'])
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2082, in expect
    self.runCmd(str, msg=msg, trace = (True if trace else False), check = not error, inHistory=inHistory)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'expression struct S { myInt theInt{12}; }; S()' returns successfully
Config=x86_64-clang
======================================================================
FAIL: test_eval_index_variable (TestIndexVariable.NonOverlappingIndexVariableCase)
   Test expressions of variable 'i' which appears in two for loops.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py", line 23, in test_eval_index_variable
    self.eval_index_variable_i(self.exe_name)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py", line 41, in eval_index_variable_i
    self.runCmd('expr ptr[0]->point.x')
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'expr ptr[0]->point.x' returns successfully
Config=x86_64-clang
======================================================================
FAIL: test_with_dwarf_and_expr_parser (TestClassTypes.ClassTypesTestCase)
   Test 'frame variable this' and 'expr this' when stopped inside a constructor.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 479, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lang/cpp/class_types/TestClassTypes.py", line 61, in test_with_dwarf_and_expr_parser
    self.class_types_expr_parser()
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lang/cpp/class_types/TestClassTypes.py", line 215, in class_types_expr_parser
    self.runCmd("expr m_c_int")
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'expr m_c_int' returns successfully
Config=x86_64-clang
======================================================================
FAIL: test_float_type_with_dwarf (TestFloatTypesExpr.FloatTypesExprTestCase)
   Test that float-type variable expressions are evaluated correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 479, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/types/TestFloatTypesExpr.py", line 40, in test_float_type_with_dwarf
    self.build_and_run_expr('float.cpp', set(['float']), dsym=False)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/types/AbstractBase.py", line 66, in build_and_run_expr
    self.build_and_run_with_source_atoms_expr(source, atoms, expr=True, dsym=dsym, bc=bc, qd=qd)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/types/AbstractBase.py", line 80, in build_and_run_with_source_atoms_expr
    self.generic_type_expr_tester(self.exe_name, atoms, blockCaptured=bc, quotedDisplay=qd)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/types/AbstractBase.py", line 236, in generic_type_expr_tester
    self.runCmd("expression %s" % var)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2008, in runCmd
    msg if msg else CMD_MSG(cmd))
AssertionError: False is not True : Command 'expression a_class_ptr->m_a' returns successfully
Config=x86_64-clang
ki.stfu raised a concern with this commit.Mar 20 2015, 9:02 AM
ki.stfu resigned from this audit.Mar 23 2015, 2:02 AM