aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-07-18 20:49:59 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-07-18 20:49:59 +0000
commitc00cb6409307846a9bbcd86d307a1a91aab659d0 (patch)
treedc5a74e6f57ec8bb4013de289ea699724d8a99ab /lib/CodeGen/Mangle.cpp
parentea9799c7480197d83f93697f7b4ad98e649541b9 (diff)
Fix mangling for static member variables of classes inside an extern "C"
linkage specification. Not sure if this is the ideal fix, but I'm reasonably sure it's correct vs. gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 58b0246e36..f408849e95 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -304,6 +304,10 @@ bool MangleContext::shouldMangleDeclName(const NamedDecl *D) {
return false;
}
+ // Class members are always mangled.
+ if (D->getDeclContext()->isRecord())
+ return true;
+
// C functions and "main" are not mangled.
if ((FD && FD->isMain()) || isInCLinkageSpecification(D))
return false;