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 | 457e2815d43fa68f7ff7cd2f7e9d1bf7b6fdc653 (patch) | |
tree | 72d34991a911e99b4c4b05fa41d4a80416dfed6c /lib/CodeGen/Mangle.cpp | |
parent | e7e18200e614a5e619602a088544c85ac8305a1f (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index b0015956be..40c11a5744 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/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(); |