diff --git a/llvm/lib/IR/Mangler.cpp b/llvm/lib/IR/Mangler.cpp --- a/llvm/lib/IR/Mangler.cpp +++ b/llvm/lib/IR/Mangler.cpp @@ -186,7 +186,7 @@ // Check if the name needs quotes to be safe for the linker to interpret. static bool canBeUnquotedInDirective(char C) { - return isAlnum(C) || C == '_' || C == '$' || C == '.' || C == '@'; + return isAlnum(C) || C == '_' || C == '@'; } static bool canBeUnquotedInDirective(StringRef Name) { diff --git a/llvm/test/CodeGen/X86/dllexport.ll b/llvm/test/CodeGen/X86/dllexport.ll --- a/llvm/test/CodeGen/X86/dllexport.ll +++ b/llvm/test/CodeGen/X86/dllexport.ll @@ -84,6 +84,9 @@ ; CHECK: .globl "_complex-name" @"complex-name" = dllexport global i32 1, align 4 +; CHECK: .globl _complex.name +@"complex.name" = dllexport global i32 1, align 4 + ; Verify items that should not be exported do not appear in the export table. ; We use a separate check prefix to avoid confusion between -NOT and -SAME. @@ -106,6 +109,7 @@ ; CHECK-CL: .ascii " /EXPORT:_WeakVar1,DATA" ; CHECK-CL: .ascii " /EXPORT:_WeakVar2,DATA" ; CHECK-CL: .ascii " /EXPORT:\"_complex-name\",DATA" +; CHECK-CL: .ascii " /EXPORT:\"_complex.name\",DATA" ; CHECK-CL: .ascii " /EXPORT:_alias" ; CHECK-CL: .ascii " /EXPORT:_alias2" ; CHECK-CL: .ascii " /EXPORT:_alias3" @@ -124,6 +128,7 @@ ; CHECK-GCC: .ascii " -export:WeakVar1,data" ; CHECK-GCC: .ascii " -export:WeakVar2,data" ; CHECK-GCC: .ascii " -export:\"complex-name\",data" +; CHECK-GCC: .ascii " -export:\"complex.name\",data" ; CHECK-GCC: .ascii " -export:alias" ; CHECK-GCC: .ascii " -export:alias2" ; CHECK-GCC: .ascii " -export:alias3"