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

llvm-undname sometimes drops a "const" #38978

Closed
nico opened this issue Nov 11, 2018 · 2 comments
Closed

llvm-undname sometimes drops a "const" #38978

nico opened this issue Nov 11, 2018 · 2 comments
Labels
bugzilla Issues migrated from bugzilla wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@nico
Copy link
Contributor

nico commented Nov 11, 2018

Bugzilla Link 39630
Resolution WONTFIX
Resolved on Nov 12, 2018 03:12
Version unspecified
OS All

Extended Description

$ bin/llvm-undname '?wrapper_type_info_@WorkletGlobalScope@blink@@0ABUWrapperTypeInfo@2@B'
?wrapper_type_info_@WorkletGlobalScope@blink@@0ABUWrapperTypeInfo@2@B
private: static struct blink::WrapperTypeInfo const &blink::WorkletGlobalScope::wrapper_type_info_

But regular undname prints:

private: static struct blink::WrapperTypeInfo const & const blink::WorkletGlobalScope::wrapper_type_info_

(const & vs const & const)

There are a bunch of similar examples, also with const * vs const * const, in blink_core.dll.

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 11, 2018

I’m not sure if this is the same case, but there’s at least one instance of this “bug” where llvm-undname is correct and undname is wrong. See the tests, i even left a comment about it in the test file. If this is the same thing, we should close this one since I believe the bug to be in undname.

@nico
Copy link
Contributor Author

nico commented Nov 12, 2018

I'm willing to believe it's an undname bug :-) The wine implementation of _unDName has it too fwiw.

I tried finding the test case you mention but failed.

...aha, but here's a from-source repro that shows you're right:

$ cat test.cc
struct S {};

struct T {
static const S* s_;

const S* s();
void set(const S* s);
};

const S* T::s() { return s_; }
void T::set(const S* s) { s_ = s; }

$ third_party/llvm-build/Release+Asserts/bin/clang-cl /c test.cc /Fa -Xclang -emit-llvm 2&>1 > /dev/null ; cat test.asm | grep s_
@"?s_@T@@2PEBUS@@eb" = external dso_local global %struct.S*, align 8
%0 = load %struct.S*, %struct.S** @"?s_@T@@2PEBUS@@eb", align 8
store %struct.S* %0, %struct.S** @"?s_@T@@2PEBUS@@eb", align 8

$ demumble '?s_@T@@2PEBUS@@eb' # currently uses wine _unDName()
public: static struct S const * __ptr64 const _ptr64 T::s

$ bin/llvm-undname '?s_@T@@2PEBUS@@eb'
?s_@T@@2PEBUS@@eb
public: static struct S const *T::s_

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
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 wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

3 participants