forked from qt-creator/qt-creator
Clang: On the road to update and preprocessor support
This patch has grown in a quite big change set and it is really hard to divide it in different parts. V2::ProjectPartContainer is now using FileIds instead of file paths. This cleans code up because it is a big step in the direction that internally only file ids are used. But it is depending on the file cache, so the file cache has to be provided as an argument. There is now an interface for transactions too which are ease the testing of them and enables the support of preprocessor. It adds macros as symbols and is saving used macros. The used macro support is enabling update improvements because only if a changed macro is used it needs to be recompiled. This is still in flux and can be changed in later patches. Change-Id: I492a2c9af1201d40fdd9f46a0045f7878bbbaa3d Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
|
||||
#include <filepathid.h>
|
||||
|
||||
#include <utils/linecolumn.h>
|
||||
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
@@ -37,19 +39,10 @@ namespace ClangBackEnd {
|
||||
enum class SymbolType
|
||||
{
|
||||
Declaration,
|
||||
DeclarationReference
|
||||
};
|
||||
|
||||
class LineColumn
|
||||
{
|
||||
public:
|
||||
LineColumn(uint line, uint column)
|
||||
: line(line),
|
||||
column(column)
|
||||
{}
|
||||
|
||||
uint line = 0;
|
||||
uint column = 0;
|
||||
DeclarationReference,
|
||||
MacroDefinition,
|
||||
MacroUsage,
|
||||
MacroUndefinition
|
||||
};
|
||||
|
||||
using SymbolIndex = long long;
|
||||
@@ -59,27 +52,24 @@ class SourceLocationEntry
|
||||
public:
|
||||
SourceLocationEntry(SymbolIndex symbolId,
|
||||
FilePathId filePathId,
|
||||
LineColumn lineColumn,
|
||||
Utils::LineColumn lineColumn,
|
||||
SymbolType symbolType)
|
||||
: symbolId(symbolId),
|
||||
filePathId(filePathId),
|
||||
line(lineColumn.line),
|
||||
column(lineColumn.column),
|
||||
lineColumn(lineColumn),
|
||||
symbolType(symbolType)
|
||||
{}
|
||||
|
||||
SymbolIndex symbolId = 0;
|
||||
FilePathId filePathId;
|
||||
uint line = 0;
|
||||
uint column = 0;
|
||||
Utils::LineColumn lineColumn;
|
||||
SymbolType symbolType;
|
||||
|
||||
friend bool operator==(const SourceLocationEntry &first, const SourceLocationEntry &second)
|
||||
{
|
||||
return first.symbolId == second.symbolId
|
||||
&& first.filePathId == second.filePathId
|
||||
&& first.line == second.line
|
||||
&& first.column == second.column
|
||||
&& first.lineColumn == second.lineColumn
|
||||
&& first.symbolType == second.symbolType;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user