Update C++ linkage attribute handling

This commit is contained in:
Hackerpilot 2016-06-30 14:50:48 -07:00
parent e4426081dd
commit 18bfad3619
2 changed files with 18 additions and 3 deletions

@ -1 +1 @@
Subproject commit 4be84200a7a786ca74726fa9f239f05b47549b1a
Subproject commit 5323bfc2c5f8303dee8ed3d66eeaa3c0944485f0

View File

@ -134,7 +134,6 @@ class XMLPrinter : ASTVisitor
override void visit(const Attribute attribute)
{
if (attribute.attribute == tok!"")
{
output.writeln("<attribute>");
@ -592,7 +591,23 @@ class XMLPrinter : ASTVisitor
override void visit(const LinkageAttribute linkageAttribute)
{
if (linkageAttribute.hasPlusPlus)
output.writeln("<linkageAttribute linkage=\"c++\"/>");
{
output.write("<linkageAttribute linkage=\"C++\"");
if (linkageAttribute.identifierChain !is null && linkageAttribute.identifierChain.identifiers.length > 0)
{
output.write(" namespace=\"");
format(output.lockingTextWriter, linkageAttribute.identifierChain);
output.writeln("\"/>");
}
else if (linkageAttribute.classOrStruct == tok!"class")
output.writeln(" mangleAs=\"class\"/>");
else if (linkageAttribute.classOrStruct == tok!"struct")
output.writeln(" mangleAs=\"struct\"/>");
else
output.writeln("/>");
}
else if (linkageAttribute.identifier.text == "Objective")
output.writeln("<linkageAttribute linkage=\"Objective-C\"/>");
else
output.writeln("<linkageAttribute linkage=\"",
linkageAttribute.identifier.text, "\"/>");