diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-28 16:31:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-28 16:31:34 +0000 |
commit | 05925031f71a2b11be653f123a15e4d4be74000b (patch) | |
tree | dc86e1f0cb75dba0d310ff5948761ec94fe672aa /clang/lib/CodeGen/Mangle.cpp | |
parent | 04f121bc50e682ac7c0547a5f22f579800b7a2e8 (diff) | |
download | bcm5719-llvm-05925031f71a2b11be653f123a15e4d4be74000b.tar.gz bcm5719-llvm-05925031f71a2b11be653f123a15e4d4be74000b.zip |
Mangle based on the declaration we're given, not the canonical
declaration, since attributes that affect mangling may have been added
to subsequent declarations. However, to determine the linkage of the
declaration, we need to look at the canonical declaration. Fixes PR4412.
llvm-svn: 85400
Diffstat (limited to 'clang/lib/CodeGen/Mangle.cpp')
-rw-r--r-- | clang/lib/CodeGen/Mangle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index b0015956be2..40c11a57443 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -115,6 +115,7 @@ namespace { } static bool isInCLinkageSpecification(const Decl *D) { + D = D->getCanonicalDecl(); for (const DeclContext *DC = D->getDeclContext(); !DC->isTranslationUnit(); DC = DC->getParent()) { if (const LinkageSpecDecl *Linkage = dyn_cast<LinkageSpecDecl>(DC)) @@ -1362,7 +1363,7 @@ namespace clang { "Mangling declaration"); CXXNameMangler Mangler(Context, os); - if (!Mangler.mangle(cast<NamedDecl>(D->getCanonicalDecl()))) + if (!Mangler.mangle(D)) return false; os.flush(); |