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

Fix C++ mangling for repeated basic types that are target-specific. #9129

Merged
merged 1 commit into from Dec 23, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+19 −4
Diff settings

Always

Just for now

Fix C++ mangling for repeated basic types that are target-specific.

  • Loading branch information...
JohanEngelen committed Dec 23, 2018
commit ba8288e1a993bf923467e533cb06a7770efbdfbd
Copy path View file
@@ -1296,10 +1296,14 @@ extern(C++):
// Handle any target-specific basic types.
if (auto tm = Target.cppTypeMangle(t))
{
if (substitute(t))
return;
else
append(t);
// Only do substitution for mangles that are longer than 1 character.
if (tm[1] != 0 || t.isConst())

This comment has been minimized.

@joakim-noah

joakim-noah Dec 23, 2018

Contributor

Hmm, I noticed this discrepancy with writeBasicType when submitting my ldc pull, traced both changes back to Walter's pull, saw he added both blocks, and figured that's what he wanted, since I didn't know what this substitution was about. I should have asked about it then.

{
if (substitute(t))
return;
else
append(t);
}
CV_qualifiers(t);
buf.writestring(tm);
return;
Copy path View file
@@ -625,13 +625,18 @@ else
alias c_long_double myld;

extern (C++) myld testld(myld);
extern (C++) myld testldld(myld, myld);


void test15()
{
myld ld = 5.0;
ld = testld(ld);
assert(ld == 6.0);

myld ld2 = 5.0;
ld2 = testldld(ld2, ld2);
assert(ld2 == 6.0);
}

/****************************************/
@@ -446,6 +446,12 @@ long double testld(long double ld)
return ld + 1;
}

long double testldld(long double ld1, long double ld2)
{
assert(ld1 == 5);
return ld2 + 1;
}

long testl(long lng)
{
assert(lng == 5);
ProTip! Use n and p to navigate between commits in a pull request.