diff options
| author | John McCall <rjmccall@apple.com> | 2011-03-22 06:58:49 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-03-22 06:58:49 +0000 |
| commit | 8f9a42971eccfbf74c2ff55f116761fe06025592 (patch) | |
| tree | 42be3a35be2f106c1ddb739ca434e80b782604ee | |
| parent | 290b32b90f4c233aca0c855b9318fb5198f1d5f5 (diff) | |
| download | bcm5719-llvm-8f9a42971eccfbf74c2ff55f116761fe06025592.tar.gz bcm5719-llvm-8f9a42971eccfbf74c2ff55f116761fe06025592.zip | |
Fix a test case and teach ClearLinkageCache() to clear the linkage of
a function template decl's pattern, which was suddenly exposed by my
last patch.
llvm-svn: 128073
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/static-init.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 0dce211c136..df72541fbf9 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -639,10 +639,12 @@ void NamedDecl::ClearLinkageCache() { // Clear cached linkage for function template decls, too. if (FunctionTemplateDecl *temp = - dyn_cast<FunctionTemplateDecl>(const_cast<NamedDecl*>(this))) + dyn_cast<FunctionTemplateDecl>(const_cast<NamedDecl*>(this))) { + temp->getTemplatedDecl()->ClearLinkageCache(); for (FunctionTemplateDecl::spec_iterator i = temp->spec_begin(), e = temp->spec_end(); i != e; ++i) i->ClearLinkageCache(); + } } diff --git a/clang/test/CodeGenCXX/static-init.cpp b/clang/test/CodeGenCXX/static-init.cpp index dd9ed61434e..78749a7a2fa 100644 --- a/clang/test/CodeGenCXX/static-init.cpp +++ b/clang/test/CodeGenCXX/static-init.cpp @@ -2,7 +2,7 @@ // CHECK: @_ZZ1hvE1i = internal global i32 0, align 4 -// CHECK: @_ZZN5test16getvarEiE3var = internal constant [4 x i32] [i32 1, i32 0, i32 2, i32 4], align 16 +// CHECK: @_ZZN5test1L6getvarEiE3var = internal constant [4 x i32] [i32 1, i32 0, i32 2, i32 4], align 16 // CHECK: @_ZZ2h2vE1i = linkonce_odr global i32 0 // CHECK: @_ZGVZ2h2vE1i = linkonce_odr global i64 0 @@ -50,7 +50,7 @@ namespace test0 { } namespace test1 { - // CHECK: define internal i32 @_ZN5test16getvarEi( + // CHECK: define internal i32 @_ZN5test1L6getvarEi( static inline int getvar(int index) { static const int var[] = { 1, 0, 2, 4 }; return var[index]; |

