Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] const arrays are not mangled properly #13554

Closed
timurrrr opened this issue Jun 23, 2012 · 9 comments
Closed

[Windows] const arrays are not mangled properly #13554

timurrrr opened this issue Jun 23, 2012 · 9 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@timurrrr
Copy link
Contributor

Bugzilla Link 13182
Resolution FIXED
Resolved on Apr 24, 2013 23:31
Version unspecified
OS Windows NT
Blocks #12849
CC @DougGregor,@tritao,@nico,@pcc,@rjmccall

Extended Description

Here's a test presented as a diff to test/CodeGenCXX/mangle-ms.cpp

the FIXME lines are the unsatisfied checks, NOW is how these variables are mangled today.

diff --git test/CodeGenCXX/mangle-ms.cpp test/CodeGenCXX/mangle-ms.cpp
index 8798a7d..8440d68 100644
--- test/CodeGenCXX/mangle-ms.cpp
+++ test/CodeGenCXX/mangle-ms.cpp
@@ -2,6 +2,11 @@

// CHECK: @"\01?a@@3Ha"
// CHECK: @"\01?b@N@@3Ha"
+// CHECK: @"\01?s1@N@@3PADA"
+// FIXME: @"\01?s2@N@@3QBDB"
+// NOW: @"\01?s2@N@@3PBDA"
+// FIXME: @"\01?s3@N@@3QBDB"
+// NOW: @"\01?s3@N@@3PBDA"
// CHECK: @​c
// CHECK: @"\01?d@foo@@0FB"
// CHECK: @"\01?e@foo@@1jc"
@@ -18,10 +23,17 @@

int a;

-namespace N { int b; }
+namespace N {

  • int b;
  • extern char s1[];
  • extern const char s2[];
  • extern const char s3[42];
    +}

static int c;
-int _c(void) {return c;}
+int _c(void) {

  • return N::s1[0] + N::s2[0] + N::s3[0] + c;
    +}
    // CHECK: @"\01?_c@@yahxz"

class foo {

@timurrrr
Copy link
Contributor Author

assigned to @pcc

@timurrrr
Copy link
Contributor Author

I haven't been able to fix this so far and maybe won't be doing that for some time, so feel free to take over.

@tritao
Copy link
Mannequin

tritao mannequin commented Jun 23, 2012

Thanks for the heads up.

I'm also not sure when I'll be able to look into this, so if someone else wants to do it, feel free :)

@timurrrr
Copy link
Contributor Author

Taking this PR.

@timurrrr
Copy link
Contributor Author

One more broken thing:
extern RGB const color3[5] = {};
should be mangled as
"\01?color3@@3QAY02$$CBNA"
but currently it is
"\01?color3@@3PBY02NA"

@timurrrr
Copy link
Contributor Author

timurrrr commented Sep 3, 2012

FTR, most of these problems were fixed by r163110.
The only remaining one is mentioned in comment #​4.

I'm un-assigning it from myself as this is not a top issue for me anymore, feel free to take over!

@pcc
Copy link
Contributor

pcc commented Apr 22, 2013

I'm working on a fix for this (and a number of other mangling bugs).

@pcc
Copy link
Contributor

pcc commented Apr 25, 2013

Fixed by r180250.

@timurrrr
Copy link
Contributor Author

mentioned in issue llvm/llvm-bugzilla-archive#13444

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

2 participants