diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-12-22 21:40:42 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-12-22 21:40:42 +0000 |
| commit | 464b0ca61a558d359795a3e4aa1ae5924ac571d5 (patch) | |
| tree | e664a409d2686a5594f04b6172aba4aacad3d488 /clang/test/Modules | |
| parent | 6ca42c5be376d466d9f268dd2ada5a7438bc66d7 (diff) | |
| download | bcm5719-llvm-464b0ca61a558d359795a3e4aa1ae5924ac571d5.tar.gz bcm5719-llvm-464b0ca61a558d359795a3e4aa1ae5924ac571d5.zip | |
Serialize the AST reader's mapping from canonical declarations to the
set of (previously-canonical) declaration IDs to the module file, so
that future AST reader instances that load the module know which
declarations are merged. This is important in the fairly tricky case
where a declaration of an entity, e.g.,
@class X;
occurs before the import of a module that also declares that
entity. We merge the declarations, and record the fact that the
declaration of X loaded from the module was merged into the (now
canonical) declaration of X that we parsed.
llvm-svn: 147181
Diffstat (limited to 'clang/test/Modules')
| -rw-r--r-- | clang/test/Modules/Inputs/redecl-merge-bottom.h | 2 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/redecl-merge-left.h | 2 | ||||
| -rw-r--r-- | clang/test/Modules/redecl-merge.m | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/Modules/Inputs/redecl-merge-bottom.h b/clang/test/Modules/Inputs/redecl-merge-bottom.h index ce4368d08a0..50c191c8b60 100644 --- a/clang/test/Modules/Inputs/redecl-merge-bottom.h +++ b/clang/test/Modules/Inputs/redecl-merge-bottom.h @@ -8,6 +8,8 @@ __import_module__ redecl_merge_right; @class A; +void refers_to_C4(C4*); + #ifdef __cplusplus template<typename T> class Vector; diff --git a/clang/test/Modules/Inputs/redecl-merge-left.h b/clang/test/Modules/Inputs/redecl-merge-left.h index 7f355e8f9d6..c4789ad0c03 100644 --- a/clang/test/Modules/Inputs/redecl-merge-left.h +++ b/clang/test/Modules/Inputs/redecl-merge-left.h @@ -22,6 +22,8 @@ void accept_a_C2(C2*); void accept_a_C3(C3*); @class C3; +@class C4; + @class Explicit; int *explicit_func(void); diff --git a/clang/test/Modules/redecl-merge.m b/clang/test/Modules/redecl-merge.m index 930e8df6b87..ea04037707e 100644 --- a/clang/test/Modules/redecl-merge.m +++ b/clang/test/Modules/redecl-merge.m @@ -58,13 +58,18 @@ void test_C3(C3 *c3) { C4 *global_C4; __import_module__ redecl_merge_left_left; -void test_C4(C4 *c4) { +void test_C4a(C4 *c4) { global_C4 = c4 = get_a_C4(); accept_a_C4(c4); } __import_module__ redecl_merge_bottom; +void test_C4b() { + if (&refers_to_C4) { + } +} + @implementation B + (B*)create_a_B { return 0; } @end |

