aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-22 20:33:31 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-22 20:33:31 +0000
commitadd28829c7a8d3c5da9ae140f18d3c9ad2d8b599 (patch)
tree15b9fd848d7557cd6c712da9c5b0bc6771cf02b5 /lib/CodeGen/Mangle.cpp
parent17c7a5d7ae8c818696e10a62bbcf19fa6cb90755 (diff)
CXXMethodDecls should always be mangled, even if they are inside an extern "C" block. Fixes PR5017.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 5a994d2234..878f13d516 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -131,7 +131,7 @@ bool CXXNameMangler::mangleFunctionDecl(const FunctionDecl *FD) {
return false;
// No name mangling in a C linkage specification.
- if (isInCLinkageSpecification(FD))
+ if (!isa<CXXMethodDecl>(FD) && isInCLinkageSpecification(FD))
return false;
}
@@ -502,6 +502,9 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) {
// ::= <substitution>
// FIXME: We only handle mangling of namespaces and classes at the moment.
+ while (isa<LinkageSpecDecl>(DC))
+ DC = DC->getParent();
+
if (DC->isTranslationUnit())
return;