"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dmd/cppmangle.d" between
dmd-2.094.0.tar.gz and dmd-2.094.1.tar.gz

About: DMD (Digital Mars D) is the D reference compiler. D is an object-oriented, imperative, multi-paradigm system programming language.

cppmangle.d  (dmd-2.094.0):cppmangle.d  (dmd-2.094.1)
skipping to change at line 1291 skipping to change at line 1291
auto prev = this.context.push({ auto prev = this.context.push({
TypeFunction tf; TypeFunction tf;
if (isDsymbol(this.context.res)) if (isDsymbol(this.context.res))
tf = cast(TypeFunction)this.context.res.asFuncDecl().typ e; tf = cast(TypeFunction)this.context.res.asFuncDecl().typ e;
else else
tf = this.context.res.asType().isTypeFunction(); tf = this.context.res.asType().isTypeFunction();
assert(tf); assert(tf);
return (*tf.parameterList.parameters)[n].type; return (*tf.parameterList.parameters)[n].type;
}()); }());
scope (exit) this.context.pop(prev); scope (exit) this.context.pop(prev);
if (this.context.ti && global.params.cplusplus >= CppStdRevision.cpp
11)
handleParamPack(t, this.context.ti.tempdecl.isTemplateDeclaratio
n().parameters);
headOfType(t); headOfType(t);
++numparams; ++numparams;
} }
if (parameterList.varargs == VarArg.variadic) if (parameterList.varargs == VarArg.variadic)
buf.writeByte('z'); buf.writeByte('z');
else if (!numparams) else if (!numparams)
buf.writeByte('v'); // encode (void) parameters buf.writeByte('v'); // encode (void) parameters
} }
skipping to change at line 1466 skipping to change at line 1470
* ::= <template-prefix> <template-args> * ::= <template-prefix> <template-args>
* ::= <template-param> * ::= <template-param>
* ::= # empty * ::= # empty
* ::= <substitution> * ::= <substitution>
* ::= <prefix> <data-member-prefix> * ::= <prefix> <data-member-prefix>
*/ */
prefix_name(parent); prefix_name(parent);
} }
/** /**
* Write `Dp` (C++11 function parameter pack prefix) if 't' is a TemplateSeq
uenceParameter (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. * Helper function to write a `T..._` template index.
* *
* Params: * Params:
* idx = Index of `param` in the template argument list * idx = Index of `param` in the template argument list
* param = Template parameter to mangle * param = Template parameter to mangle
*/ */
private void writeTemplateArgIndex(size_t idx, TemplateParameter param) private void writeTemplateArgIndex(size_t idx, TemplateParameter param)
{ {
// expressions are mangled in <X..E> // expressions are mangled in <X..E>
if (param.isTemplateValueParameter()) if (param.isTemplateValueParameter())
buf.writeByte('X'); buf.writeByte('X');
else if (param.isTemplateTupleParameter() &&
global.params.cplusplus >= CppStdRevision.cpp11)
buf.writestring("Dp");
buf.writeByte('T'); buf.writeByte('T');
writeSequenceFromIndex(idx); writeSequenceFromIndex(idx);
buf.writeByte('_'); buf.writeByte('_');
if (param.isTemplateValueParameter()) if (param.isTemplateValueParameter())
buf.writeByte('E'); buf.writeByte('E');
} }
/** /**
* Given an array of template parameters and an identifier, * Given an array of template parameters and an identifier,
* returns the index of the identifier in that array. * returns the index of the identifier in that array.
 End of changes. 3 change blocks. 
3 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)