forked from qt-creator/qt-creator
C++: More flexibility for string representation of macros
It's now possible to get the macro definition with the actual line breaks used on the code. This is particularly useful for tooltips in order for them to look nice. The preprocessor is changed so the macro also stores the breaks positions. This doesn't seem to have any impact on performance. In my machine, for example, the total time for parsing Creator's source code is approx. 18100ms with or without the patch. Change-Id: Ic7487236315c3567d26496315accdb2adfea894a Reviewed-on: http://codereview.qt.nokia.com/4253 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
committed by
Leandro T. C. Melo
parent
b237464045
commit
d91c218d54
@@ -125,13 +125,22 @@ public:
|
||||
void setVariadic(bool isVariadic)
|
||||
{ f._variadic = isVariadic; }
|
||||
|
||||
void setLineBreaks(const QList<unsigned> &breaks)
|
||||
{ _lineBreaks = breaks; }
|
||||
|
||||
const QList<unsigned> &lineBreaks() const
|
||||
{ return _lineBreaks; }
|
||||
|
||||
QString toString() const;
|
||||
QString toStringWithLineBreaks() const;
|
||||
|
||||
// ### private
|
||||
Macro *_next;
|
||||
unsigned _hashcode;
|
||||
|
||||
private:
|
||||
QString decoratedName() const;
|
||||
|
||||
struct Flags
|
||||
{
|
||||
unsigned _hidden: 1;
|
||||
@@ -143,6 +152,7 @@ private:
|
||||
QByteArray _definition;
|
||||
QVector<QByteArray> _formals;
|
||||
QString _fileName;
|
||||
QList<unsigned> _lineBreaks;
|
||||
unsigned _line;
|
||||
unsigned _offset;
|
||||
unsigned _length;
|
||||
|
||||
Reference in New Issue
Block a user