From: Anders Carlsson Date: Sat, 11 Apr 2009 01:19:45 +0000 (+0000) Subject: Don't mangle variables that are at translation unit scope. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ccb06598f724b1fa4c2c88e283879fb550925d5;p=clang Don't mangle variables that are at translation unit scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68853 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 3e685e6b17..dac9a7c57a 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -112,7 +112,8 @@ bool CXXNameMangler::mangle(const NamedDecl *D) { if (const VarDecl *VD = dyn_cast(D)) { if (!Context.getLangOptions().CPlusPlus || - isInCLinkageSpecification(D)) + isInCLinkageSpecification(D) || + D->getDeclContext()->isTranslationUnit()) return false; Out << "_Z";