summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-04-11 01:19:45 +0000
committerAnders Carlsson <andersca@mac.com>2009-04-11 01:19:45 +0000
commitd8281f1589b4daeec358e6ab916b6267a56c60ec (patch)
tree1608ec701704ca3844433ff586142ed0f1e214e7 /clang/lib/CodeGen/Mangle.cpp
parentd8e39bbb847b35d8912db2d13096d588651a72f1 (diff)
downloadbcm5719-llvm-d8281f1589b4daeec358e6ab916b6267a56c60ec.tar.gz
bcm5719-llvm-d8281f1589b4daeec358e6ab916b6267a56c60ec.zip
Don't mangle variables that are at translation unit scope.
llvm-svn: 68853
Diffstat (limited to 'clang/lib/CodeGen/Mangle.cpp')
-rw-r--r--clang/lib/CodeGen/Mangle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp
index 3e685e6b172..dac9a7c57a9 100644
--- a/clang/lib/CodeGen/Mangle.cpp
+++ b/clang/lib/CodeGen/Mangle.cpp
@@ -112,7 +112,8 @@ bool CXXNameMangler::mangle(const NamedDecl *D) {
if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
if (!Context.getLangOptions().CPlusPlus ||
- isInCLinkageSpecification(D))
+ isInCLinkageSpecification(D) ||
+ D->getDeclContext()->isTranslationUnit())
return false;
Out << "_Z";
OpenPOWER on IntegriCloud