aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-04-02 16:05:20 +0000
committerAnders Carlsson <andersca@mac.com>2009-04-02 16:05:20 +0000
commit329749c1ec1ead3c41af52260f1203e4991b4e83 (patch)
tree1636f0569afd808e7633cce8eb82a155bd62684f /lib/CodeGen/Mangle.cpp
parent43f1740b7eeef0f39479474f199ec7cfa290b57e (diff)
Mangle VarDecls correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 1c84f28d5b..6e62fcfc2e 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -109,6 +109,16 @@ bool CXXNameMangler::mangle(const NamedDecl *D) {
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
return mangleFunctionDecl(FD);
+ if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
+ if (!Context.getLangOptions().CPlusPlus ||
+ isInCLinkageSpecification(D))
+ return false;
+
+ Out << "_Z";
+ mangleName(VD);
+ return true;
+ }
+
return false;
}