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] Wrong mangling of "const char * const *" #13816

Closed
timurrrr opened this issue Jul 24, 2012 · 11 comments
Closed

[Windows] Wrong mangling of "const char * const *" #13816

timurrrr opened this issue Jul 24, 2012 · 11 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@timurrrr
Copy link
Contributor

Bugzilla Link 13444
Resolution FIXED
Resolved on Sep 03, 2012 04:21
Version unspecified
OS Windows NT
Blocks #12849
CC @DougGregor,@tritao

Extended Description

The mangling is broken when using -cxx-abi microsoft:
$ cat const_arrays.cpp
extern const char* const* global;
// CHECK: "\01?global@@3PBQBDB"
// NOW: "\01?global@@3PQBDA"
// Probably related to #13554

void foo(const char* const* arg) {
// CHECK: "\01?foo@@YAXPBQBD@Z"
// NOW: "\01?foo@@YAXPQBD@Z"
// Probably UN-related to #13554
if (global[0]) arg++;
}

@timurrrr
Copy link
Contributor Author

assigned to @timurrrr

@tritao
Copy link
Mannequin

tritao mannequin commented Jul 24, 2012

Are you working on this Timur?

@timurrrr
Copy link
Contributor Author

Not yet.
This affects only one file of my current 500+-files target :)
Feel free to take over if you want.

@timurrrr
Copy link
Contributor Author

If you do take over - please pay more attention to the foo mangling as half of the global mangling problem will be solved by my #13554 patch

@timurrrr
Copy link
Contributor Author

One more possibly related test:

void foo(const unsigned int) {}
// CHECK: "\01?foo@@yaxi@Z"
// NOW: "\01?foo@@Yaxbi@Z"

@timurrrr
Copy link
Contributor Author

More tests:

void foo(const double) {}
// CHECK: "\01?foo@@yaxn@Z"
// NOW: "\01?foo@@YAXBN@Z"

typedef double Vector[3];
void foo(const Vector) {}
// CHECK: "\01?foo@@YAXQBN@Z"
// NOW: "\01?foo@@YAXBQAN@Z"

void foo(Vector*, const Vector, const double) {}
// CHECK: "\01?foo@@YAXPAY02NQBNN@Z"
// NOW: "\01?foo@@YAXPAY02NBQANBN@Z"

void foo(Vector*) {}
// CHECK: "\01?foo@@YAXPAY02N@Z"
// NOW: "\01?foo@@YAXPAY02N@Z"
// The last one is correct now

@timurrrr
Copy link
Contributor Author

Taking this

@timurrrr
Copy link
Contributor Author

Good news: I think I've fixed all these issues.
I'll need to clean up the code (comments, mostly) before sending it for a review though.

@tritao
Copy link
Mannequin

tritao mannequin commented Aug 29, 2012

Thanks for the update. I'll be happy to help review the patch once you post it.

@timurrrr
Copy link
Contributor Author

timurrrr commented Sep 3, 2012

Should be fixed by r163110.

@timurrrr
Copy link
Contributor Author

timurrrr commented Sep 3, 2012

... and added more tests in r163111.

@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

1 participant