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

Merge upstream stable & cherry-pick macOS AArch64 druntime support #3582

Merged
merged 2 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ set(LDC_VERSION "1.24.0") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 0)
set(DMDFE_PATCH_VERSION 94)
set(DMDFE_FIX_LEVEL 0)
set(DMDFE_FIX_LEVEL 1)

set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}${DMDFE_PATCH_VERSION})
if(DEFINED DMDFE_FIX_LEVEL)
Expand Down
27 changes: 24 additions & 3 deletions dmd/cppmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,10 @@ private final class CppMangleVisitor : Visitor
return (*tf.parameterList.parameters)[n].type;
}());
scope (exit) this.context.pop(prev);

if (this.context.ti && global.params.cplusplus >= CppStdRevision.cpp11)
handleParamPack(t, this.context.ti.tempdecl.isTemplateDeclaration().parameters);

headOfType(t);
++numparams;
}
Expand Down Expand Up @@ -1468,6 +1472,26 @@ private final class CppMangleVisitor : Visitor
prefix_name(parent);
}

/**
* Write `Dp` (C++11 function parameter pack prefix) if 't' is a TemplateSequenceParameter (T...).
*
* Params:
* t = Parameter type
* params = Template parameters of the function
*/
private void handleParamPack(Type t, TemplateParameters* params)
{
if (t.isTypeReference())
t = t.nextOf();
auto ti = t.isTypeIdentifier();
if (!ti)
return;

auto idx = templateParamIndex(ti.ident, params);
if (idx < params.length && (*params)[idx].isTemplateTupleParameter())
buf.writestring("Dp");
}

/**
* Helper function to write a `T..._` template index.
*
Expand All @@ -1480,9 +1504,6 @@ private final class CppMangleVisitor : Visitor
// expressions are mangled in <X..E>
if (param.isTemplateValueParameter())
buf.writeByte('X');
else if (param.isTemplateTupleParameter() &&
global.params.cplusplus >= CppStdRevision.cpp11)
buf.writestring("Dp");
buf.writeByte('T');
writeSequenceFromIndex(idx);
buf.writeByte('_');
Expand Down
2 changes: 1 addition & 1 deletion runtime/druntime
2 changes: 1 addition & 1 deletion runtime/phobos