111 lines
3.4 KiB
Diff
111 lines
3.4 KiB
Diff
From 0f830b2abc7763f6598f7f1a84f5af403d402a02 Mon Sep 17 00:00:00 2001
|
|
From: Milian Wolff <mail@milianw.de>
|
|
Date: Mon, 2 Mar 2020 22:56:55 +0100
|
|
Subject: Fix linking on s390x
|
|
|
|
Ensure all symbols are available and don't hide the template
|
|
instantiation.
|
|
|
|
BUG: 417679
|
|
---
|
|
kdev-pg/kdev-pg-code-gen.cpp | 47 ++++++++++++++++++++++----------------------
|
|
kdev-pg/kdev-pg-code-gen.h | 14 ++++++++++++-
|
|
2 files changed, 36 insertions(+), 25 deletions(-)
|
|
|
|
diff --git a/kdev-pg/kdev-pg-code-gen.cpp b/kdev-pg/kdev-pg-code-gen.cpp
|
|
index 4db60e0..7a5d8aa 100644
|
|
--- a/kdev-pg/kdev-pg-code-gen.cpp
|
|
+++ b/kdev-pg/kdev-pg-code-gen.cpp
|
|
@@ -1014,35 +1014,34 @@ void GenerateParseMethodSignature::visitVariableDeclaration(Model::VariableDecla
|
|
DefaultVisitor::visitVariableDeclaration(node);
|
|
}
|
|
|
|
-template<bool printType, bool printName>
|
|
-void GenerateVariableDeclaration<printType, printName>::operator()(Model::VariableDeclarationItem *node)
|
|
+namespace GenerateVariableDeclarationImpl
|
|
{
|
|
- if(printType)
|
|
- {
|
|
- if (node->mIsSequence)
|
|
- out << "const KDevPG::ListNode<";
|
|
+void printType(QTextStream &out, Model::VariableDeclarationItem *node)
|
|
+{
|
|
+ if (node->mIsSequence)
|
|
+ out << "const KDevPG::ListNode<";
|
|
|
|
- if (node->mVariableType == Model::VariableDeclarationItem::TypeToken)
|
|
- out << "qint64 ";
|
|
- else if (node->mVariableType == Model::VariableDeclarationItem::TypeNode)
|
|
- {
|
|
- out << node->mCapitalizedType << "Ast *";
|
|
- }else if (node->mVariableType == Model::VariableDeclarationItem::TypeVariable)
|
|
- out << node->mType << " ";
|
|
- else
|
|
- Q_ASSERT(0); // ### not supported
|
|
+ if (node->mVariableType == Model::VariableDeclarationItem::TypeToken)
|
|
+ out << "qint64 ";
|
|
+ else if (node->mVariableType == Model::VariableDeclarationItem::TypeNode)
|
|
+ {
|
|
+ out << node->mCapitalizedType << "Ast *";
|
|
+ }else if (node->mVariableType == Model::VariableDeclarationItem::TypeVariable)
|
|
+ out << node->mType << " ";
|
|
+ else
|
|
+ Q_ASSERT(0); // ### not supported
|
|
|
|
- if (node->mIsSequence)
|
|
- out << "> *";
|
|
- }
|
|
+ if (node->mIsSequence)
|
|
+ out << "> *";
|
|
+}
|
|
|
|
- if(printName)
|
|
- {
|
|
- out << node->mName;
|
|
+void printName(QTextStream &out, Model::VariableDeclarationItem *node)
|
|
+{
|
|
+ out << node->mName;
|
|
|
|
- if (node->mIsSequence)
|
|
- out << "Sequence";
|
|
- }
|
|
+ if (node->mIsSequence)
|
|
+ out << "Sequence";
|
|
+}
|
|
}
|
|
|
|
void GenerateMemberCode::operator()(Settings::MemberItem* m)
|
|
diff --git a/kdev-pg/kdev-pg-code-gen.h b/kdev-pg/kdev-pg-code-gen.h
|
|
index f639ab6..9c9160e 100644
|
|
--- a/kdev-pg/kdev-pg-code-gen.h
|
|
+++ b/kdev-pg/kdev-pg-code-gen.h
|
|
@@ -136,6 +136,12 @@ public:
|
|
void operator()(Model::SymbolItem *node);
|
|
};
|
|
|
|
+namespace GenerateVariableDeclarationImpl
|
|
+{
|
|
+ void printType(QTextStream &out, Model::VariableDeclarationItem *node);
|
|
+ void printName(QTextStream &out, Model::VariableDeclarationItem *node);
|
|
+};
|
|
+
|
|
template<bool printType, bool printName>
|
|
class GenerateVariableDeclaration
|
|
{
|
|
@@ -146,7 +152,13 @@ public:
|
|
GenerateVariableDeclaration(QTextStream& o): out(o)
|
|
{}
|
|
|
|
- void operator()(Model::VariableDeclarationItem *node);
|
|
+ void operator()(Model::VariableDeclarationItem *node)
|
|
+ {
|
|
+ if (printType)
|
|
+ GenerateVariableDeclarationImpl::printType(out, node);
|
|
+ if (printName)
|
|
+ GenerateVariableDeclarationImpl::printName(out, node);
|
|
+ }
|
|
};
|
|
|
|
class GenerateTokenVariableInitialization : public DefaultVisitor
|
|
--
|
|
cgit v1.1
|