mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-28 15:58:57 -04:00

We used to save out and eagerly load a (potentially huge) table of merged formerly-canonical declarations when we loaded each module. This was extremely inefficient in the presence of large amounts of merging, and didn't actually save any merging lookup work, because we still needed to perform name lookup to check that our merged declaration lists were complete. This also resulted in a loss of laziness -- even if we only needed an early declaration of an entity, we would eagerly pull in all declarations that had been merged into it regardless. We now store the relevant fragments of the table within the declarations themselves. In detail: * The first declaration of each entity within a module stores a list of first declarations from imported modules that are merged into it. * Loading that declaration pre-loads those other entities, so that they appear earlier within the redeclaration chain. * The name lookup tables list the most recent local lookup result, if there is one, or all directly-imported lookup results if not. llvm-svn: 231424
17 lines
596 B
C++
17 lines
596 B
C++
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 -verify -fmodules -fmodules-cache-path=%t -I %S/Inputs %s
|
|
|
|
#include "linkage-merge-bar.h"
|
|
|
|
static int f(int);
|
|
int f(int);
|
|
|
|
static void g(int);
|
|
// FIXME: Whether we notice the problem here depends on the order in which we
|
|
// happen to find lookup results for 'g'; LookupResult::resolveKind needs to
|
|
// be taught to prefer a visible result over a non-visible one.
|
|
//
|
|
// FIXME-error@-1 {{functions that differ only in their return type cannot be overloaded}}
|
|
// FIXME-note@Inputs/linkage-merge-foo.h:2 {{previous declaration is here}}
|
|
// expected-no-diagnostics
|