The following corrects the MS ABI test output:
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -2329,6 +2329,7 @@ void
MicrosoftMangleContextImpl::mangleTypeName(QualType T, raw_ostream &Out) {
void MicrosoftMangleContextImpl::mangleCXXCtor(const CXXConstructorDecl *D,
CXXCtorType Type,
raw_ostream &Out) {
+ D = cast<CXXConstructorDecl>(D->getFirstDecl());
MicrosoftCXXNameMangler mangler(*this, Out);
mangler.mangle(D);
}
@@ -2336,6 +2337,7 @@ void MicrosoftMangleContextImpl::mangleCXXCtor(const
CXXConstructorDecl *D,
void MicrosoftMangleContextImpl::mangleCXXDtor(const CXXDestructorDecl *D,
CXXDtorType Type,
raw_ostream &Out) {
+ D = cast<CXXDestructorDecl>(D->getFirstDecl());
MicrosoftCXXNameMangler mangler(*this, Out, D, Type);
mangler.mangle(D);
}
On Tue, Jan 20, 2015 at 9:42 AM, David Majnemer <[email protected]>
wrote:
> I don't think this approach would handle things like:
>
> int pr22217_foo;
> int *b = &pr22217_foo;
> extern int pr22217_foo __asm__("pr22217_bar");
>
> With your patch, pr22217_foo gets emitted.
> With gcc, pr22217_bar gets emitted.
>
> On Tue, Jan 20, 2015 at 7:30 AM, Rafael Espíndola <
> [email protected]> wrote:
>
>> Sorry, I attached an older version of the patch. This one has a
>> slightly simpler test.
>>
>> On 20 January 2015 at 10:29, Rafael Espíndola
>> <[email protected]> wrote:
>> > Currently clang will produce a @foo when given
>> >
>> > int foo;
>> > extern int foo __asm__("bar");
>> >
>> > The attached patch makes it produce a @bar, which is what gcc produces.
>> >
>> > I am confused by the output changes in the microsoft abi tests.
>> > Hopefully someone more familiar with it can comment on why using a
>> > more recent decl causes problems and has an idea of what should be
>> > changed to accommodate it.
>> >
>> > Cheers,
>> > Rafael
>>
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits