summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/CheckDeclaration.cpp
diff options
context:
space:
mode:
authorWolfgang Beck <wolfgang.beck@nokia.com>2010-01-19 15:26:08 +1000
committerWolfgang Beck <wolfgang.beck@nokia.com>2010-01-19 15:26:08 +1000
commit4b3388172904e629fc6f6f1e3a6323e8fe12b97f (patch)
tree098dca6bbe72201050a4d8ec94c008903eb67ed3 /src/shared/cplusplus/CheckDeclaration.cpp
parent29b7594b38f3545bb6a5d5ff08542c0e71a30197 (diff)
downloadqt-creator-4b3388172904e629fc6f6f1e3a6323e8fe12b97f.tar.gz
Merge ichecker branch changes into the mainline. New project can be found under src/tools/ICheck
Diffstat (limited to 'src/shared/cplusplus/CheckDeclaration.cpp')
-rw-r--r--src/shared/cplusplus/CheckDeclaration.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp
index 9758f306a2..c6f747d3dd 100644
--- a/src/shared/cplusplus/CheckDeclaration.cpp
+++ b/src/shared/cplusplus/CheckDeclaration.cpp
@@ -170,6 +170,9 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
const bool isQ_SLOT = ast->qt_invokable_token && tokenKind(ast->qt_invokable_token) == T_Q_SLOT;
const bool isQ_SIGNAL = ast->qt_invokable_token && tokenKind(ast->qt_invokable_token) == T_Q_SIGNAL;
+#ifdef ICHECK_BUILD
+ const bool isQ_INVOKABLE = (ast->invoke_token > 0);
+#endif
List<Declaration *> **decl_it = &ast->symbols;
for (DeclaratorListAST *it = ast->declarator_list; it; it = it->next) {
@@ -196,6 +199,10 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
fun->setMethodKey(Function::SignalMethod);
else if (isQ_SLOT)
fun->setMethodKey(Function::SlotMethod);
+#ifdef ICHECK_BUILD
+ else if (isQ_INVOKABLE)
+ fun->setInvokable(true);
+#endif
fun->setVisibility(semantic()->currentVisibility());
} else if (semantic()->currentMethodKey() != Function::NormalMethod) {
translationUnit()->warning(ast->firstToken(),
@@ -259,6 +266,28 @@ bool CheckDeclaration::visit(AccessDeclarationAST *ast)
return false;
}
+#ifdef ICHECK_BUILD
+bool CheckDeclaration::visit(QPropertyDeclarationAST *)
+{
+ return false;
+}
+
+bool CheckDeclaration::visit(QEnumDeclarationAST *)
+{
+ return false;
+}
+
+bool CheckDeclaration::visit(QFlagsDeclarationAST *)
+{
+ return false;
+}
+
+bool CheckDeclaration::visit(QDeclareFlagsDeclarationAST *)
+{
+ return false;
+}
+#endif
+
bool CheckDeclaration::visit(AsmDefinitionAST *)
{
return false;
@@ -316,11 +345,18 @@ bool CheckDeclaration::visit(FunctionDefinitionAST *ast)
const bool isQ_SLOT = ast->qt_invokable_token && tokenKind(ast->qt_invokable_token) == T_Q_SLOT;
const bool isQ_SIGNAL = ast->qt_invokable_token && tokenKind(ast->qt_invokable_token) == T_Q_SIGNAL;
+#ifdef ICHECK_BUILD
+ const bool isQ_INVOKABLE = (ast->invoke_token > 0);
+#endif
if (isQ_SIGNAL)
fun->setMethodKey(Function::SignalMethod);
else if (isQ_SLOT)
fun->setMethodKey(Function::SlotMethod);
+#ifdef ICHECK_BUILD
+ else if (isQ_INVOKABLE)
+ fun->setInvokable(true);
+#endif
checkFunctionArguments(fun);