aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-23 07:58:44 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-23 15:21:26 +0200
commitff94459c809e2ccd13e6d669b053667d35b3e571 (patch)
tree288d92c99176db334fa5e2f3ae449b248ac3a27c /sources/shiboken2/ApiExtractor/parser/codemodel.cpp
parent443d3d036b062fddec85d8258f9af3852fdfd173 (diff)
shiboken2: Add file location to more warnings
Output most warnings in the standard file:line syntax used by compilers. This is done for C++ source code and typesystem files. Introduce a class SourceLocation and add it to type entry, AbstractMetaFunction and AbstractMetaClass. Move more messages into messages.cpp and output the location. Change the errors reported by the XML typesystem parser to the same format. [ChangeLog][shiboken] A number of error and warning messages have been prefixed by file name and line for better tooling. Task-number: PYSIDE-904 Change-Id: Ie2008f4060757e9d7ca1b25c00c7c5585240a7b8 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/parser/codemodel.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
index e381ba083..e5a6e074c 100644
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
@@ -30,6 +30,7 @@
#include "codemodel.h"
+#include <sourcelocation.h>
#include <clangparser/clangutils.h>
#include <algorithm>
@@ -608,6 +609,11 @@ void _CodeModelItem::setEndPosition(int line, int column)
m_endColumn = column;
}
+SourceLocation _CodeModelItem::sourceLocation() const
+{
+ return SourceLocation(m_fileName, m_startLine);
+}
+
#ifndef QT_NO_DEBUG_STREAM
template <class It>
static void formatPtrSequence(QDebug &d, It i1, It i2, const char *separator=", ")