microsoft / WinObjC

Objective-C for Windows
MIT License
6.24k stars 808 forks source link

decoration of `id` #2789

Closed compnerd closed 7 years ago

compnerd commented 7 years ago

Currently id is decorated as PAAUobjc_object@@ which undname is unable to symbolicate. However, It is unclear whether this is accidental and the decorated name should be PAUobjc_object@@. This properly is undecorated by undname as struct objc_object *.

compnerd commented 7 years ago

CC: @DHowett-MSFT @DHowett

DHowett-MSFT commented 7 years ago

@compnerd Thanks for reporting this. It looks like it should be PAUobjc_object@@.

What issue are you seeing because of this? I think PAAUobjc_object@@ should still unmangle as Uobjc_object* (losing the struct typekind.)

DHowett-MSFT commented 7 years ago

(source: MicrosoftMangle in llvm-mirror here primes the mangled name with PA, then calls mangleArtificalTagType, which should emit U then the name. The code here looks right.)

compnerd commented 7 years ago

Yeah, it does result in Uobjc_object *. I shall fix clang (upstream) to generate this name properly. However, doing so means that

Incorrectly decorating this means that compatibility across C++/ObjC++ is lost, so it is something which would be beneficial to address.

compnerd commented 7 years ago

SVN r3117617 will now mangle id, Class, and @interface appropriately in the C++ context. I have more questions about the decorations, is this the best channel for them?

compnerd commented 7 years ago

clang now generates the right thing.