forked from qt-creator/qt-creator
Standardize on int for line and column values
Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
1542
src/libs/3rdparty/cplusplus/AST.cpp
vendored
1542
src/libs/3rdparty/cplusplus/AST.cpp
vendored
File diff suppressed because it is too large
Load Diff
1266
src/libs/3rdparty/cplusplus/AST.h
vendored
1266
src/libs/3rdparty/cplusplus/AST.h
vendored
File diff suppressed because it is too large
Load Diff
28
src/libs/3rdparty/cplusplus/ASTVisitor.cpp
vendored
28
src/libs/3rdparty/cplusplus/ASTVisitor.cpp
vendored
@@ -49,44 +49,40 @@ TranslationUnit *ASTVisitor::translationUnit() const
|
||||
void ASTVisitor::setTranslationUnit(TranslationUnit *translationUnit)
|
||||
{ _translationUnit = translationUnit; }
|
||||
|
||||
unsigned ASTVisitor::tokenCount() const
|
||||
int ASTVisitor::tokenCount() const
|
||||
{ return translationUnit()->tokenCount(); }
|
||||
|
||||
const Token &ASTVisitor::tokenAt(unsigned index) const
|
||||
const Token &ASTVisitor::tokenAt(int index) const
|
||||
{ return translationUnit()->tokenAt(index); }
|
||||
|
||||
int ASTVisitor::tokenKind(unsigned index) const
|
||||
int ASTVisitor::tokenKind(int index) const
|
||||
{ return translationUnit()->tokenKind(index); }
|
||||
|
||||
const char *ASTVisitor::spell(unsigned index) const
|
||||
const char *ASTVisitor::spell(int index) const
|
||||
{ return translationUnit()->spell(index); }
|
||||
|
||||
const Identifier *ASTVisitor::identifier(unsigned index) const
|
||||
const Identifier *ASTVisitor::identifier(int index) const
|
||||
{ return translationUnit()->identifier(index); }
|
||||
|
||||
const Literal *ASTVisitor::literal(unsigned index) const
|
||||
const Literal *ASTVisitor::literal(int index) const
|
||||
{ return translationUnit()->literal(index); }
|
||||
|
||||
const NumericLiteral *ASTVisitor::numericLiteral(unsigned index) const
|
||||
const NumericLiteral *ASTVisitor::numericLiteral(int index) const
|
||||
{ return translationUnit()->numericLiteral(index); }
|
||||
|
||||
const StringLiteral *ASTVisitor::stringLiteral(unsigned index) const
|
||||
const StringLiteral *ASTVisitor::stringLiteral(int index) const
|
||||
{ return translationUnit()->stringLiteral(index); }
|
||||
|
||||
void ASTVisitor::getPosition(unsigned offset,
|
||||
unsigned *line,
|
||||
unsigned *column,
|
||||
void ASTVisitor::getPosition(int offset, int *line, int *column,
|
||||
const StringLiteral **fileName) const
|
||||
{ translationUnit()->getPosition(offset, line, column, fileName); }
|
||||
|
||||
void ASTVisitor::getTokenPosition(unsigned index,
|
||||
unsigned *line,
|
||||
unsigned *column,
|
||||
void ASTVisitor::getTokenPosition(int index, int *line, int *column,
|
||||
const StringLiteral **fileName) const
|
||||
{ translationUnit()->getTokenPosition(index, line, column, fileName); }
|
||||
|
||||
void ASTVisitor::getTokenStartPosition(unsigned index, unsigned *line, unsigned *column) const
|
||||
void ASTVisitor::getTokenStartPosition(int index, int *line, int *column) const
|
||||
{ getPosition(tokenAt(index).utf16charsBegin(), line, column); }
|
||||
|
||||
void ASTVisitor::getTokenEndPosition(unsigned index, unsigned *line, unsigned *column) const
|
||||
void ASTVisitor::getTokenEndPosition(int index, int *line, int *column) const
|
||||
{ getPosition(tokenAt(index).utf16charsEnd(), line, column); }
|
||||
|
36
src/libs/3rdparty/cplusplus/ASTVisitor.h
vendored
36
src/libs/3rdparty/cplusplus/ASTVisitor.h
vendored
@@ -38,27 +38,27 @@ public:
|
||||
void setTranslationUnit(TranslationUnit *translationUnit);
|
||||
|
||||
Control *control() const;
|
||||
unsigned tokenCount() const;
|
||||
const Token &tokenAt(unsigned index) const;
|
||||
int tokenKind(unsigned index) const;
|
||||
const char *spell(unsigned index) const;
|
||||
const Identifier *identifier(unsigned index) const;
|
||||
const Literal *literal(unsigned index) const;
|
||||
const NumericLiteral *numericLiteral(unsigned index) const;
|
||||
const StringLiteral *stringLiteral(unsigned index) const;
|
||||
int tokenCount() const;
|
||||
const Token &tokenAt(int index) const;
|
||||
int tokenKind(int index) const;
|
||||
const char *spell(int index) const;
|
||||
const Identifier *identifier(int index) const;
|
||||
const Literal *literal(int index) const;
|
||||
const NumericLiteral *numericLiteral(int index) const;
|
||||
const StringLiteral *stringLiteral(int index) const;
|
||||
|
||||
void getPosition(unsigned offset,
|
||||
unsigned *line,
|
||||
unsigned *column = 0,
|
||||
const StringLiteral **fileName = 0) const;
|
||||
void getPosition(int offset,
|
||||
int *line,
|
||||
int *column = nullptr,
|
||||
const StringLiteral **fileName = nullptr) const;
|
||||
|
||||
void getTokenPosition(unsigned index,
|
||||
unsigned *line,
|
||||
unsigned *column = 0,
|
||||
const StringLiteral **fileName = 0) const;
|
||||
void getTokenPosition(int index,
|
||||
int *line,
|
||||
int *column = nullptr,
|
||||
const StringLiteral **fileName = nullptr) const;
|
||||
|
||||
void getTokenStartPosition(unsigned index, unsigned *line, unsigned *column) const;
|
||||
void getTokenEndPosition(unsigned index, unsigned *line, unsigned *column) const;
|
||||
void getTokenStartPosition(int index, int *line, int *column) const;
|
||||
void getTokenEndPosition(int index, int *line, int *column) const;
|
||||
|
||||
void accept(AST *ast);
|
||||
|
||||
|
478
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
478
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
File diff suppressed because it is too large
Load Diff
16
src/libs/3rdparty/cplusplus/Bind.h
vendored
16
src/libs/3rdparty/cplusplus/Bind.h
vendored
@@ -43,9 +43,9 @@ public:
|
||||
protected:
|
||||
using ASTVisitor::translationUnit;
|
||||
|
||||
unsigned location(DeclaratorAST *ast, unsigned defaultLocation) const;
|
||||
unsigned location(CoreDeclaratorAST *ast, unsigned defaultLocation) const;
|
||||
unsigned location(NameAST *name, unsigned defaultLocation) const;
|
||||
int location(DeclaratorAST *ast, int defaultLocation) const;
|
||||
int location(CoreDeclaratorAST *ast, int defaultLocation) const;
|
||||
int location(NameAST *name, int defaultLocation) const;
|
||||
|
||||
static int visibilityForAccessSpecifier(int tokenKind);
|
||||
static int visibilityForClassKey(int tokenKind);
|
||||
@@ -72,14 +72,14 @@ protected:
|
||||
int switchMethodKey(int methodKey);
|
||||
int switchObjCVisibility(int visibility);
|
||||
|
||||
unsigned calculateScopeStart(ObjCClassDeclarationAST *ast) const;
|
||||
unsigned calculateScopeStart(ObjCProtocolDeclarationAST *ast) const;
|
||||
int calculateScopeStart(ObjCClassDeclarationAST *ast) const;
|
||||
int calculateScopeStart(ObjCProtocolDeclarationAST *ast) const;
|
||||
|
||||
const Name *objCSelectorArgument(ObjCSelectorArgumentAST *ast, bool *hasArg);
|
||||
void attribute(GnuAttributeAST *ast);
|
||||
FullySpecifiedType declarator(DeclaratorAST *ast, const FullySpecifiedType &init, DeclaratorIdAST **declaratorId);
|
||||
void qtInterfaceName(QtInterfaceNameAST *ast);
|
||||
void baseSpecifier(BaseSpecifierAST *ast, unsigned colon_token, Class *klass);
|
||||
void baseSpecifier(BaseSpecifierAST *ast, int colon_token, Class *klass);
|
||||
void ctorInitializer(CtorInitializerAST *ast, Function *fun);
|
||||
void enumerator(EnumeratorAST *ast, Enum *symbol);
|
||||
FullySpecifiedType exceptionSpecification(ExceptionSpecificationAST *ast, const FullySpecifiedType &init);
|
||||
@@ -89,7 +89,7 @@ protected:
|
||||
FullySpecifiedType newArrayDeclarator(NewArrayDeclaratorAST *ast, const FullySpecifiedType &init);
|
||||
FullySpecifiedType newTypeId(NewTypeIdAST *ast);
|
||||
OperatorNameId::Kind cppOperator(OperatorAST *ast);
|
||||
void parameterDeclarationClause(ParameterDeclarationClauseAST *ast, unsigned lparen_token, Function *fun);
|
||||
void parameterDeclarationClause(ParameterDeclarationClauseAST *ast, int lparen_token, Function *fun);
|
||||
void translationUnit(TranslationUnitAST *ast);
|
||||
void objCProtocolRefs(ObjCProtocolRefsAST *ast, Symbol *objcClassOrProtocol);
|
||||
void objCMessageArgument(ObjCMessageArgumentAST *ast);
|
||||
@@ -282,7 +282,7 @@ protected:
|
||||
private:
|
||||
static const int kMaxDepth;
|
||||
|
||||
void ensureValidClassName(const Name **name, unsigned sourceLocation);
|
||||
void ensureValidClassName(const Name **name, int sourceLocation);
|
||||
|
||||
Scope *_scope;
|
||||
ExpressionTy _expression;
|
||||
|
72
src/libs/3rdparty/cplusplus/Control.cpp
vendored
72
src/libs/3rdparty/cplusplus/Control.cpp
vendored
@@ -579,15 +579,15 @@ const OperatorNameId *Control::findOperatorNameId(OperatorNameId::Kind operatorI
|
||||
return &*i;
|
||||
}
|
||||
|
||||
const Identifier *Control::findIdentifier(const char *chars, unsigned size) const
|
||||
const Identifier *Control::findIdentifier(const char *chars, int size) const
|
||||
{ return d->identifiers.findLiteral(chars, size); }
|
||||
|
||||
const Identifier *Control::identifier(const char *chars, unsigned size)
|
||||
const Identifier *Control::identifier(const char *chars, int size)
|
||||
{ return d->identifiers.findOrInsertLiteral(chars, size); }
|
||||
|
||||
const Identifier *Control::identifier(const char *chars)
|
||||
{
|
||||
const unsigned length = unsigned(std::strlen(chars));
|
||||
const int length = int(std::strlen(chars));
|
||||
return identifier(chars, length);
|
||||
}
|
||||
|
||||
@@ -609,28 +609,28 @@ Control::NumericLiteralIterator Control::firstNumericLiteral() const
|
||||
Control::NumericLiteralIterator Control::lastNumericLiteral() const
|
||||
{ return d->numericLiterals.end(); }
|
||||
|
||||
const StringLiteral *Control::stringLiteral(const char *chars, unsigned size)
|
||||
const StringLiteral *Control::stringLiteral(const char *chars, int size)
|
||||
{ return d->stringLiterals.findOrInsertLiteral(chars, size); }
|
||||
|
||||
const StringLiteral *Control::stringLiteral(const char *chars)
|
||||
{
|
||||
const unsigned length = unsigned(std::strlen(chars));
|
||||
const int length = int(std::strlen(chars));
|
||||
return stringLiteral(chars, length);
|
||||
}
|
||||
|
||||
const NumericLiteral *Control::numericLiteral(const char *chars, unsigned size)
|
||||
const NumericLiteral *Control::numericLiteral(const char *chars, int size)
|
||||
{ return d->numericLiterals.findOrInsertLiteral(chars, size); }
|
||||
|
||||
const NumericLiteral *Control::numericLiteral(const char *chars)
|
||||
{
|
||||
const unsigned length = unsigned(std::strlen(chars));
|
||||
const int length = int(std::strlen(chars));
|
||||
return numericLiteral(chars, length);
|
||||
}
|
||||
|
||||
const TemplateNameId *Control::templateNameId(const Identifier *id,
|
||||
bool isSpecialization,
|
||||
const FullySpecifiedType *const args,
|
||||
unsigned argv)
|
||||
int argv)
|
||||
{
|
||||
return d->findOrInsertTemplateNameId(id, isSpecialization, args, args + argv);
|
||||
}
|
||||
@@ -650,7 +650,7 @@ const QualifiedNameId *Control::qualifiedNameId(const Name *base, const Name *na
|
||||
}
|
||||
|
||||
const SelectorNameId *Control::selectorNameId(const Name *const *names,
|
||||
unsigned nameCount,
|
||||
int nameCount,
|
||||
bool hasArguments)
|
||||
{
|
||||
return d->findOrInsertSelectorNameId(names, names + nameCount, hasArguments);
|
||||
@@ -675,88 +675,88 @@ PointerType *Control::pointerType(const FullySpecifiedType &elementType)
|
||||
ReferenceType *Control::referenceType(const FullySpecifiedType &elementType, bool rvalueRef)
|
||||
{ return d->findOrInsertReferenceType(elementType, rvalueRef); }
|
||||
|
||||
ArrayType *Control::arrayType(const FullySpecifiedType &elementType, unsigned size)
|
||||
ArrayType *Control::arrayType(const FullySpecifiedType &elementType, int size)
|
||||
{ return d->findOrInsertArrayType(elementType, size); }
|
||||
|
||||
NamedType *Control::namedType(const Name *name)
|
||||
{ return d->findOrInsertNamedType(name); }
|
||||
|
||||
Argument *Control::newArgument(unsigned sourceLocation, const Name *name)
|
||||
Argument *Control::newArgument(int sourceLocation, const Name *name)
|
||||
{ return d->newArgument(sourceLocation, name); }
|
||||
|
||||
TypenameArgument *Control::newTypenameArgument(unsigned sourceLocation, const Name *name)
|
||||
TypenameArgument *Control::newTypenameArgument(int sourceLocation, const Name *name)
|
||||
{ return d->newTypenameArgument(sourceLocation, name); }
|
||||
|
||||
Function *Control::newFunction(unsigned sourceLocation, const Name *name)
|
||||
Function *Control::newFunction(int sourceLocation, const Name *name)
|
||||
{ return d->newFunction(sourceLocation, name); }
|
||||
|
||||
Namespace *Control::newNamespace(unsigned sourceLocation, const Name *name)
|
||||
Namespace *Control::newNamespace(int sourceLocation, const Name *name)
|
||||
{ return d->newNamespace(sourceLocation, name); }
|
||||
|
||||
Template *Control::newTemplate(unsigned sourceLocation, const Name *name)
|
||||
Template *Control::newTemplate(int sourceLocation, const Name *name)
|
||||
{ return d->newTemplate(sourceLocation, name); }
|
||||
|
||||
NamespaceAlias *Control::newNamespaceAlias(unsigned sourceLocation, const Name *name)
|
||||
NamespaceAlias *Control::newNamespaceAlias(int sourceLocation, const Name *name)
|
||||
{ return d->newNamespaceAlias(sourceLocation, name); }
|
||||
|
||||
BaseClass *Control::newBaseClass(unsigned sourceLocation, const Name *name)
|
||||
BaseClass *Control::newBaseClass(int sourceLocation, const Name *name)
|
||||
{ return d->newBaseClass(sourceLocation, name); }
|
||||
|
||||
Class *Control::newClass(unsigned sourceLocation, const Name *name)
|
||||
Class *Control::newClass(int sourceLocation, const Name *name)
|
||||
{ return d->newClass(sourceLocation, name); }
|
||||
|
||||
Enum *Control::newEnum(unsigned sourceLocation, const Name *name)
|
||||
Enum *Control::newEnum(int sourceLocation, const Name *name)
|
||||
{ return d->newEnum(sourceLocation, name); }
|
||||
|
||||
Block *Control::newBlock(unsigned sourceLocation)
|
||||
Block *Control::newBlock(int sourceLocation)
|
||||
{ return d->newBlock(sourceLocation); }
|
||||
|
||||
Declaration *Control::newDeclaration(unsigned sourceLocation, const Name *name)
|
||||
Declaration *Control::newDeclaration(int sourceLocation, const Name *name)
|
||||
{ return d->newDeclaration(sourceLocation, name); }
|
||||
|
||||
EnumeratorDeclaration *Control::newEnumeratorDeclaration(unsigned sourceLocation, const Name *name)
|
||||
EnumeratorDeclaration *Control::newEnumeratorDeclaration(int sourceLocation, const Name *name)
|
||||
{ return d->newEnumeratorDeclaration(sourceLocation, name); }
|
||||
|
||||
UsingNamespaceDirective *Control::newUsingNamespaceDirective(unsigned sourceLocation,
|
||||
UsingNamespaceDirective *Control::newUsingNamespaceDirective(int sourceLocation,
|
||||
const Name *name)
|
||||
{ return d->newUsingNamespaceDirective(sourceLocation, name); }
|
||||
|
||||
UsingDeclaration *Control::newUsingDeclaration(unsigned sourceLocation, const Name *name)
|
||||
UsingDeclaration *Control::newUsingDeclaration(int sourceLocation, const Name *name)
|
||||
{ return d->newUsingDeclaration(sourceLocation, name); }
|
||||
|
||||
ForwardClassDeclaration *Control::newForwardClassDeclaration(unsigned sourceLocation,
|
||||
ForwardClassDeclaration *Control::newForwardClassDeclaration(int sourceLocation,
|
||||
const Name *name)
|
||||
{ return d->newForwardClassDeclaration(sourceLocation, name); }
|
||||
|
||||
QtPropertyDeclaration *Control::newQtPropertyDeclaration(unsigned sourceLocation,
|
||||
QtPropertyDeclaration *Control::newQtPropertyDeclaration(int sourceLocation,
|
||||
const Name *name)
|
||||
{ return d->newQtPropertyDeclaration(sourceLocation, name); }
|
||||
|
||||
QtEnum *Control::newQtEnum(unsigned sourceLocation, const Name *name)
|
||||
QtEnum *Control::newQtEnum(int sourceLocation, const Name *name)
|
||||
{ return d->newQtEnum(sourceLocation, name); }
|
||||
|
||||
ObjCBaseClass *Control::newObjCBaseClass(unsigned sourceLocation, const Name *name)
|
||||
ObjCBaseClass *Control::newObjCBaseClass(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCBaseClass(sourceLocation, name); }
|
||||
|
||||
ObjCBaseProtocol *Control::newObjCBaseProtocol(unsigned sourceLocation, const Name *name)
|
||||
ObjCBaseProtocol *Control::newObjCBaseProtocol(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCBaseProtocol(sourceLocation, name); }
|
||||
|
||||
ObjCClass *Control::newObjCClass(unsigned sourceLocation, const Name *name)
|
||||
ObjCClass *Control::newObjCClass(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCClass(sourceLocation, name); }
|
||||
|
||||
ObjCForwardClassDeclaration *Control::newObjCForwardClassDeclaration(unsigned sourceLocation, const Name *name)
|
||||
ObjCForwardClassDeclaration *Control::newObjCForwardClassDeclaration(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCForwardClassDeclaration(sourceLocation, name); }
|
||||
|
||||
ObjCProtocol *Control::newObjCProtocol(unsigned sourceLocation, const Name *name)
|
||||
ObjCProtocol *Control::newObjCProtocol(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCProtocol(sourceLocation, name); }
|
||||
|
||||
ObjCForwardProtocolDeclaration *Control::newObjCForwardProtocolDeclaration(unsigned sourceLocation, const Name *name)
|
||||
ObjCForwardProtocolDeclaration *Control::newObjCForwardProtocolDeclaration(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCForwardProtocolDeclaration(sourceLocation, name); }
|
||||
|
||||
ObjCMethod *Control::newObjCMethod(unsigned sourceLocation, const Name *name)
|
||||
ObjCMethod *Control::newObjCMethod(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCMethod(sourceLocation, name); }
|
||||
|
||||
ObjCPropertyDeclaration *Control::newObjCPropertyDeclaration(unsigned sourceLocation, const Name *name)
|
||||
ObjCPropertyDeclaration *Control::newObjCPropertyDeclaration(int sourceLocation, const Name *name)
|
||||
{ return d->newObjCPropertyDeclaration(sourceLocation, name); }
|
||||
|
||||
const Identifier *Control::deprecatedId() const
|
||||
@@ -811,7 +811,7 @@ Symbol **Control::lastSymbol() const
|
||||
return &*d->symbols.begin() + d->symbols.size();
|
||||
}
|
||||
|
||||
unsigned Control::symbolCount() const
|
||||
int Control::symbolCount() const
|
||||
{
|
||||
return unsigned(d->symbols.size());
|
||||
}
|
||||
|
66
src/libs/3rdparty/cplusplus/Control.h
vendored
66
src/libs/3rdparty/cplusplus/Control.h
vendored
@@ -55,7 +55,7 @@ public:
|
||||
const TemplateNameId *templateNameId(const Identifier *id,
|
||||
bool isSpecialization,
|
||||
const FullySpecifiedType *const args = 0,
|
||||
unsigned argc = 0);
|
||||
int argc = 0);
|
||||
|
||||
/// Returns the canonical destructor name id.
|
||||
const DestructorNameId *destructorNameId(const Name *name);
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
const QualifiedNameId *qualifiedNameId(const Name *base, const Name *name);
|
||||
|
||||
const SelectorNameId *selectorNameId(const Name *const *names,
|
||||
unsigned nameCount,
|
||||
int nameCount,
|
||||
bool hasArguments);
|
||||
|
||||
/// Returns a Type object of type VoidType.
|
||||
@@ -93,82 +93,82 @@ public:
|
||||
ReferenceType *referenceType(const FullySpecifiedType &elementType, bool rvalueRef);
|
||||
|
||||
/// Retruns a Type object of type ArrayType.
|
||||
ArrayType *arrayType(const FullySpecifiedType &elementType, unsigned size = 0);
|
||||
ArrayType *arrayType(const FullySpecifiedType &elementType, int size = 0);
|
||||
|
||||
/// Returns a Type object of type NamedType.
|
||||
NamedType *namedType(const Name *name);
|
||||
|
||||
/// Creates a new Declaration symbol.
|
||||
Declaration *newDeclaration(unsigned sourceLocation, const Name *name);
|
||||
Declaration *newDeclaration(int sourceLocation, const Name *name);
|
||||
|
||||
/// Creates a new EnumeratorDeclaration symbol.
|
||||
EnumeratorDeclaration *newEnumeratorDeclaration(unsigned sourceLocation, const Name *name);
|
||||
EnumeratorDeclaration *newEnumeratorDeclaration(int sourceLocation, const Name *name);
|
||||
|
||||
/// Creates a new Argument symbol.
|
||||
Argument *newArgument(unsigned sourceLocation, const Name *name = 0);
|
||||
Argument *newArgument(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Argument symbol.
|
||||
TypenameArgument *newTypenameArgument(unsigned sourceLocation, const Name *name = 0);
|
||||
TypenameArgument *newTypenameArgument(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Function symbol.
|
||||
Function *newFunction(unsigned sourceLocation, const Name *name = 0);
|
||||
Function *newFunction(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Namespace symbol.
|
||||
Namespace *newNamespace(unsigned sourceLocation, const Name *name = 0);
|
||||
Namespace *newNamespace(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Template symbol.
|
||||
Template *newTemplate(unsigned sourceLocation, const Name *name = 0);
|
||||
Template *newTemplate(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Namespace symbol.
|
||||
NamespaceAlias *newNamespaceAlias(unsigned sourceLocation, const Name *name = 0);
|
||||
NamespaceAlias *newNamespaceAlias(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new BaseClass symbol.
|
||||
BaseClass *newBaseClass(unsigned sourceLocation, const Name *name = 0);
|
||||
BaseClass *newBaseClass(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Class symbol.
|
||||
Class *newClass(unsigned sourceLocation, const Name *name = 0);
|
||||
Class *newClass(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Enum symbol.
|
||||
Enum *newEnum(unsigned sourceLocation, const Name *name = 0);
|
||||
Enum *newEnum(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Block symbol.
|
||||
Block *newBlock(unsigned sourceLocation);
|
||||
Block *newBlock(int sourceLocation);
|
||||
|
||||
/// Creates a new UsingNamespaceDirective symbol.
|
||||
UsingNamespaceDirective *newUsingNamespaceDirective(unsigned sourceLocation, const Name *name = 0);
|
||||
UsingNamespaceDirective *newUsingNamespaceDirective(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new UsingDeclaration symbol.
|
||||
UsingDeclaration *newUsingDeclaration(unsigned sourceLocation, const Name *name = 0);
|
||||
UsingDeclaration *newUsingDeclaration(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new ForwardClassDeclaration symbol.
|
||||
ForwardClassDeclaration *newForwardClassDeclaration(unsigned sourceLocation, const Name *name = 0);
|
||||
ForwardClassDeclaration *newForwardClassDeclaration(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new QtPropertyDeclaration symbol.
|
||||
QtPropertyDeclaration *newQtPropertyDeclaration(unsigned sourceLocation, const Name *name = 0);
|
||||
QtPropertyDeclaration *newQtPropertyDeclaration(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new QtEnum symbol.
|
||||
QtEnum *newQtEnum(unsigned sourceLocation, const Name *name = 0);
|
||||
QtEnum *newQtEnum(int sourceLocation, const Name *name = 0);
|
||||
|
||||
ObjCBaseClass *newObjCBaseClass(unsigned sourceLocation, const Name *name);
|
||||
ObjCBaseProtocol *newObjCBaseProtocol(unsigned sourceLocation, const Name *name);
|
||||
ObjCBaseClass *newObjCBaseClass(int sourceLocation, const Name *name);
|
||||
ObjCBaseProtocol *newObjCBaseProtocol(int sourceLocation, const Name *name);
|
||||
|
||||
/// Creates a new Objective-C class symbol.
|
||||
ObjCClass *newObjCClass(unsigned sourceLocation, const Name *name = 0);
|
||||
ObjCClass *newObjCClass(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Objective-C class forward declaration symbol.
|
||||
ObjCForwardClassDeclaration *newObjCForwardClassDeclaration(unsigned sourceLocation, const Name *name = 0);
|
||||
ObjCForwardClassDeclaration *newObjCForwardClassDeclaration(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Objective-C protocol symbol.
|
||||
ObjCProtocol *newObjCProtocol(unsigned sourceLocation, const Name *name = 0);
|
||||
ObjCProtocol *newObjCProtocol(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Objective-C protocol forward declaration symbol.
|
||||
ObjCForwardProtocolDeclaration *newObjCForwardProtocolDeclaration(unsigned sourceLocation, const Name *name = 0);
|
||||
ObjCForwardProtocolDeclaration *newObjCForwardProtocolDeclaration(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Objective-C method symbol.
|
||||
ObjCMethod *newObjCMethod(unsigned sourceLocation, const Name *name = 0);
|
||||
ObjCMethod *newObjCMethod(int sourceLocation, const Name *name = 0);
|
||||
|
||||
/// Creates a new Objective-C @property declaration symbol.
|
||||
ObjCPropertyDeclaration *newObjCPropertyDeclaration(unsigned sourceLocation, const Name *name);
|
||||
ObjCPropertyDeclaration *newObjCPropertyDeclaration(int sourceLocation, const Name *name);
|
||||
|
||||
const Identifier *deprecatedId() const;
|
||||
const Identifier *unavailableId() const;
|
||||
@@ -187,8 +187,8 @@ public:
|
||||
|
||||
const OperatorNameId *findOperatorNameId(OperatorNameId::Kind operatorId) const;
|
||||
|
||||
const Identifier *findIdentifier(const char *chars, unsigned size) const;
|
||||
const Identifier *identifier(const char *chars, unsigned size);
|
||||
const Identifier *findIdentifier(const char *chars, int size) const;
|
||||
const Identifier *identifier(const char *chars, int size);
|
||||
const Identifier *identifier(const char *chars);
|
||||
|
||||
typedef const Identifier *const *IdentifierIterator;
|
||||
@@ -204,15 +204,15 @@ public:
|
||||
NumericLiteralIterator firstNumericLiteral() const;
|
||||
NumericLiteralIterator lastNumericLiteral() const;
|
||||
|
||||
const StringLiteral *stringLiteral(const char *chars, unsigned size);
|
||||
const StringLiteral *stringLiteral(const char *chars, int size);
|
||||
const StringLiteral *stringLiteral(const char *chars);
|
||||
|
||||
const NumericLiteral *numericLiteral(const char *chars, unsigned size);
|
||||
const NumericLiteral *numericLiteral(const char *chars, int size);
|
||||
const NumericLiteral *numericLiteral(const char *chars);
|
||||
|
||||
Symbol **firstSymbol() const;
|
||||
Symbol **lastSymbol() const;
|
||||
unsigned symbolCount() const;
|
||||
int symbolCount() const;
|
||||
|
||||
bool hasSymbol(Symbol *symbol) const;
|
||||
void addSymbol(Symbol *symbol);
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
virtual void report(int level,
|
||||
const StringLiteral *fileName,
|
||||
unsigned line, unsigned column,
|
||||
int line, int column,
|
||||
const char *format, va_list ap) = 0;
|
||||
};
|
||||
|
||||
|
8
src/libs/3rdparty/cplusplus/LiteralTable.h
vendored
8
src/libs/3rdparty/cplusplus/LiteralTable.h
vendored
@@ -69,10 +69,10 @@ public:
|
||||
bool empty() const
|
||||
{ return _literalCount == -1; }
|
||||
|
||||
unsigned size() const
|
||||
int size() const
|
||||
{ return _literalCount + 1; }
|
||||
|
||||
const Literal *at(unsigned index) const
|
||||
const Literal *at(int index) const
|
||||
{ return _literals[index]; }
|
||||
|
||||
iterator begin() const
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
iterator end() const
|
||||
{ return _literals + _literalCount + 1; }
|
||||
|
||||
const Literal *findLiteral(const char *chars, unsigned size) const
|
||||
const Literal *findLiteral(const char *chars, int size) const
|
||||
{
|
||||
if (_buckets) {
|
||||
unsigned h = Literal::hashCode(chars, size);
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
const Literal *findOrInsertLiteral(const char *chars, unsigned size)
|
||||
const Literal *findOrInsertLiteral(const char *chars, int size)
|
||||
{
|
||||
if (_buckets) {
|
||||
unsigned h = Literal::hashCode(chars, size);
|
||||
|
4
src/libs/3rdparty/cplusplus/Literals.cpp
vendored
4
src/libs/3rdparty/cplusplus/Literals.cpp
vendored
@@ -28,7 +28,7 @@
|
||||
using namespace CPlusPlus;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Literal::Literal(const char *chars, unsigned size)
|
||||
Literal::Literal(const char *chars, int size)
|
||||
: _next(0), _index(0)
|
||||
{
|
||||
_chars = new char[size + 1];
|
||||
@@ -79,7 +79,7 @@ unsigned Literal::hashCode(const char *chars, unsigned size)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
NumericLiteral::NumericLiteral(const char *chars, unsigned size)
|
||||
NumericLiteral::NumericLiteral(const char *chars, int size)
|
||||
: Literal(chars, size), _flags(0)
|
||||
{
|
||||
f._type = NumericLiteralIsInt;
|
||||
|
10
src/libs/3rdparty/cplusplus/Literals.h
vendored
10
src/libs/3rdparty/cplusplus/Literals.h
vendored
@@ -36,15 +36,15 @@ public:
|
||||
typedef iterator const_iterator;
|
||||
|
||||
public:
|
||||
Literal(const char *chars, unsigned size);
|
||||
Literal(const char *chars, int size);
|
||||
virtual ~Literal();
|
||||
|
||||
iterator begin() const { return _chars; }
|
||||
iterator end() const { return _chars + _size; }
|
||||
|
||||
char at(unsigned index) const { return _chars[index]; }
|
||||
char at(int index) const { return _chars[index]; }
|
||||
const char *chars() const { return _chars; }
|
||||
unsigned size() const { return _size; }
|
||||
int size() const { return _size; }
|
||||
|
||||
unsigned hashCode() const { return _hashCode; }
|
||||
static unsigned hashCode(const char *chars, unsigned size);
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
class CPLUSPLUS_EXPORT NumericLiteral: public Literal
|
||||
{
|
||||
public:
|
||||
NumericLiteral(const char *chars, unsigned size);
|
||||
NumericLiteral(const char *chars, int size);
|
||||
|
||||
enum {
|
||||
NumericLiteralIsInt,
|
||||
@@ -108,7 +108,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT Identifier: public Literal, public Name
|
||||
{
|
||||
public:
|
||||
Identifier(const char *chars, unsigned size)
|
||||
Identifier(const char *chars, int size)
|
||||
: Literal(chars, size)
|
||||
{ }
|
||||
|
||||
|
6
src/libs/3rdparty/cplusplus/Matcher.cpp
vendored
6
src/libs/3rdparty/cplusplus/Matcher.cpp
vendored
@@ -293,7 +293,7 @@ bool Matcher::match(const ObjCMethod *type, const ObjCMethod *otherType)
|
||||
else if (! type->returnType().match(otherType->returnType(), this))
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < type->argumentCount(); ++i) {
|
||||
for (int i = 0; i < type->argumentCount(); ++i) {
|
||||
Symbol *l = type->argumentAt(i);
|
||||
Symbol *r = otherType->argumentAt(i);
|
||||
if (! l->type().match(r->type(), this))
|
||||
@@ -356,10 +356,10 @@ bool Matcher::match(const QualifiedNameId *name, const QualifiedNameId *otherNam
|
||||
|
||||
bool Matcher::match(const SelectorNameId *name, const SelectorNameId *otherName)
|
||||
{
|
||||
const unsigned nc = name->nameCount();
|
||||
const int nc = name->nameCount();
|
||||
if (name->hasArguments() != otherName->hasArguments() || nc != otherName->nameCount())
|
||||
return false;
|
||||
for (unsigned i = 0; i < nc; ++i)
|
||||
for (int i = 0; i < nc; ++i)
|
||||
if (! Matcher::match(name->nameAt(i), otherName->nameAt(i), this))
|
||||
return false;
|
||||
return true;
|
||||
|
16
src/libs/3rdparty/cplusplus/Names.cpp
vendored
16
src/libs/3rdparty/cplusplus/Names.cpp
vendored
@@ -93,10 +93,10 @@ bool TemplateNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
const Identifier *TemplateNameId::identifier() const
|
||||
{ return _identifier; }
|
||||
|
||||
unsigned TemplateNameId::templateArgumentCount() const
|
||||
{ return unsigned(_templateArguments.size()); }
|
||||
int TemplateNameId::templateArgumentCount() const
|
||||
{ return int(_templateArguments.size()); }
|
||||
|
||||
const FullySpecifiedType &TemplateNameId::templateArgumentAt(unsigned index) const
|
||||
const FullySpecifiedType &TemplateNameId::templateArgumentAt(int index) const
|
||||
{ return _templateArguments[index]; }
|
||||
|
||||
bool TemplateNameId::Compare::operator()(const TemplateNameId *name,
|
||||
@@ -200,23 +200,23 @@ const Identifier *SelectorNameId::identifier() const
|
||||
return nameAt(0)->identifier();
|
||||
}
|
||||
|
||||
unsigned SelectorNameId::nameCount() const
|
||||
{ return unsigned(_names.size()); }
|
||||
int SelectorNameId::nameCount() const
|
||||
{ return int(_names.size()); }
|
||||
|
||||
const Name *SelectorNameId::nameAt(unsigned index) const
|
||||
const Name *SelectorNameId::nameAt(int index) const
|
||||
{ return _names[index]; }
|
||||
|
||||
bool SelectorNameId::hasArguments() const
|
||||
{ return _hasArguments; }
|
||||
|
||||
AnonymousNameId::AnonymousNameId(unsigned classTokenIndex)
|
||||
AnonymousNameId::AnonymousNameId(int classTokenIndex)
|
||||
: _classTokenIndex(classTokenIndex)
|
||||
{ }
|
||||
|
||||
AnonymousNameId::~AnonymousNameId()
|
||||
{ }
|
||||
|
||||
unsigned AnonymousNameId::classTokenIndex() const
|
||||
int AnonymousNameId::classTokenIndex() const
|
||||
{
|
||||
return _classTokenIndex;
|
||||
}
|
||||
|
14
src/libs/3rdparty/cplusplus/Names.h
vendored
14
src/libs/3rdparty/cplusplus/Names.h
vendored
@@ -88,8 +88,8 @@ public:
|
||||
virtual const Identifier *identifier() const;
|
||||
|
||||
// ### find a better name
|
||||
unsigned templateArgumentCount() const;
|
||||
const FullySpecifiedType &templateArgumentAt(unsigned index) const;
|
||||
int templateArgumentCount() const;
|
||||
const FullySpecifiedType &templateArgumentAt(int index) const;
|
||||
|
||||
virtual const TemplateNameId *asTemplateNameId() const
|
||||
{ return this; }
|
||||
@@ -224,8 +224,8 @@ public:
|
||||
|
||||
virtual const Identifier *identifier() const;
|
||||
|
||||
unsigned nameCount() const;
|
||||
const Name *nameAt(unsigned index) const;
|
||||
int nameCount() const;
|
||||
const Name *nameAt(int index) const;
|
||||
bool hasArguments() const;
|
||||
|
||||
virtual const SelectorNameId *asSelectorNameId() const
|
||||
@@ -248,10 +248,10 @@ private:
|
||||
class CPLUSPLUS_EXPORT AnonymousNameId: public Name
|
||||
{
|
||||
public:
|
||||
AnonymousNameId(unsigned classTokenIndex);
|
||||
AnonymousNameId(int classTokenIndex);
|
||||
virtual ~AnonymousNameId();
|
||||
|
||||
unsigned classTokenIndex() const;
|
||||
int classTokenIndex() const;
|
||||
|
||||
virtual const Identifier *identifier() const;
|
||||
|
||||
@@ -263,7 +263,7 @@ protected:
|
||||
virtual bool match0(const Name *otherName, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
unsigned _classTokenIndex;
|
||||
int _classTokenIndex;
|
||||
};
|
||||
|
||||
|
||||
|
310
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
310
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
File diff suppressed because it is too large
Load Diff
38
src/libs/3rdparty/cplusplus/Parser.h
vendored
38
src/libs/3rdparty/cplusplus/Parser.h
vendored
@@ -72,7 +72,7 @@ public:
|
||||
bool parseConstantExpression(ExpressionAST *&node);
|
||||
bool parseCtorInitializer(CtorInitializerAST *&node);
|
||||
bool parseCvQualifiers(SpecifierListAST *&node);
|
||||
bool parseRefQualifier(unsigned &ref_qualifier);
|
||||
bool parseRefQualifier(int &ref_qualifier);
|
||||
bool parseOverrideFinalQualifiers(SpecifierListAST *&node);
|
||||
bool parseDeclaratorOrAbstractDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list);
|
||||
bool parseDeclaration(DeclarationAST *&node);
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
bool parseInclusiveOrExpression(ExpressionAST *&node);
|
||||
bool parseInitDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass);
|
||||
bool parseInitializerList(ExpressionListAST *&node);
|
||||
bool parseInitializer(ExpressionAST *&node, unsigned *equals_token);
|
||||
bool parseInitializer(ExpressionAST *&node, int *equals_token);
|
||||
bool parseInitializerClause(ExpressionAST *&node);
|
||||
bool parseLabeledStatement(StatementAST *&node);
|
||||
bool parseLinkageBody(DeclarationAST *&node);
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
bool parseMemInitializerList(MemInitializerListAST *&node);
|
||||
bool parseMemberSpecification(DeclarationAST *&node, ClassSpecifierAST *declaringClass);
|
||||
bool parseMultiplicativeExpression(ExpressionAST *&node);
|
||||
bool parseTemplateId(NameAST *&node, unsigned template_token = 0);
|
||||
bool parseTemplateId(NameAST *&node, int template_token = 0);
|
||||
bool parseClassOrNamespaceName(NameAST *&node);
|
||||
bool parseNameId(NameAST *&node);
|
||||
bool parseName(NameAST *&node, bool acceptTemplateId = true);
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
bool parseQtMethod(ExpressionAST *&node);
|
||||
|
||||
// C++0x
|
||||
bool parseInitializer0x(ExpressionAST *&node, unsigned *equals_token);
|
||||
bool parseInitializer0x(ExpressionAST *&node, int *equals_token);
|
||||
bool parseBraceOrEqualInitializer0x(ExpressionAST *&node);
|
||||
bool parseInitializerClause0x(ExpressionAST *&node);
|
||||
bool parseInitializerList0x(ExpressionListAST *&node);
|
||||
@@ -241,11 +241,11 @@ public:
|
||||
bool parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node);
|
||||
bool parseObjCPropertyAttribute(ObjCPropertyAttributeAST *&node);
|
||||
bool parseObjCTypeName(ObjCTypeNameAST *&node);
|
||||
bool parseObjCSelector(unsigned &selector_token);
|
||||
bool parseObjCSelector(int &selector_token);
|
||||
bool parseObjCKeywordDeclaration(ObjCSelectorArgumentAST *&argument, ObjCMessageArgumentDeclarationAST *&node);
|
||||
bool parseObjCTypeQualifiers(unsigned &type_qualifier);
|
||||
bool parseObjCTypeQualifiers(int &type_qualifier);
|
||||
bool peekAtObjCContextKeyword(int kind);
|
||||
bool parseObjCContextKeyword(int kind, unsigned &in_token);
|
||||
bool parseObjCContextKeyword(int kind, int &in_token);
|
||||
|
||||
bool lookAtObjCSelector() const;
|
||||
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
const Identifier *className(ClassSpecifierAST *ast) const;
|
||||
const Identifier *identifier(NameAST *name) const;
|
||||
|
||||
void match(int kind, unsigned *token);
|
||||
void match(int kind, int *token);
|
||||
|
||||
bool maybeAmbiguousStatement(DeclarationStatementAST *ast, StatementAST *&node);
|
||||
bool maybeForwardOrClassDeclaration(SpecifierListAST *decl_specifier_seq) const;
|
||||
@@ -280,9 +280,9 @@ public:
|
||||
bool maybeSplitGreaterGreaterToken(int n = 1);
|
||||
|
||||
bool blockErrors(bool block) { return _translationUnit->blockErrors(block); }
|
||||
void warning(unsigned index, const char *format, ...);
|
||||
void error(unsigned index, const char *format, ...);
|
||||
void fatal(unsigned index, const char *format, ...);
|
||||
void warning(int index, const char *format, ...);
|
||||
void error(int index, const char *format, ...);
|
||||
void fatal(int index, const char *format, ...);
|
||||
|
||||
inline const Token &tok(int i = 1) const
|
||||
{ return _translationUnit->tokenAt(_tokenIndex + i - 1); }
|
||||
@@ -293,21 +293,21 @@ public:
|
||||
inline int consumeToken()
|
||||
{ return _tokenIndex++; }
|
||||
|
||||
inline unsigned cursor() const
|
||||
inline int cursor() const
|
||||
{ return _tokenIndex; }
|
||||
|
||||
void rewind(unsigned cursor);
|
||||
void rewind(int cursor);
|
||||
|
||||
struct TemplateArgumentListEntry {
|
||||
unsigned index;
|
||||
unsigned cursor;
|
||||
int index;
|
||||
int cursor;
|
||||
ExpressionListAST *ast;
|
||||
|
||||
TemplateArgumentListEntry(unsigned index = 0, unsigned cursor = 0, ExpressionListAST *ast = 0)
|
||||
TemplateArgumentListEntry(int index = 0, int cursor = 0, ExpressionListAST *ast = 0)
|
||||
: index(index), cursor(cursor), ast(ast) {}
|
||||
};
|
||||
|
||||
TemplateArgumentListEntry *templateArgumentListEntry(unsigned tokenIndex);
|
||||
TemplateArgumentListEntry *templateArgumentListEntry(int tokenIndex);
|
||||
void clearTemplateArgumentList() { _templateArgumentList.clear(); }
|
||||
|
||||
private:
|
||||
@@ -315,7 +315,7 @@ private:
|
||||
Control *_control;
|
||||
MemoryPool *_pool;
|
||||
LanguageFeatures _languageFeatures;
|
||||
unsigned _tokenIndex;
|
||||
int _tokenIndex;
|
||||
bool _templateArguments: 1;
|
||||
bool _inFunctionBody: 1;
|
||||
bool _inExpressionStatement: 1;
|
||||
@@ -324,7 +324,7 @@ private:
|
||||
std::stack<int> _initializerClauseDepth;
|
||||
|
||||
MemoryPool _expressionStatementTempPool;
|
||||
std::map<unsigned, TemplateArgumentListEntry> _templateArgumentList;
|
||||
std::map<int, TemplateArgumentListEntry> _templateArgumentList;
|
||||
|
||||
class ASTCache;
|
||||
ASTCache *_astCache;
|
||||
|
22
src/libs/3rdparty/cplusplus/Scope.cpp
vendored
22
src/libs/3rdparty/cplusplus/Scope.cpp
vendored
@@ -58,10 +58,10 @@ public:
|
||||
bool isEmpty() const;
|
||||
|
||||
/// Returns the number of symbols is in the scope.
|
||||
unsigned symbolCount() const;
|
||||
int symbolCount() const;
|
||||
|
||||
/// Returns the Symbol at the given position.
|
||||
Symbol *symbolAt(unsigned index) const;
|
||||
Symbol *symbolAt(int index) const;
|
||||
|
||||
/// Returns the first Symbol in the scope.
|
||||
iterator firstSymbol() const;
|
||||
@@ -210,10 +210,10 @@ unsigned SymbolTable::hashValue(Symbol *symbol) const
|
||||
bool SymbolTable::isEmpty() const
|
||||
{ return _symbolCount == -1; }
|
||||
|
||||
unsigned SymbolTable::symbolCount() const
|
||||
int SymbolTable::symbolCount() const
|
||||
{ return _symbolCount + 1; }
|
||||
|
||||
Symbol *SymbolTable::symbolAt(unsigned index) const
|
||||
Symbol *SymbolTable::symbolAt(int index) const
|
||||
{
|
||||
if (! _symbols)
|
||||
return 0;
|
||||
@@ -226,7 +226,7 @@ SymbolTable::iterator SymbolTable::firstSymbol() const
|
||||
SymbolTable::iterator SymbolTable::lastSymbol() const
|
||||
{ return _symbols + _symbolCount + 1; }
|
||||
|
||||
Scope::Scope(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Scope::Scope(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name),
|
||||
_members(0),
|
||||
_startOffset(0),
|
||||
@@ -260,11 +260,11 @@ bool Scope::isEmpty() const
|
||||
{ return _members ? _members->isEmpty() : true; }
|
||||
|
||||
/// Returns the number of symbols is in the scope.
|
||||
unsigned Scope::memberCount() const
|
||||
int Scope::memberCount() const
|
||||
{ return _members ? _members->symbolCount() : 0; }
|
||||
|
||||
/// Returns the Symbol at the given position.
|
||||
Symbol *Scope::memberAt(unsigned index) const
|
||||
Symbol *Scope::memberAt(int index) const
|
||||
{ return _members ? _members->symbolAt(index) : 0; }
|
||||
|
||||
/// Returns the first Symbol in the scope.
|
||||
@@ -282,17 +282,17 @@ Symbol *Scope::find(OperatorNameId::Kind operatorId) const
|
||||
{ return _members ? _members->lookat(operatorId) : 0; }
|
||||
|
||||
/// Set the start offset of the scope
|
||||
unsigned Scope::startOffset() const
|
||||
int Scope::startOffset() const
|
||||
{ return _startOffset; }
|
||||
|
||||
void Scope::setStartOffset(unsigned offset)
|
||||
void Scope::setStartOffset(int offset)
|
||||
{ _startOffset = offset; }
|
||||
|
||||
/// Set the end offset of the scope
|
||||
unsigned Scope::endOffset() const
|
||||
int Scope::endOffset() const
|
||||
{ return _endOffset; }
|
||||
|
||||
void Scope::setEndOffset(unsigned offset)
|
||||
void Scope::setEndOffset(int offset)
|
||||
{ _endOffset = offset; }
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
18
src/libs/3rdparty/cplusplus/Scope.h
vendored
18
src/libs/3rdparty/cplusplus/Scope.h
vendored
@@ -29,7 +29,7 @@ namespace CPlusPlus {
|
||||
class CPLUSPLUS_EXPORT Scope: public Symbol
|
||||
{
|
||||
public:
|
||||
Scope(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Scope(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Scope(Clone *clone, Subst *subst, Scope *original);
|
||||
virtual ~Scope();
|
||||
|
||||
@@ -40,10 +40,10 @@ public:
|
||||
bool isEmpty() const;
|
||||
|
||||
/// Returns the number of symbols is in the scope.
|
||||
unsigned memberCount() const;
|
||||
int memberCount() const;
|
||||
|
||||
/// Returns the Symbol at the given position.
|
||||
Symbol *memberAt(unsigned index) const;
|
||||
Symbol *memberAt(int index) const;
|
||||
|
||||
typedef Symbol **iterator;
|
||||
|
||||
@@ -57,12 +57,12 @@ public:
|
||||
Symbol *find(OperatorNameId::Kind operatorId) const;
|
||||
|
||||
/// Set the start offset of the scope
|
||||
unsigned startOffset() const;
|
||||
void setStartOffset(unsigned offset);
|
||||
int startOffset() const;
|
||||
void setStartOffset(int offset);
|
||||
|
||||
/// Set the end offset of the scope
|
||||
unsigned endOffset() const;
|
||||
void setEndOffset(unsigned offset);
|
||||
int endOffset() const;
|
||||
void setEndOffset(int offset);
|
||||
|
||||
virtual const Scope *asScope() const
|
||||
{ return this; }
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
|
||||
private:
|
||||
SymbolTable *_members;
|
||||
unsigned _startOffset;
|
||||
unsigned _endOffset;
|
||||
int _startOffset;
|
||||
int _endOffset;
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
18
src/libs/3rdparty/cplusplus/Symbol.cpp
vendored
18
src/libs/3rdparty/cplusplus/Symbol.cpp
vendored
@@ -86,7 +86,7 @@ private:
|
||||
unsigned _value;
|
||||
};
|
||||
|
||||
Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Symbol::Symbol(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: _name(0),
|
||||
_enclosingScope(0),
|
||||
_next(0),
|
||||
@@ -142,7 +142,7 @@ void Symbol::visitSymbol(Symbol *symbol, SymbolVisitor *visitor)
|
||||
symbol->visitSymbol(visitor);
|
||||
}
|
||||
|
||||
unsigned Symbol::sourceLocation() const
|
||||
int Symbol::sourceLocation() const
|
||||
{ return _sourceLocation; }
|
||||
|
||||
bool Symbol::isGenerated() const
|
||||
@@ -160,7 +160,7 @@ bool Symbol::isUnavailable() const
|
||||
void Symbol::setUnavailable(bool isUnavailable)
|
||||
{ _isUnavailable = isUnavailable; }
|
||||
|
||||
void Symbol::setSourceLocation(unsigned sourceLocation, TranslationUnit *translationUnit)
|
||||
void Symbol::setSourceLocation(int sourceLocation, TranslationUnit *translationUnit)
|
||||
{
|
||||
_sourceLocation = sourceLocation;
|
||||
|
||||
@@ -176,12 +176,12 @@ void Symbol::setSourceLocation(unsigned sourceLocation, TranslationUnit *transla
|
||||
}
|
||||
}
|
||||
|
||||
unsigned Symbol::line() const
|
||||
int Symbol::line() const
|
||||
{
|
||||
return _line;
|
||||
}
|
||||
|
||||
unsigned Symbol::column() const
|
||||
int Symbol::column() const
|
||||
{
|
||||
return _column;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ const StringLiteral *Symbol::fileId() const
|
||||
const char *Symbol::fileName() const
|
||||
{ return _fileId ? _fileId->chars() : ""; }
|
||||
|
||||
unsigned Symbol::fileNameLength() const
|
||||
int Symbol::fileNameLength() const
|
||||
{ return _fileId ? _fileId->size() : 0; }
|
||||
|
||||
const Name *Symbol::unqualifiedName() const
|
||||
@@ -439,10 +439,10 @@ void Symbol::copy(Symbol *other)
|
||||
|
||||
Utils::Link Symbol::toLink() const
|
||||
{
|
||||
const QString filename = QString::fromUtf8(fileName(), static_cast<int>(fileNameLength()));
|
||||
const QString filename = QString::fromUtf8(fileName(), fileNameLength());
|
||||
|
||||
int line = static_cast<int>(this->line());
|
||||
int column = static_cast<int>(this->column());
|
||||
int line = this->line();
|
||||
int column = this->column();
|
||||
|
||||
if (column)
|
||||
--column;
|
||||
|
20
src/libs/3rdparty/cplusplus/Symbol.h
vendored
20
src/libs/3rdparty/cplusplus/Symbol.h
vendored
@@ -54,20 +54,20 @@ public:
|
||||
|
||||
public:
|
||||
/// Constructs a Symbol with the given source location, name and translation unit.
|
||||
Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Symbol(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Symbol(Clone *clone, Subst *subst, Symbol *original);
|
||||
|
||||
/// Destroy this Symbol.
|
||||
virtual ~Symbol();
|
||||
|
||||
/// Returns this Symbol's source location.
|
||||
unsigned sourceLocation() const;
|
||||
int sourceLocation() const;
|
||||
|
||||
/// \returns this Symbol's line number. The line number is 1-based.
|
||||
unsigned line() const;
|
||||
int line() const;
|
||||
|
||||
/// \returns this Symbol's column number. The column number is 1-based.
|
||||
unsigned column() const;
|
||||
int column() const;
|
||||
|
||||
/// Returns this Symbol's file name.
|
||||
const StringLiteral *fileId() const;
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
const char *fileName() const;
|
||||
|
||||
/// Returns this Symbol's file name length.
|
||||
unsigned fileNameLength() const;
|
||||
int fileNameLength() const;
|
||||
|
||||
/// Returns this Symbol's name.
|
||||
const Name *name() const;
|
||||
@@ -294,7 +294,7 @@ public:
|
||||
|
||||
void setEnclosingScope(Scope *enclosingScope); // ### make me private
|
||||
void resetEnclosingScope(); // ### make me private
|
||||
void setSourceLocation(unsigned sourceLocation, TranslationUnit *translationUnit); // ### make me private
|
||||
void setSourceLocation(int sourceLocation, TranslationUnit *translationUnit); // ### make me private
|
||||
|
||||
void visitSymbol(SymbolVisitor *visitor);
|
||||
static void visitSymbol(Symbol *symbol, SymbolVisitor *visitor);
|
||||
@@ -309,13 +309,13 @@ private:
|
||||
Scope *_enclosingScope;
|
||||
Symbol *_next;
|
||||
const StringLiteral *_fileId;
|
||||
unsigned _sourceLocation;
|
||||
int _sourceLocation;
|
||||
unsigned _hashCode;
|
||||
int _storage;
|
||||
int _visibility;
|
||||
unsigned _index;
|
||||
unsigned _line;
|
||||
unsigned _column;
|
||||
int _index;
|
||||
int _line;
|
||||
int _column;
|
||||
|
||||
bool _isGenerated: 1;
|
||||
bool _isDeprecated: 1;
|
||||
|
130
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
130
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
@@ -34,7 +34,7 @@
|
||||
using namespace CPlusPlus;
|
||||
|
||||
UsingNamespaceDirective::UsingNamespaceDirective(TranslationUnit *translationUnit,
|
||||
unsigned sourceLocation, const Name *name)
|
||||
int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
{ }
|
||||
|
||||
@@ -52,7 +52,7 @@ void UsingNamespaceDirective::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
NamespaceAlias::NamespaceAlias(TranslationUnit *translationUnit,
|
||||
unsigned sourceLocation, const Name *name)
|
||||
int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name), _namespaceName(0)
|
||||
{ }
|
||||
|
||||
@@ -78,7 +78,7 @@ void NamespaceAlias::visitSymbol0(SymbolVisitor *visitor)
|
||||
|
||||
|
||||
UsingDeclaration::UsingDeclaration(TranslationUnit *translationUnit,
|
||||
unsigned sourceLocation, const Name *name)
|
||||
int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
{ }
|
||||
|
||||
@@ -95,7 +95,7 @@ FullySpecifiedType UsingDeclaration::type() const
|
||||
void UsingDeclaration::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
Declaration::Declaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Declaration::Declaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
, _initializer(0)
|
||||
{ }
|
||||
@@ -226,7 +226,7 @@ const StringLiteral *Declaration::getInitializer() const
|
||||
void Declaration::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
EnumeratorDeclaration::EnumeratorDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
EnumeratorDeclaration::EnumeratorDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Declaration(translationUnit, sourceLocation, name)
|
||||
, _constantValue(0)
|
||||
{}
|
||||
@@ -240,7 +240,7 @@ const StringLiteral *EnumeratorDeclaration::constantValue() const
|
||||
void EnumeratorDeclaration::setConstantValue(const StringLiteral *constantValue)
|
||||
{ _constantValue = constantValue; }
|
||||
|
||||
Argument::Argument(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Argument::Argument(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name),
|
||||
_initializer(0)
|
||||
{ }
|
||||
@@ -272,7 +272,7 @@ FullySpecifiedType Argument::type() const
|
||||
void Argument::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
TypenameArgument::TypenameArgument(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
TypenameArgument::TypenameArgument(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
, _isClassDeclarator(false)
|
||||
{ }
|
||||
@@ -295,7 +295,7 @@ FullySpecifiedType TypenameArgument::type() const
|
||||
void TypenameArgument::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
Function::Function(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Function::Function(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Scope(translationUnit, sourceLocation, name),
|
||||
_flags(0)
|
||||
{ }
|
||||
@@ -338,10 +338,10 @@ bool Function::isSignatureEqualTo(const Function *other, Matcher *matcher) const
|
||||
else if (! Matcher::match(unqualifiedName(), other->unqualifiedName(), matcher))
|
||||
return false;
|
||||
|
||||
const unsigned argc = argumentCount();
|
||||
const int argc = argumentCount();
|
||||
if (argc != other->argumentCount())
|
||||
return false;
|
||||
for (unsigned i = 0; i < argc; ++i) {
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
Symbol *l = argumentAt(i);
|
||||
Symbol *r = other->argumentAt(i);
|
||||
if (! l->type().match(r->type(), matcher)) {
|
||||
@@ -395,24 +395,24 @@ bool Function::hasReturnType() const
|
||||
return ty.isValid() || ty.isSigned() || ty.isUnsigned();
|
||||
}
|
||||
|
||||
unsigned Function::argumentCount() const
|
||||
int Function::argumentCount() const
|
||||
{
|
||||
const unsigned memCnt = memberCount();
|
||||
const int memCnt = memberCount();
|
||||
if (memCnt > 0 && memberAt(0)->type()->isVoidType())
|
||||
return 0;
|
||||
|
||||
// Definitions with function-try-blocks will have more than a block, and
|
||||
// arguments with a lambda as default argument will also have more blocks.
|
||||
unsigned argc = 0;
|
||||
for (unsigned it = 0; it < memCnt; ++it)
|
||||
int argc = 0;
|
||||
for (int it = 0; it < memCnt; ++it)
|
||||
if (memberAt(it)->isArgument())
|
||||
++argc;
|
||||
return argc;
|
||||
}
|
||||
|
||||
Symbol *Function::argumentAt(unsigned index) const
|
||||
Symbol *Function::argumentAt(int index) const
|
||||
{
|
||||
for (unsigned it = 0, eit = memberCount(); it < eit; ++it) {
|
||||
for (int it = 0, eit = memberCount(); it < eit; ++it) {
|
||||
if (Argument *arg = memberAt(it)->asArgument()) {
|
||||
if (index == 0)
|
||||
return arg;
|
||||
@@ -426,15 +426,15 @@ Symbol *Function::argumentAt(unsigned index) const
|
||||
|
||||
bool Function::hasArguments() const
|
||||
{
|
||||
unsigned argc = argumentCount();
|
||||
int argc = argumentCount();
|
||||
return ! (argc == 0 || (argc == 1 && argumentAt(0)->type()->isVoidType()));
|
||||
}
|
||||
|
||||
unsigned Function::minimumArgumentCount() const
|
||||
int Function::minimumArgumentCount() const
|
||||
{
|
||||
unsigned index = 0;
|
||||
int index = 0;
|
||||
|
||||
for (unsigned ei = argumentCount(); index < ei; ++index) {
|
||||
for (int ei = argumentCount(); index < ei; ++index) {
|
||||
if (Argument *arg = argumentAt(index)->asArgument()) {
|
||||
if (arg->hasInitializer())
|
||||
break;
|
||||
@@ -501,16 +501,16 @@ void Function::setAmbiguous(bool isAmbiguous)
|
||||
void Function::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < memberCount(); ++i) {
|
||||
for (int i = 0; i < memberCount(); ++i) {
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Function::maybeValidPrototype(unsigned actualArgumentCount) const
|
||||
bool Function::maybeValidPrototype(int actualArgumentCount) const
|
||||
{
|
||||
const unsigned argc = argumentCount();
|
||||
unsigned minNumberArguments = 0;
|
||||
const int argc = argumentCount();
|
||||
int minNumberArguments = 0;
|
||||
|
||||
for (; minNumberArguments < argc; ++minNumberArguments) {
|
||||
Argument *arg = argumentAt(minNumberArguments)->asArgument();
|
||||
@@ -535,7 +535,7 @@ bool Function::maybeValidPrototype(unsigned actualArgumentCount) const
|
||||
}
|
||||
|
||||
|
||||
Block::Block(TranslationUnit *translationUnit, unsigned sourceLocation)
|
||||
Block::Block(TranslationUnit *translationUnit, int sourceLocation)
|
||||
: Scope(translationUnit, sourceLocation, /*name = */ 0)
|
||||
{ }
|
||||
|
||||
@@ -552,13 +552,13 @@ FullySpecifiedType Block::type() const
|
||||
void Block::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < memberCount(); ++i) {
|
||||
for (int i = 0; i < memberCount(); ++i) {
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Enum::Enum(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Enum::Enum(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Scope(translationUnit, sourceLocation, name)
|
||||
, _isScoped(false)
|
||||
{ }
|
||||
@@ -598,13 +598,13 @@ bool Enum::match0(const Type *otherType, Matcher *matcher) const
|
||||
void Enum::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < memberCount(); ++i) {
|
||||
for (int i = 0; i < memberCount(); ++i) {
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Template::Template(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Template::Template(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Scope(translationUnit, sourceLocation, name)
|
||||
{ }
|
||||
|
||||
@@ -615,7 +615,7 @@ Template::Template(Clone *clone, Subst *subst, Template *original)
|
||||
Template::~Template()
|
||||
{ }
|
||||
|
||||
unsigned Template::templateParameterCount() const
|
||||
int Template::templateParameterCount() const
|
||||
{
|
||||
if (declaration() != 0)
|
||||
return memberCount() - 1;
|
||||
@@ -623,7 +623,7 @@ unsigned Template::templateParameterCount() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
Symbol *Template::templateParameterAt(unsigned index) const
|
||||
Symbol *Template::templateParameterAt(int index) const
|
||||
{ return memberAt(index); }
|
||||
|
||||
Symbol *Template::declaration() const
|
||||
@@ -646,7 +646,7 @@ FullySpecifiedType Template::type() const
|
||||
void Template::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < memberCount(); ++i) {
|
||||
for (int i = 0; i < memberCount(); ++i) {
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
@@ -662,7 +662,7 @@ bool Template::match0(const Type *otherType, Matcher *matcher) const
|
||||
return false;
|
||||
}
|
||||
|
||||
Namespace::Namespace(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Namespace::Namespace(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Scope(translationUnit, sourceLocation, name)
|
||||
, _isInline(false)
|
||||
{ }
|
||||
@@ -689,7 +689,7 @@ bool Namespace::match0(const Type *otherType, Matcher *matcher) const
|
||||
void Namespace::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < memberCount(); ++i) {
|
||||
for (int i = 0; i < memberCount(); ++i) {
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
@@ -698,7 +698,7 @@ void Namespace::visitSymbol0(SymbolVisitor *visitor)
|
||||
FullySpecifiedType Namespace::type() const
|
||||
{ return FullySpecifiedType(const_cast<Namespace *>(this)); }
|
||||
|
||||
BaseClass::BaseClass(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
BaseClass::BaseClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name),
|
||||
_isVirtual(false)
|
||||
{ }
|
||||
@@ -734,7 +734,7 @@ void BaseClass::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
ForwardClassDeclaration::ForwardClassDeclaration(TranslationUnit *translationUnit,
|
||||
unsigned sourceLocation, const Name *name)
|
||||
int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
{ }
|
||||
|
||||
@@ -762,7 +762,7 @@ bool ForwardClassDeclaration::match0(const Type *otherType, Matcher *matcher) co
|
||||
return false;
|
||||
}
|
||||
|
||||
Class::Class(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
Class::Class(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Scope(translationUnit, sourceLocation, name),
|
||||
_key(ClassKey)
|
||||
{ }
|
||||
@@ -804,10 +804,10 @@ bool Class::match0(const Type *otherType, Matcher *matcher) const
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned Class::baseClassCount() const
|
||||
{ return unsigned(_baseClasses.size()); }
|
||||
int Class::baseClassCount() const
|
||||
{ return int(_baseClasses.size()); }
|
||||
|
||||
BaseClass *Class::baseClassAt(unsigned index) const
|
||||
BaseClass *Class::baseClassAt(int index) const
|
||||
{ return _baseClasses.at(index); }
|
||||
|
||||
void Class::addBaseClass(BaseClass *baseClass)
|
||||
@@ -819,17 +819,17 @@ FullySpecifiedType Class::type() const
|
||||
void Class::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < _baseClasses.size(); ++i) {
|
||||
for (int i = 0; i < int(_baseClasses.size()); ++i) {
|
||||
visitSymbol(_baseClasses.at(i), visitor);
|
||||
}
|
||||
for (unsigned i = 0; i < memberCount(); ++i) {
|
||||
for (int i = 0; i < memberCount(); ++i) {
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QtPropertyDeclaration::QtPropertyDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
QtPropertyDeclaration::QtPropertyDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
, _flags(NoFlags)
|
||||
{ }
|
||||
@@ -859,7 +859,7 @@ void QtPropertyDeclaration::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
|
||||
QtEnum::QtEnum(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
QtEnum::QtEnum(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
{ }
|
||||
|
||||
@@ -877,7 +877,7 @@ void QtEnum::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
|
||||
ObjCBaseClass::ObjCBaseClass(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
ObjCBaseClass::ObjCBaseClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
{ }
|
||||
|
||||
@@ -894,7 +894,7 @@ FullySpecifiedType ObjCBaseClass::type() const
|
||||
void ObjCBaseClass::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
ObjCBaseProtocol::ObjCBaseProtocol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
ObjCBaseProtocol::ObjCBaseProtocol(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
{ }
|
||||
|
||||
@@ -911,7 +911,7 @@ FullySpecifiedType ObjCBaseProtocol::type() const
|
||||
void ObjCBaseProtocol::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
ObjCClass::ObjCClass(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name):
|
||||
ObjCClass::ObjCClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name):
|
||||
Scope(translationUnit, sourceLocation, name),
|
||||
_categoryName(0),
|
||||
_baseClass(0),
|
||||
@@ -954,10 +954,10 @@ ObjCBaseClass *ObjCClass::baseClass() const
|
||||
void ObjCClass::setBaseClass(ObjCBaseClass *baseClass)
|
||||
{ _baseClass = baseClass; }
|
||||
|
||||
unsigned ObjCClass::protocolCount() const
|
||||
{ return unsigned(_protocols.size()); }
|
||||
int ObjCClass::protocolCount() const
|
||||
{ return int(_protocols.size()); }
|
||||
|
||||
ObjCBaseProtocol *ObjCClass::protocolAt(unsigned index) const
|
||||
ObjCBaseProtocol *ObjCClass::protocolAt(int index) const
|
||||
{ return _protocols.at(index); }
|
||||
|
||||
void ObjCClass::addProtocol(ObjCBaseProtocol *protocol)
|
||||
@@ -972,10 +972,10 @@ void ObjCClass::visitSymbol0(SymbolVisitor *visitor)
|
||||
if (_baseClass)
|
||||
visitSymbol(_baseClass, visitor);
|
||||
|
||||
for (unsigned i = 0; i < _protocols.size(); ++i)
|
||||
for (int i = 0; i < int(_protocols.size()); ++i)
|
||||
visitSymbol(_protocols.at(i), visitor);
|
||||
|
||||
for (unsigned i = 0; i < memberCount(); ++i)
|
||||
for (int i = 0; i < memberCount(); ++i)
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
@@ -991,7 +991,7 @@ bool ObjCClass::match0(const Type *otherType, Matcher *matcher) const
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjCProtocol::ObjCProtocol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name):
|
||||
ObjCProtocol::ObjCProtocol(TranslationUnit *translationUnit, int sourceLocation, const Name *name):
|
||||
Scope(translationUnit, sourceLocation, name)
|
||||
{
|
||||
}
|
||||
@@ -1006,10 +1006,10 @@ ObjCProtocol::ObjCProtocol(Clone *clone, Subst *subst, ObjCProtocol *original)
|
||||
ObjCProtocol::~ObjCProtocol()
|
||||
{}
|
||||
|
||||
unsigned ObjCProtocol::protocolCount() const
|
||||
{ return unsigned(_protocols.size()); }
|
||||
int ObjCProtocol::protocolCount() const
|
||||
{ return int(_protocols.size()); }
|
||||
|
||||
ObjCBaseProtocol *ObjCProtocol::protocolAt(unsigned index) const
|
||||
ObjCBaseProtocol *ObjCProtocol::protocolAt(int index) const
|
||||
{ return _protocols.at(index); }
|
||||
|
||||
void ObjCProtocol::addProtocol(ObjCBaseProtocol *protocol)
|
||||
@@ -1021,7 +1021,7 @@ FullySpecifiedType ObjCProtocol::type() const
|
||||
void ObjCProtocol::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < _protocols.size(); ++i)
|
||||
for (int i = 0; i < int(_protocols.size()); ++i)
|
||||
visitSymbol(_protocols.at(i), visitor);
|
||||
}
|
||||
}
|
||||
@@ -1037,7 +1037,7 @@ bool ObjCProtocol::match0(const Type *otherType, Matcher *matcher) const
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjCForwardClassDeclaration::ObjCForwardClassDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation,
|
||||
ObjCForwardClassDeclaration::ObjCForwardClassDeclaration(TranslationUnit *translationUnit, int sourceLocation,
|
||||
const Name *name):
|
||||
Symbol(translationUnit, sourceLocation, name)
|
||||
{
|
||||
@@ -1067,7 +1067,7 @@ bool ObjCForwardClassDeclaration::match0(const Type *otherType, Matcher *matcher
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjCForwardProtocolDeclaration::ObjCForwardProtocolDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation,
|
||||
ObjCForwardProtocolDeclaration::ObjCForwardProtocolDeclaration(TranslationUnit *translationUnit, int sourceLocation,
|
||||
const Name *name):
|
||||
Symbol(translationUnit, sourceLocation, name)
|
||||
{
|
||||
@@ -1097,7 +1097,7 @@ bool ObjCForwardProtocolDeclaration::match0(const Type *otherType, Matcher *matc
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjCMethod::ObjCMethod(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
ObjCMethod::ObjCMethod(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
|
||||
: Scope(translationUnit, sourceLocation, name),
|
||||
_flags(0)
|
||||
{ }
|
||||
@@ -1137,15 +1137,15 @@ bool ObjCMethod::hasReturnType() const
|
||||
return ty.isValid() || ty.isSigned() || ty.isUnsigned();
|
||||
}
|
||||
|
||||
unsigned ObjCMethod::argumentCount() const
|
||||
int ObjCMethod::argumentCount() const
|
||||
{
|
||||
const unsigned c = memberCount();
|
||||
const int c = memberCount();
|
||||
if (c > 0 && memberAt(c - 1)->isBlock())
|
||||
return c - 1;
|
||||
return c;
|
||||
}
|
||||
|
||||
Symbol *ObjCMethod::argumentAt(unsigned index) const
|
||||
Symbol *ObjCMethod::argumentAt(int index) const
|
||||
{
|
||||
return memberAt(index);
|
||||
}
|
||||
@@ -1165,14 +1165,14 @@ void ObjCMethod::setVariadic(bool isVariadic)
|
||||
void ObjCMethod::visitSymbol0(SymbolVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
for (unsigned i = 0; i < memberCount(); ++i) {
|
||||
for (int i = 0; i < memberCount(); ++i) {
|
||||
visitSymbol(memberAt(i), visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ObjCPropertyDeclaration::ObjCPropertyDeclaration(TranslationUnit *translationUnit,
|
||||
unsigned sourceLocation,
|
||||
int sourceLocation,
|
||||
const Name *name):
|
||||
Symbol(translationUnit, sourceLocation, name),
|
||||
_getterName(0),
|
||||
|
78
src/libs/3rdparty/cplusplus/Symbols.h
vendored
78
src/libs/3rdparty/cplusplus/Symbols.h
vendored
@@ -32,7 +32,7 @@ namespace CPlusPlus {
|
||||
class CPLUSPLUS_EXPORT UsingNamespaceDirective: public Symbol
|
||||
{
|
||||
public:
|
||||
UsingNamespaceDirective(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
UsingNamespaceDirective(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
UsingNamespaceDirective(Clone *clone, Subst *subst, UsingNamespaceDirective *original);
|
||||
virtual ~UsingNamespaceDirective();
|
||||
|
||||
@@ -52,7 +52,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT UsingDeclaration: public Symbol
|
||||
{
|
||||
public:
|
||||
UsingDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
UsingDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
UsingDeclaration(Clone *clone, Subst *subst, UsingDeclaration *original);
|
||||
virtual ~UsingDeclaration();
|
||||
|
||||
@@ -72,7 +72,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT NamespaceAlias: public Symbol
|
||||
{
|
||||
public:
|
||||
NamespaceAlias(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
NamespaceAlias(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
NamespaceAlias(Clone *clone, Subst *subst, NamespaceAlias *original);
|
||||
virtual ~NamespaceAlias();
|
||||
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT Declaration: public Symbol
|
||||
{
|
||||
public:
|
||||
Declaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Declaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Declaration(Clone *clone, Subst *subst, Declaration *original);
|
||||
virtual ~Declaration();
|
||||
|
||||
@@ -132,7 +132,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT EnumeratorDeclaration: public Declaration
|
||||
{
|
||||
public:
|
||||
EnumeratorDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
EnumeratorDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
virtual ~EnumeratorDeclaration();
|
||||
|
||||
const StringLiteral *constantValue() const;
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT Argument: public Symbol
|
||||
{
|
||||
public:
|
||||
Argument(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Argument(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Argument(Clone *clone, Subst *subst, Argument *original);
|
||||
virtual ~Argument();
|
||||
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT TypenameArgument: public Symbol
|
||||
{
|
||||
public:
|
||||
TypenameArgument(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
TypenameArgument(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
TypenameArgument(Clone *clone, Subst *subst, TypenameArgument *original);
|
||||
virtual ~TypenameArgument();
|
||||
|
||||
@@ -210,7 +210,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT Block: public Scope
|
||||
{
|
||||
public:
|
||||
Block(TranslationUnit *translationUnit, unsigned sourceLocation);
|
||||
Block(TranslationUnit *translationUnit, int sourceLocation);
|
||||
Block(Clone *clone, Subst *subst, Block *original);
|
||||
virtual ~Block();
|
||||
|
||||
@@ -230,7 +230,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT ForwardClassDeclaration: public Symbol, public Type
|
||||
{
|
||||
public:
|
||||
ForwardClassDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ForwardClassDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ForwardClassDeclaration(Clone *clone, Subst *subst, ForwardClassDeclaration *original);
|
||||
virtual ~ForwardClassDeclaration();
|
||||
|
||||
@@ -259,7 +259,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT Enum: public Scope, public Type
|
||||
{
|
||||
public:
|
||||
Enum(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Enum(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Enum(Clone *clone, Subst *subst, Enum *original);
|
||||
virtual ~Enum();
|
||||
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
Function(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Function(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Function(Clone *clone, Subst *subst, Function *original);
|
||||
virtual ~Function();
|
||||
|
||||
@@ -325,12 +325,12 @@ public:
|
||||
/** Convenience function that returns whether the function returns something (including void). */
|
||||
bool hasReturnType() const;
|
||||
|
||||
unsigned argumentCount() const;
|
||||
Symbol *argumentAt(unsigned index) const;
|
||||
int argumentCount() const;
|
||||
Symbol *argumentAt(int index) const;
|
||||
|
||||
/** Convenience function that returns whether the function receives any arguments. */
|
||||
bool hasArguments() const;
|
||||
unsigned minimumArgumentCount() const;
|
||||
int minimumArgumentCount() const;
|
||||
|
||||
bool isVirtual() const;
|
||||
void setVirtual(bool isVirtual);
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
bool isAmbiguous() const; // internal
|
||||
void setAmbiguous(bool isAmbiguous); // internal
|
||||
|
||||
bool maybeValidPrototype(unsigned actualArgumentCount) const;
|
||||
bool maybeValidPrototype(int actualArgumentCount) const;
|
||||
|
||||
// Symbol's interface
|
||||
virtual FullySpecifiedType type() const;
|
||||
@@ -407,12 +407,12 @@ private:
|
||||
class CPLUSPLUS_EXPORT Template: public Scope, public Type
|
||||
{
|
||||
public:
|
||||
Template(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Template(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Template(Clone *clone, Subst *subst, Template *original);
|
||||
virtual ~Template();
|
||||
|
||||
unsigned templateParameterCount() const;
|
||||
Symbol *templateParameterAt(unsigned index) const;
|
||||
int templateParameterCount() const;
|
||||
Symbol *templateParameterAt(int index) const;
|
||||
Symbol *declaration() const;
|
||||
|
||||
// Symbol's interface
|
||||
@@ -441,7 +441,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT Namespace: public Scope, public Type
|
||||
{
|
||||
public:
|
||||
Namespace(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Namespace(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Namespace(Clone *clone, Subst *subst, Namespace *original);
|
||||
virtual ~Namespace();
|
||||
|
||||
@@ -479,7 +479,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT BaseClass: public Symbol
|
||||
{
|
||||
public:
|
||||
BaseClass(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
BaseClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
BaseClass(Clone *clone, Subst *subst, BaseClass *original);
|
||||
virtual ~BaseClass();
|
||||
|
||||
@@ -511,7 +511,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT Class: public Scope, public Type
|
||||
{
|
||||
public:
|
||||
Class(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
Class(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
Class(Clone *clone, Subst *subst, Class *original);
|
||||
virtual ~Class();
|
||||
|
||||
@@ -527,8 +527,8 @@ public:
|
||||
Key classKey() const;
|
||||
void setClassKey(Key key);
|
||||
|
||||
unsigned baseClassCount() const;
|
||||
BaseClass *baseClassAt(unsigned index) const;
|
||||
int baseClassCount() const;
|
||||
BaseClass *baseClassAt(int index) const;
|
||||
void addBaseClass(BaseClass *baseClass);
|
||||
|
||||
// Symbol's interface
|
||||
@@ -580,7 +580,7 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
QtPropertyDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
QtPropertyDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
QtPropertyDeclaration(Clone *clone, Subst *subst, QtPropertyDeclaration *original);
|
||||
virtual ~QtPropertyDeclaration();
|
||||
|
||||
@@ -609,7 +609,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT QtEnum: public Symbol
|
||||
{
|
||||
public:
|
||||
QtEnum(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
QtEnum(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
QtEnum(Clone *clone, Subst *subst, QtEnum *original);
|
||||
virtual ~QtEnum();
|
||||
|
||||
@@ -629,7 +629,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT ObjCBaseClass: public Symbol
|
||||
{
|
||||
public:
|
||||
ObjCBaseClass(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ObjCBaseClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ObjCBaseClass(Clone *clone, Subst *subst, ObjCBaseClass *original);
|
||||
virtual ~ObjCBaseClass();
|
||||
|
||||
@@ -649,7 +649,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT ObjCBaseProtocol: public Symbol
|
||||
{
|
||||
public:
|
||||
ObjCBaseProtocol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ObjCBaseProtocol(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ObjCBaseProtocol(Clone *clone, Subst *subst, ObjCBaseProtocol *original);
|
||||
virtual ~ObjCBaseProtocol();
|
||||
|
||||
@@ -669,7 +669,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT ObjCForwardProtocolDeclaration: public Symbol, public Type
|
||||
{
|
||||
public:
|
||||
ObjCForwardProtocolDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ObjCForwardProtocolDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ObjCForwardProtocolDeclaration(Clone *clone, Subst *subst, ObjCForwardProtocolDeclaration *original);
|
||||
virtual ~ObjCForwardProtocolDeclaration();
|
||||
|
||||
@@ -698,12 +698,12 @@ protected:
|
||||
class CPLUSPLUS_EXPORT ObjCProtocol: public Scope, public Type
|
||||
{
|
||||
public:
|
||||
ObjCProtocol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ObjCProtocol(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ObjCProtocol(Clone *clone, Subst *subst, ObjCProtocol *original);
|
||||
virtual ~ObjCProtocol();
|
||||
|
||||
unsigned protocolCount() const;
|
||||
ObjCBaseProtocol *protocolAt(unsigned index) const;
|
||||
int protocolCount() const;
|
||||
ObjCBaseProtocol *protocolAt(int index) const;
|
||||
void addProtocol(ObjCBaseProtocol *protocol);
|
||||
|
||||
// Symbol's interface
|
||||
@@ -734,7 +734,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT ObjCForwardClassDeclaration: public Symbol, public Type
|
||||
{
|
||||
public:
|
||||
ObjCForwardClassDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ObjCForwardClassDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ObjCForwardClassDeclaration(Clone *clone, Subst *subst, ObjCForwardClassDeclaration *original);
|
||||
virtual ~ObjCForwardClassDeclaration();
|
||||
|
||||
@@ -763,7 +763,7 @@ protected:
|
||||
class CPLUSPLUS_EXPORT ObjCClass: public Scope, public Type
|
||||
{
|
||||
public:
|
||||
ObjCClass(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ObjCClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ObjCClass(Clone *clone, Subst *subst, ObjCClass *original);
|
||||
virtual ~ObjCClass();
|
||||
|
||||
@@ -777,8 +777,8 @@ public:
|
||||
ObjCBaseClass *baseClass() const;
|
||||
void setBaseClass(ObjCBaseClass *baseClass);
|
||||
|
||||
unsigned protocolCount() const;
|
||||
ObjCBaseProtocol *protocolAt(unsigned index) const;
|
||||
int protocolCount() const;
|
||||
ObjCBaseProtocol *protocolAt(int index) const;
|
||||
void addProtocol(ObjCBaseProtocol *protocol);
|
||||
|
||||
// Symbol's interface
|
||||
@@ -812,7 +812,7 @@ private:
|
||||
class CPLUSPLUS_EXPORT ObjCMethod: public Scope, public Type
|
||||
{
|
||||
public:
|
||||
ObjCMethod(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name);
|
||||
ObjCMethod(TranslationUnit *translationUnit, int sourceLocation, const Name *name);
|
||||
ObjCMethod(Clone *clone, Subst *subst, ObjCMethod *original);
|
||||
virtual ~ObjCMethod();
|
||||
|
||||
@@ -822,8 +822,8 @@ public:
|
||||
/** Convenience function that returns whether the function returns something (including void). */
|
||||
bool hasReturnType() const;
|
||||
|
||||
unsigned argumentCount() const;
|
||||
Symbol *argumentAt(unsigned index) const;
|
||||
int argumentCount() const;
|
||||
Symbol *argumentAt(int index) const;
|
||||
|
||||
/** Convenience function that returns whether the function receives any arguments. */
|
||||
bool hasArguments() const;
|
||||
@@ -883,7 +883,7 @@ public:
|
||||
|
||||
public:
|
||||
ObjCPropertyDeclaration(TranslationUnit *translationUnit,
|
||||
unsigned sourceLocation,
|
||||
int sourceLocation,
|
||||
const Name *name);
|
||||
ObjCPropertyDeclaration(Clone *clone, Subst *subst, ObjCPropertyDeclaration *original);
|
||||
virtual ~ObjCPropertyDeclaration();
|
||||
|
14
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
14
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
@@ -440,13 +440,13 @@ void CloneName::visit(const AnonymousNameId *name)
|
||||
void CloneName::visit(const TemplateNameId *name)
|
||||
{
|
||||
std::vector<FullySpecifiedType> args(name->templateArgumentCount());
|
||||
for (unsigned i = 0; i < args.size(); ++i)
|
||||
for (int i = 0; i < int(args.size()); ++i)
|
||||
args[i] = _clone->type(name->templateArgumentAt(i), _subst);
|
||||
if (args.empty())
|
||||
_name = _control->templateNameId(_clone->identifier(name->identifier()), name->isSpecialization());
|
||||
else
|
||||
_name = _control->templateNameId(_clone->identifier(name->identifier()), name->isSpecialization(),
|
||||
&args[0], unsigned(args.size()));
|
||||
&args[0], int(args.size()));
|
||||
}
|
||||
|
||||
void CloneName::visit(const DestructorNameId *name)
|
||||
@@ -474,9 +474,9 @@ void CloneName::visit(const SelectorNameId *name)
|
||||
{
|
||||
CPP_CHECK(name->nameCount() > 0);
|
||||
std::vector<const Name *> names(name->nameCount());
|
||||
for (unsigned i = 0; i < names.size(); ++i)
|
||||
for (int i = 0; i < int(names.size()); ++i)
|
||||
names[i] = _clone->name(name->nameAt(i), _subst);
|
||||
_name = _control->selectorNameId(&names[0], unsigned(names.size()), name->hasArguments());
|
||||
_name = _control->selectorNameId(&names[0], int(names.size()), name->hasArguments());
|
||||
}
|
||||
|
||||
|
||||
@@ -518,16 +518,16 @@ Symbol *Clone::symbol(Symbol *symbol, Subst *subst)
|
||||
return _symbol(symbol, subst);
|
||||
}
|
||||
|
||||
Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args, unsigned argc, Subst *s)
|
||||
Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args, int argc, Subst *s)
|
||||
{
|
||||
Subst subst(_control, s);
|
||||
for (unsigned i = 0, e = std::min(templ->templateParameterCount(), argc); i < e; ++i) {
|
||||
for (int i = 0, e = std::min(templ->templateParameterCount(), argc); i < e; ++i) {
|
||||
Symbol *formal = templ->templateParameterAt(i);
|
||||
FullySpecifiedType actual = args[i];
|
||||
subst.bind(name(formal->name(), 0), actual);
|
||||
}
|
||||
if (argc < templ->templateParameterCount()) {
|
||||
for (unsigned i = argc; i < templ->templateParameterCount(); ++i) {
|
||||
for (int i = argc; i < templ->templateParameterCount(); ++i) {
|
||||
Symbol *formal = templ->templateParameterAt(i);
|
||||
if (TypenameArgument *tn = formal->asTypenameArgument())
|
||||
subst.bind(name(formal->name(), &subst), type(tn->type(), &subst));
|
||||
|
2
src/libs/3rdparty/cplusplus/Templates.h
vendored
2
src/libs/3rdparty/cplusplus/Templates.h
vendored
@@ -196,7 +196,7 @@ public:
|
||||
Symbol *symbol(Symbol *symbol, Subst *subst);
|
||||
|
||||
Symbol *instantiate(Template *templ,
|
||||
const FullySpecifiedType *const args, unsigned argc,
|
||||
const FullySpecifiedType *const args, int argc,
|
||||
Subst *subst = 0);
|
||||
|
||||
private:
|
||||
|
14
src/libs/3rdparty/cplusplus/Token.h
vendored
14
src/libs/3rdparty/cplusplus/Token.h
vendored
@@ -313,13 +313,13 @@ public:
|
||||
inline bool generated() const { return f.generated; }
|
||||
inline bool userDefinedLiteral() const { return f.userDefinedLiteral; }
|
||||
|
||||
inline unsigned bytes() const { return f.bytes; }
|
||||
inline unsigned bytesBegin() const { return byteOffset; }
|
||||
inline unsigned bytesEnd() const { return byteOffset + f.bytes; }
|
||||
inline int bytes() const { return f.bytes; }
|
||||
inline int bytesBegin() const { return byteOffset; }
|
||||
inline int bytesEnd() const { return byteOffset + f.bytes; }
|
||||
|
||||
inline unsigned utf16chars() const { return f.utf16chars; }
|
||||
inline unsigned utf16charsBegin() const { return utf16charOffset; }
|
||||
inline unsigned utf16charsEnd() const { return utf16charOffset + f.utf16chars; }
|
||||
inline int utf16chars() const { return f.utf16chars; }
|
||||
inline int utf16charsBegin() const { return utf16charOffset; }
|
||||
inline int utf16charsEnd() const { return utf16charOffset + f.utf16chars; }
|
||||
|
||||
inline bool isLiteral() const
|
||||
{ return f.kind >= T_FIRST_LITERAL && f.kind <= T_LAST_LITERAL; }
|
||||
@@ -405,7 +405,7 @@ public:
|
||||
const StringLiteral *string;
|
||||
const Identifier *identifier;
|
||||
unsigned close_brace;
|
||||
unsigned lineno;
|
||||
int lineno;
|
||||
};
|
||||
};
|
||||
|
||||
|
112
src/libs/3rdparty/cplusplus/TranslationUnit.cpp
vendored
112
src/libs/3rdparty/cplusplus/TranslationUnit.cpp
vendored
@@ -70,7 +70,7 @@ const StringLiteral *TranslationUnit::fileId() const
|
||||
const char *TranslationUnit::fileName() const
|
||||
{ return _fileId->chars(); }
|
||||
|
||||
unsigned TranslationUnit::fileNameLength() const
|
||||
int TranslationUnit::fileNameLength() const
|
||||
{ return _fileId->size(); }
|
||||
|
||||
const char *TranslationUnit::firstSourceChar() const
|
||||
@@ -79,16 +79,16 @@ const char *TranslationUnit::firstSourceChar() const
|
||||
const char *TranslationUnit::lastSourceChar() const
|
||||
{ return _lastSourceChar; }
|
||||
|
||||
unsigned TranslationUnit::sourceLength() const
|
||||
int TranslationUnit::sourceLength() const
|
||||
{ return _lastSourceChar - _firstSourceChar; }
|
||||
|
||||
void TranslationUnit::setSource(const char *source, unsigned size)
|
||||
void TranslationUnit::setSource(const char *source, int size)
|
||||
{
|
||||
_firstSourceChar = source;
|
||||
_lastSourceChar = source + size;
|
||||
}
|
||||
|
||||
const char *TranslationUnit::spell(unsigned index) const
|
||||
const char *TranslationUnit::spell(int index) const
|
||||
{
|
||||
if (! index)
|
||||
return 0;
|
||||
@@ -96,25 +96,25 @@ const char *TranslationUnit::spell(unsigned index) const
|
||||
return tokenAt(index).spell();
|
||||
}
|
||||
|
||||
unsigned TranslationUnit::commentCount() const
|
||||
{ return unsigned(_comments->size()); }
|
||||
int TranslationUnit::commentCount() const
|
||||
{ return int(_comments->size()); }
|
||||
|
||||
const Token &TranslationUnit::commentAt(unsigned index) const
|
||||
const Token &TranslationUnit::commentAt(int index) const
|
||||
{ return _comments->at(index); }
|
||||
|
||||
const Identifier *TranslationUnit::identifier(unsigned index) const
|
||||
const Identifier *TranslationUnit::identifier(int index) const
|
||||
{ return tokenAt(index).identifier; }
|
||||
|
||||
const Literal *TranslationUnit::literal(unsigned index) const
|
||||
const Literal *TranslationUnit::literal(int index) const
|
||||
{ return tokenAt(index).literal; }
|
||||
|
||||
const StringLiteral *TranslationUnit::stringLiteral(unsigned index) const
|
||||
const StringLiteral *TranslationUnit::stringLiteral(int index) const
|
||||
{ return tokenAt(index).string; }
|
||||
|
||||
const NumericLiteral *TranslationUnit::numericLiteral(unsigned index) const
|
||||
const NumericLiteral *TranslationUnit::numericLiteral(int index) const
|
||||
{ return tokenAt(index).number; }
|
||||
|
||||
unsigned TranslationUnit::matchingBrace(unsigned index) const
|
||||
int TranslationUnit::matchingBrace(int index) const
|
||||
{ return tokenAt(index).close_brace; }
|
||||
|
||||
MemoryPool *TranslationUnit::memoryPool() const
|
||||
@@ -140,7 +140,7 @@ void TranslationUnit::tokenize()
|
||||
lex.setLanguageFeatures(_languageFeatures);
|
||||
lex.setScanCommentTokens(true);
|
||||
|
||||
std::stack<unsigned> braces;
|
||||
std::stack<int> braces;
|
||||
_tokens->push_back(nullToken); // the first token needs to be invalid!
|
||||
|
||||
pushLineOffset(0);
|
||||
@@ -153,8 +153,8 @@ void TranslationUnit::tokenize()
|
||||
|
||||
// We need to track information about the expanded tokens. A vector with an addition
|
||||
// explicit index control is used instead of queue mainly for performance reasons.
|
||||
std::vector<std::pair<unsigned, unsigned> > lineColumn;
|
||||
unsigned lineColumnIdx = 0;
|
||||
std::vector<std::pair<int, int> > lineColumn;
|
||||
int lineColumnIdx = 0;
|
||||
|
||||
Token tk;
|
||||
do {
|
||||
@@ -162,7 +162,7 @@ void TranslationUnit::tokenize()
|
||||
|
||||
recognize:
|
||||
if (tk.is(T_POUND) && tk.newline()) {
|
||||
const unsigned utf16CharOffset = tk.utf16charOffset;
|
||||
const int utf16CharOffset = tk.utf16charOffset;
|
||||
lex(&tk);
|
||||
|
||||
if (! tk.newline() && tk.is(T_IDENTIFIER) && tk.identifier == expansionId) {
|
||||
@@ -175,10 +175,10 @@ recognize:
|
||||
lex(&tk);
|
||||
|
||||
// Gather where the expansion happens and its length.
|
||||
//unsigned macroOffset = static_cast<unsigned>(strtoul(tk.spell(), 0, 0));
|
||||
//int macroOffset = static_cast<int>(strtoul(tk.spell(), 0, 0));
|
||||
lex(&tk);
|
||||
lex(&tk); // Skip the separating comma
|
||||
//unsigned macroLength = static_cast<unsigned>(strtoul(tk.spell(), 0, 0));
|
||||
//int macroLength = static_cast<int>(strtoul(tk.spell(), 0, 0));
|
||||
lex(&tk);
|
||||
|
||||
// NOTE: We are currently not using the macro offset and length. They
|
||||
@@ -198,7 +198,7 @@ recognize:
|
||||
// Get the total number of generated tokens and specify "null"
|
||||
// information for them.
|
||||
unsigned totalGenerated =
|
||||
static_cast<unsigned>(strtoul(tk.spell(), 0, 0));
|
||||
static_cast<int>(strtoul(tk.spell(), 0, 0));
|
||||
const std::size_t previousSize = lineColumn.size();
|
||||
lineColumn.resize(previousSize + totalGenerated);
|
||||
std::fill(lineColumn.begin() + previousSize,
|
||||
@@ -207,10 +207,10 @@ recognize:
|
||||
|
||||
lex(&tk);
|
||||
} else if (tk.is(T_NUMERIC_LITERAL)) {
|
||||
unsigned line = static_cast<unsigned>(strtoul(tk.spell(), 0, 0));
|
||||
int line = static_cast<int>(strtoul(tk.spell(), 0, 0));
|
||||
lex(&tk);
|
||||
lex(&tk); // Skip the separating colon
|
||||
unsigned column = static_cast<unsigned>(strtoul(tk.spell(), 0, 0));
|
||||
int column = static_cast<int>(strtoul(tk.spell(), 0, 0));
|
||||
|
||||
// Store line and column for this non-generated token.
|
||||
lineColumn.push_back(std::make_pair(line, column));
|
||||
@@ -230,7 +230,7 @@ recognize:
|
||||
if (! tk.newline() && tk.is(T_IDENTIFIER) && tk.identifier == lineId)
|
||||
lex(&tk);
|
||||
if (! tk.newline() && tk.is(T_NUMERIC_LITERAL)) {
|
||||
unsigned line = (unsigned) strtoul(tk.spell(), 0, 0);
|
||||
int line = static_cast<int>(strtol(tk.spell(), 0, 0));
|
||||
lex(&tk);
|
||||
if (! tk.newline() && tk.is(T_STRING_LITERAL)) {
|
||||
const StringLiteral *fileName =
|
||||
@@ -244,12 +244,12 @@ recognize:
|
||||
}
|
||||
goto recognize;
|
||||
} else if (tk.kind() == T_LBRACE) {
|
||||
braces.push(unsigned(_tokens->size()));
|
||||
braces.push(int(_tokens->size()));
|
||||
} else if (tk.kind() == T_RBRACE && ! braces.empty()) {
|
||||
const unsigned open_brace_index = braces.top();
|
||||
const int open_brace_index = braces.top();
|
||||
braces.pop();
|
||||
if (open_brace_index < tokenCount())
|
||||
(*_tokens)[open_brace_index].close_brace = unsigned(_tokens->size());
|
||||
(*_tokens)[open_brace_index].close_brace = int(_tokens->size());
|
||||
} else if (tk.isComment()) {
|
||||
_comments->push_back(tk);
|
||||
continue; // comments are not in the regular token stream
|
||||
@@ -258,9 +258,9 @@ recognize:
|
||||
bool currentExpanded = false;
|
||||
bool currentGenerated = false;
|
||||
|
||||
if (!lineColumn.empty() && lineColumnIdx < lineColumn.size()) {
|
||||
if (!lineColumn.empty() && lineColumnIdx < static_cast<int>(lineColumn.size())) {
|
||||
currentExpanded = true;
|
||||
const std::pair<unsigned, unsigned> &p = lineColumn[lineColumnIdx];
|
||||
const std::pair<int, int> &p = lineColumn[lineColumnIdx];
|
||||
if (p.first)
|
||||
_expandedLineColumn.insert(std::make_pair(tk.utf16charsBegin(), p));
|
||||
else
|
||||
@@ -276,8 +276,8 @@ recognize:
|
||||
} while (tk.kind());
|
||||
|
||||
for (; ! braces.empty(); braces.pop()) {
|
||||
unsigned open_brace_index = braces.top();
|
||||
(*_tokens)[open_brace_index].close_brace = unsigned(_tokens->size());
|
||||
int open_brace_index = braces.top();
|
||||
(*_tokens)[open_brace_index].close_brace = int(_tokens->size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,17 +338,17 @@ bool TranslationUnit::parse(ParseMode mode)
|
||||
return parsed;
|
||||
}
|
||||
|
||||
void TranslationUnit::pushLineOffset(unsigned offset)
|
||||
void TranslationUnit::pushLineOffset(int offset)
|
||||
{ _lineOffsets.push_back(offset); }
|
||||
|
||||
void TranslationUnit::pushPreprocessorLine(unsigned utf16charOffset,
|
||||
unsigned line,
|
||||
void TranslationUnit::pushPreprocessorLine(int utf16charOffset,
|
||||
int line,
|
||||
const StringLiteral *fileName)
|
||||
{ _ppLines.push_back(PPLine(utf16charOffset, line, fileName)); }
|
||||
|
||||
unsigned TranslationUnit::findLineNumber(unsigned utf16charOffset) const
|
||||
int TranslationUnit::findLineNumber(int utf16charOffset) const
|
||||
{
|
||||
std::vector<unsigned>::const_iterator it =
|
||||
std::vector<int>::const_iterator it =
|
||||
std::lower_bound(_lineOffsets.begin(), _lineOffsets.end(), utf16charOffset);
|
||||
|
||||
if (it != _lineOffsets.begin())
|
||||
@@ -357,7 +357,7 @@ unsigned TranslationUnit::findLineNumber(unsigned utf16charOffset) const
|
||||
return it - _lineOffsets.begin();
|
||||
}
|
||||
|
||||
TranslationUnit::PPLine TranslationUnit::findPreprocessorLine(unsigned utf16charOffset) const
|
||||
TranslationUnit::PPLine TranslationUnit::findPreprocessorLine(int utf16charOffset) const
|
||||
{
|
||||
std::vector<PPLine>::const_iterator it =
|
||||
std::lower_bound(_ppLines.begin(), _ppLines.end(), PPLine(utf16charOffset));
|
||||
@@ -368,7 +368,7 @@ TranslationUnit::PPLine TranslationUnit::findPreprocessorLine(unsigned utf16char
|
||||
return *it;
|
||||
}
|
||||
|
||||
unsigned TranslationUnit::findColumnNumber(unsigned utf16CharOffset, unsigned lineNumber) const
|
||||
int TranslationUnit::findColumnNumber(int utf16CharOffset, int lineNumber) const
|
||||
{
|
||||
if (! utf16CharOffset)
|
||||
return 0;
|
||||
@@ -376,29 +376,29 @@ unsigned TranslationUnit::findColumnNumber(unsigned utf16CharOffset, unsigned li
|
||||
return utf16CharOffset - _lineOffsets[lineNumber];
|
||||
}
|
||||
|
||||
void TranslationUnit::getTokenPosition(unsigned index,
|
||||
unsigned *line,
|
||||
unsigned *column,
|
||||
void TranslationUnit::getTokenPosition(int index,
|
||||
int *line,
|
||||
int *column,
|
||||
const StringLiteral **fileName) const
|
||||
{ return getPosition(tokenAt(index).utf16charsBegin(), line, column, fileName); }
|
||||
|
||||
void TranslationUnit::getTokenStartPosition(unsigned index, unsigned *line,
|
||||
unsigned *column,
|
||||
void TranslationUnit::getTokenStartPosition(int index, int *line,
|
||||
int *column,
|
||||
const StringLiteral **fileName) const
|
||||
{ return getPosition(tokenAt(index).utf16charsBegin(), line, column, fileName); }
|
||||
|
||||
void TranslationUnit::getTokenEndPosition(unsigned index, unsigned *line,
|
||||
unsigned *column,
|
||||
void TranslationUnit::getTokenEndPosition(int index, int *line,
|
||||
int *column,
|
||||
const StringLiteral **fileName) const
|
||||
{ return getPosition(tokenAt(index).utf16charsEnd(), line, column, fileName); }
|
||||
|
||||
void TranslationUnit::getPosition(unsigned utf16charOffset,
|
||||
unsigned *line,
|
||||
unsigned *column,
|
||||
void TranslationUnit::getPosition(int utf16charOffset,
|
||||
int *line,
|
||||
int *column,
|
||||
const StringLiteral **fileName) const
|
||||
{
|
||||
unsigned lineNumber = 0;
|
||||
unsigned columnNumber = 0;
|
||||
int lineNumber = 0;
|
||||
int columnNumber = 0;
|
||||
const StringLiteral *file = 0;
|
||||
|
||||
// If this token is expanded we already have the information directly from the expansion
|
||||
@@ -433,14 +433,14 @@ void TranslationUnit::getPosition(unsigned utf16charOffset,
|
||||
*fileName = file;
|
||||
}
|
||||
|
||||
void TranslationUnit::message(DiagnosticClient::Level level, unsigned index, const char *format, va_list args)
|
||||
void TranslationUnit::message(DiagnosticClient::Level level, int index, const char *format, va_list args)
|
||||
{
|
||||
if (f._blockErrors)
|
||||
return;
|
||||
|
||||
index = std::min(index, tokenCount() - 1);
|
||||
|
||||
unsigned line = 0, column = 0;
|
||||
int line = 0, column = 0;
|
||||
const StringLiteral *fileName = 0;
|
||||
getTokenPosition(index, &line, &column, &fileName);
|
||||
|
||||
@@ -448,7 +448,7 @@ void TranslationUnit::message(DiagnosticClient::Level level, unsigned index, con
|
||||
client->report(level, fileName, line, column, format, args);
|
||||
}
|
||||
|
||||
void TranslationUnit::warning(unsigned index, const char *format, ...)
|
||||
void TranslationUnit::warning(int index, const char *format, ...)
|
||||
{
|
||||
if (f._blockErrors)
|
||||
return;
|
||||
@@ -461,7 +461,7 @@ void TranslationUnit::warning(unsigned index, const char *format, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void TranslationUnit::error(unsigned index, const char *format, ...)
|
||||
void TranslationUnit::error(int index, const char *format, ...)
|
||||
{
|
||||
if (f._blockErrors)
|
||||
return;
|
||||
@@ -474,7 +474,7 @@ void TranslationUnit::error(unsigned index, const char *format, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void TranslationUnit::fatal(unsigned index, const char *format, ...)
|
||||
void TranslationUnit::fatal(int index, const char *format, ...)
|
||||
{
|
||||
if (f._blockErrors)
|
||||
return;
|
||||
@@ -487,13 +487,13 @@ void TranslationUnit::fatal(unsigned index, const char *format, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
unsigned TranslationUnit::findPreviousLineOffset(unsigned tokenIndex) const
|
||||
int TranslationUnit::findPreviousLineOffset(int tokenIndex) const
|
||||
{
|
||||
unsigned lineOffset = _lineOffsets[findLineNumber(tokenAt(tokenIndex).utf16charsBegin())];
|
||||
int lineOffset = _lineOffsets[findLineNumber(tokenAt(tokenIndex).utf16charsBegin())];
|
||||
return lineOffset;
|
||||
}
|
||||
|
||||
bool TranslationUnit::maybeSplitGreaterGreaterToken(unsigned tokenIndex)
|
||||
bool TranslationUnit::maybeSplitGreaterGreaterToken(int tokenIndex)
|
||||
{
|
||||
if (tokenIndex >= tokenCount())
|
||||
return false;
|
||||
|
92
src/libs/3rdparty/cplusplus/TranslationUnit.h
vendored
92
src/libs/3rdparty/cplusplus/TranslationUnit.h
vendored
@@ -43,29 +43,29 @@ public:
|
||||
|
||||
const StringLiteral *fileId() const;
|
||||
const char *fileName() const;
|
||||
unsigned fileNameLength() const;
|
||||
int fileNameLength() const;
|
||||
|
||||
const char *firstSourceChar() const;
|
||||
const char *lastSourceChar() const;
|
||||
unsigned sourceLength() const;
|
||||
int sourceLength() const;
|
||||
|
||||
void setSource(const char *source, unsigned size);
|
||||
void setSource(const char *source, int size);
|
||||
|
||||
unsigned tokenCount() const { return _tokens ? unsigned(_tokens->size()) : unsigned(0); }
|
||||
const Token &tokenAt(unsigned index) const
|
||||
int tokenCount() const { return _tokens ? int(_tokens->size()) : 0; }
|
||||
const Token &tokenAt(int index) const
|
||||
{ return _tokens && index < tokenCount() ? (*_tokens)[index] : nullToken; }
|
||||
|
||||
Kind tokenKind(unsigned index) const { return tokenAt(index).kind(); }
|
||||
const char *spell(unsigned index) const;
|
||||
Kind tokenKind(int index) const { return tokenAt(index).kind(); }
|
||||
const char *spell(int index) const;
|
||||
|
||||
unsigned commentCount() const;
|
||||
const Token &commentAt(unsigned index) const;
|
||||
int commentCount() const;
|
||||
const Token &commentAt(int index) const;
|
||||
|
||||
unsigned matchingBrace(unsigned index) const;
|
||||
const Identifier *identifier(unsigned index) const;
|
||||
const Literal *literal(unsigned index) const;
|
||||
const StringLiteral *stringLiteral(unsigned index) const;
|
||||
const NumericLiteral *numericLiteral(unsigned index) const;
|
||||
int matchingBrace(int index) const;
|
||||
const Identifier *identifier(int index) const;
|
||||
const Literal *literal(int index) const;
|
||||
const StringLiteral *stringLiteral(int index) const;
|
||||
const NumericLiteral *numericLiteral(int index) const;
|
||||
|
||||
MemoryPool *memoryPool() const;
|
||||
AST *ast() const;
|
||||
@@ -78,11 +78,11 @@ public:
|
||||
return previous;
|
||||
}
|
||||
|
||||
void warning(unsigned index, const char *fmt, ...);
|
||||
void error(unsigned index, const char *fmt, ...);
|
||||
void fatal(unsigned index, const char *fmt, ...);
|
||||
void warning(int index, const char *fmt, ...);
|
||||
void error(int index, const char *fmt, ...);
|
||||
void fatal(int index, const char *fmt, ...);
|
||||
|
||||
void message(DiagnosticClient::Level level, unsigned index,
|
||||
void message(DiagnosticClient::Level level, int index,
|
||||
const char *format, va_list ap);
|
||||
|
||||
bool isTokenized() const;
|
||||
@@ -106,44 +106,44 @@ public:
|
||||
void resetAST();
|
||||
void release();
|
||||
|
||||
void getTokenStartPosition(unsigned index, unsigned *line,
|
||||
unsigned *column = 0,
|
||||
const StringLiteral **fileName = 0) const;
|
||||
void getTokenStartPosition(int index, int *line,
|
||||
int *column = nullptr,
|
||||
const StringLiteral **fileName = nullptr) const;
|
||||
|
||||
void getTokenEndPosition(unsigned index, unsigned *line,
|
||||
unsigned *column = 0,
|
||||
const StringLiteral **fileName = 0) const;
|
||||
void getTokenEndPosition(int index, int *line,
|
||||
int *column = nullptr,
|
||||
const StringLiteral **fileName = nullptr) const;
|
||||
|
||||
void getPosition(unsigned utf16charOffset,
|
||||
unsigned *line,
|
||||
unsigned *column = 0,
|
||||
const StringLiteral **fileName = 0) const;
|
||||
void getPosition(int utf16charOffset,
|
||||
int *line,
|
||||
int *column = nullptr,
|
||||
const StringLiteral **fileName = nullptr) const;
|
||||
|
||||
void getTokenPosition(unsigned index,
|
||||
unsigned *line,
|
||||
unsigned *column = 0,
|
||||
const StringLiteral **fileName = 0) const;
|
||||
void getTokenPosition(int index,
|
||||
int *line,
|
||||
int *column = nullptr,
|
||||
const StringLiteral **fileName = nullptr) const;
|
||||
|
||||
void pushLineOffset(unsigned offset);
|
||||
void pushPreprocessorLine(unsigned utf16charOffset,
|
||||
unsigned line,
|
||||
void pushLineOffset(int offset);
|
||||
void pushPreprocessorLine(int utf16charOffset,
|
||||
int line,
|
||||
const StringLiteral *fileName);
|
||||
|
||||
unsigned findPreviousLineOffset(unsigned tokenIndex) const;
|
||||
int findPreviousLineOffset(int tokenIndex) const;
|
||||
|
||||
bool maybeSplitGreaterGreaterToken(unsigned tokenIndex);
|
||||
bool maybeSplitGreaterGreaterToken(int tokenIndex);
|
||||
|
||||
LanguageFeatures languageFeatures() const { return _languageFeatures; }
|
||||
void setLanguageFeatures(LanguageFeatures features) { _languageFeatures = features; }
|
||||
|
||||
private:
|
||||
struct PPLine {
|
||||
unsigned utf16charOffset;
|
||||
unsigned line;
|
||||
int utf16charOffset;
|
||||
int line;
|
||||
const StringLiteral *fileName;
|
||||
|
||||
PPLine(unsigned utf16charOffset = 0,
|
||||
unsigned line = 0,
|
||||
PPLine(int utf16charOffset = 0,
|
||||
int line = 0,
|
||||
const StringLiteral *fileName = 0)
|
||||
: utf16charOffset(utf16charOffset), line(line), fileName(fileName)
|
||||
{ }
|
||||
@@ -159,9 +159,9 @@ private:
|
||||
};
|
||||
|
||||
void releaseTokensAndComments();
|
||||
unsigned findLineNumber(unsigned utf16charOffset) const;
|
||||
unsigned findColumnNumber(unsigned utf16CharOffset, unsigned lineNumber) const;
|
||||
PPLine findPreprocessorLine(unsigned utf16charOffset) const;
|
||||
int findLineNumber(int utf16charOffset) const;
|
||||
int findColumnNumber(int utf16CharOffset, int lineNumber) const;
|
||||
PPLine findPreprocessorLine(int utf16charOffset) const;
|
||||
|
||||
static const Token nullToken;
|
||||
|
||||
@@ -171,9 +171,9 @@ private:
|
||||
const char *_lastSourceChar;
|
||||
std::vector<Token> *_tokens;
|
||||
std::vector<Token> *_comments;
|
||||
std::vector<unsigned> _lineOffsets;
|
||||
std::vector<int> _lineOffsets;
|
||||
std::vector<PPLine> _ppLines;
|
||||
typedef std::unordered_map<unsigned, std::pair<unsigned, unsigned> > TokenLineColumn;
|
||||
typedef std::unordered_map<unsigned, std::pair<int, int> > TokenLineColumn;
|
||||
TokenLineColumn _expandedLineColumn;
|
||||
MemoryPool *_pool;
|
||||
AST *_ast;
|
||||
|
@@ -36,8 +36,8 @@ class CLANGSUPPORT_EXPORT SourceLocationContainer
|
||||
public:
|
||||
SourceLocationContainer() = default;
|
||||
SourceLocationContainer(const Utf8String &filePath,
|
||||
uint line,
|
||||
uint column)
|
||||
int line,
|
||||
int column)
|
||||
: filePath(filePath),
|
||||
line(line),
|
||||
column(column)
|
||||
@@ -46,8 +46,8 @@ public:
|
||||
|
||||
public:
|
||||
Utf8String filePath;
|
||||
uint line = 0;
|
||||
uint column = 0;
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
};
|
||||
|
||||
CLANGSUPPORT_EXPORT QDataStream &operator<<(QDataStream &out, const SourceLocationContainer &container);
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool contains(unsigned line, unsigned column) const
|
||||
bool contains(int line, int column) const
|
||||
{
|
||||
if (line < start.line || line > end.line)
|
||||
return false;
|
||||
|
@@ -103,7 +103,7 @@ class TokenInfoContainer
|
||||
{
|
||||
public:
|
||||
TokenInfoContainer() = default;
|
||||
TokenInfoContainer(uint line, uint column, uint length, HighlightingTypes types)
|
||||
TokenInfoContainer(int line, int column, int length, HighlightingTypes types)
|
||||
: line(line)
|
||||
, column(column)
|
||||
, length(length)
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
TokenInfoContainer(uint line, uint column, uint length, HighlightingTypes types,
|
||||
TokenInfoContainer(int line, int column, int length, HighlightingTypes types,
|
||||
const ExtraInfo &extraInfo)
|
||||
: line(line)
|
||||
, column(column)
|
||||
@@ -184,9 +184,9 @@ public:
|
||||
&& first.extraInfo == second.extraInfo;
|
||||
}
|
||||
|
||||
uint line = 0;
|
||||
uint column = 0;
|
||||
uint length = 0;
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
int length = 0;
|
||||
HighlightingTypes types;
|
||||
ExtraInfo extraInfo;
|
||||
bool noExtraInfo = true;
|
||||
|
@@ -67,12 +67,12 @@ bool ASTPath::preVisit(AST *ast)
|
||||
if (lastToken <= firstToken)
|
||||
return false;
|
||||
|
||||
unsigned startLine, startColumn;
|
||||
int startLine, startColumn;
|
||||
getTokenStartPosition(firstToken, &startLine, &startColumn);
|
||||
|
||||
if (_line > startLine || (_line == startLine && _column >= startColumn)) {
|
||||
|
||||
unsigned endLine, endColumn;
|
||||
int endLine, endColumn;
|
||||
getTokenEndPosition(lastToken - 1, &endLine, &endColumn);
|
||||
|
||||
if (_line < endLine || (_line == endLine && _column <= endColumn)) {
|
||||
|
@@ -64,8 +64,8 @@ private:
|
||||
|
||||
private:
|
||||
Document::Ptr _doc;
|
||||
unsigned _line;
|
||||
unsigned _column;
|
||||
int _line;
|
||||
int _column;
|
||||
QList<AST *> _nodes;
|
||||
};
|
||||
|
||||
|
@@ -61,15 +61,15 @@ namespace {
|
||||
class LastVisibleSymbolAt: protected SymbolVisitor
|
||||
{
|
||||
Symbol *root;
|
||||
unsigned line;
|
||||
unsigned column;
|
||||
int line;
|
||||
int column;
|
||||
Symbol *symbol;
|
||||
|
||||
public:
|
||||
LastVisibleSymbolAt(Symbol *root)
|
||||
: root(root), line(0), column(0), symbol(0) {}
|
||||
|
||||
Symbol *operator()(unsigned line, unsigned column)
|
||||
Symbol *operator()(int line, int column)
|
||||
{
|
||||
this->line = line;
|
||||
this->column = column;
|
||||
@@ -97,13 +97,13 @@ protected:
|
||||
class FindScopeAt: protected SymbolVisitor
|
||||
{
|
||||
TranslationUnit *_unit;
|
||||
unsigned _line;
|
||||
unsigned _column;
|
||||
int _line;
|
||||
int _column;
|
||||
Scope *_scope;
|
||||
|
||||
public:
|
||||
/** line and column should be 1-based */
|
||||
FindScopeAt(TranslationUnit *unit, unsigned line, unsigned column)
|
||||
FindScopeAt(TranslationUnit *unit, int line, int column)
|
||||
: _unit(unit), _line(line), _column(column), _scope(0) {}
|
||||
|
||||
Scope *operator()(Symbol *symbol)
|
||||
@@ -118,18 +118,18 @@ protected:
|
||||
if (! _scope) {
|
||||
Scope *scope = symbol;
|
||||
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
for (int i = 0; i < scope->memberCount(); ++i) {
|
||||
accept(scope->memberAt(i));
|
||||
|
||||
if (_scope)
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned startLine, startColumn;
|
||||
int startLine, startColumn;
|
||||
_unit->getPosition(scope->startOffset(), &startLine, &startColumn);
|
||||
|
||||
if (_line > startLine || (_line == startLine && _column >= startColumn)) {
|
||||
unsigned endLine, endColumn;
|
||||
int endLine, endColumn;
|
||||
_unit->getPosition(scope->endOffset(), &endLine, &endColumn);
|
||||
|
||||
if (_line < endLine || (_line == endLine && _column < endColumn))
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
|
||||
void report(int level,
|
||||
const StringLiteral *fileId,
|
||||
unsigned line, unsigned column,
|
||||
int line, int column,
|
||||
const char *format, va_list ap) override
|
||||
{
|
||||
if (level == Error) {
|
||||
@@ -375,9 +375,9 @@ void Document::appendMacro(const Macro ¯o)
|
||||
}
|
||||
|
||||
void Document::addMacroUse(const Macro ¯o,
|
||||
unsigned bytesOffset, unsigned bytesLength,
|
||||
unsigned utf16charsOffset, unsigned utf16charLength,
|
||||
unsigned beginLine,
|
||||
int bytesOffset, int bytesLength,
|
||||
int utf16charsOffset, int utf16charLength,
|
||||
int beginLine,
|
||||
const QVector<MacroArgumentReference> &actuals)
|
||||
{
|
||||
MacroUse use(macro,
|
||||
@@ -397,7 +397,7 @@ void Document::addMacroUse(const Macro ¯o,
|
||||
}
|
||||
|
||||
void Document::addUndefinedMacroUse(const QByteArray &name,
|
||||
unsigned bytesOffset, unsigned utf16charsOffset)
|
||||
int bytesOffset, int utf16charsOffset)
|
||||
{
|
||||
QByteArray copy(name.data(), name.size());
|
||||
UndefinedMacroUse use(copy, bytesOffset, utf16charsOffset);
|
||||
@@ -468,7 +468,7 @@ void Document::setSkipFunctionBody(bool skipFunctionBody)
|
||||
_translationUnit->setSkipFunctionBody(skipFunctionBody);
|
||||
}
|
||||
|
||||
unsigned Document::globalSymbolCount() const
|
||||
int Document::globalSymbolCount() const
|
||||
{
|
||||
if (! _globalNamespace)
|
||||
return 0;
|
||||
@@ -476,7 +476,7 @@ unsigned Document::globalSymbolCount() const
|
||||
return _globalNamespace->memberCount();
|
||||
}
|
||||
|
||||
Symbol *Document::globalSymbolAt(unsigned index) const
|
||||
Symbol *Document::globalSymbolAt(int index) const
|
||||
{
|
||||
return _globalNamespace->memberAt(index);
|
||||
}
|
||||
@@ -527,23 +527,17 @@ QString Document::functionAt(int line, int column, int *lineOpeningDeclaratorPar
|
||||
return QString();
|
||||
|
||||
// We found the function scope
|
||||
if (lineOpeningDeclaratorParenthesis) {
|
||||
unsigned line;
|
||||
translationUnit()->getPosition(scope->startOffset(), &line);
|
||||
*lineOpeningDeclaratorParenthesis = static_cast<int>(line);
|
||||
}
|
||||
if (lineOpeningDeclaratorParenthesis)
|
||||
translationUnit()->getPosition(scope->startOffset(), lineOpeningDeclaratorParenthesis);
|
||||
|
||||
if (lineClosingBrace) {
|
||||
unsigned line;
|
||||
translationUnit()->getPosition(scope->endOffset(), &line);
|
||||
*lineClosingBrace = static_cast<int>(line);
|
||||
}
|
||||
if (lineClosingBrace)
|
||||
translationUnit()->getPosition(scope->endOffset(), lineClosingBrace);
|
||||
|
||||
const QList<const Name *> fullyQualifiedName = LookupContext::fullyQualifiedName(scope);
|
||||
return Overview().prettyName(fullyQualifiedName);
|
||||
}
|
||||
|
||||
Scope *Document::scopeAt(unsigned line, unsigned column)
|
||||
Scope *Document::scopeAt(int line, int column)
|
||||
{
|
||||
FindScopeAt findScopeAt(_translationUnit, line, column);
|
||||
if (Scope *scope = findScopeAt(_globalNamespace))
|
||||
@@ -551,13 +545,13 @@ Scope *Document::scopeAt(unsigned line, unsigned column)
|
||||
return globalNamespace();
|
||||
}
|
||||
|
||||
Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column) const
|
||||
Symbol *Document::lastVisibleSymbolAt(int line, int column) const
|
||||
{
|
||||
LastVisibleSymbolAt lastVisibleSymbolAt(globalNamespace());
|
||||
return lastVisibleSymbolAt(line, column);
|
||||
}
|
||||
|
||||
const Macro *Document::findMacroDefinitionAt(unsigned line) const
|
||||
const Macro *Document::findMacroDefinitionAt(int line) const
|
||||
{
|
||||
foreach (const Macro ¯o, _definedMacros) {
|
||||
if (macro.line() == line)
|
||||
@@ -566,7 +560,7 @@ const Macro *Document::findMacroDefinitionAt(unsigned line) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
const Document::MacroUse *Document::findMacroUseAt(unsigned utf16charsOffset) const
|
||||
const Document::MacroUse *Document::findMacroUseAt(int utf16charsOffset) const
|
||||
{
|
||||
foreach (const Document::MacroUse &use, _macroUses) {
|
||||
if (use.containsUtf16charOffset(utf16charsOffset)
|
||||
@@ -577,7 +571,7 @@ const Document::MacroUse *Document::findMacroUseAt(unsigned utf16charsOffset) co
|
||||
return 0;
|
||||
}
|
||||
|
||||
const Document::UndefinedMacroUse *Document::findUndefinedMacroUseAt(unsigned utf16charsOffset) const
|
||||
const Document::UndefinedMacroUse *Document::findUndefinedMacroUseAt(int utf16charsOffset) const
|
||||
{
|
||||
foreach (const Document::UndefinedMacroUse &use, _undefinedMacroUses) {
|
||||
if (use.containsUtf16charOffset(utf16charsOffset)
|
||||
@@ -616,17 +610,17 @@ void Document::setLanguageFeatures(LanguageFeatures features)
|
||||
tu->setLanguageFeatures(features);
|
||||
}
|
||||
|
||||
void Document::startSkippingBlocks(unsigned utf16charsOffset)
|
||||
void Document::startSkippingBlocks(int utf16charsOffset)
|
||||
{
|
||||
_skippedBlocks.append(Block(0, 0, utf16charsOffset, 0));
|
||||
}
|
||||
|
||||
void Document::stopSkippingBlocks(unsigned utf16charsOffset)
|
||||
void Document::stopSkippingBlocks(int utf16charsOffset)
|
||||
{
|
||||
if (_skippedBlocks.isEmpty())
|
||||
return;
|
||||
|
||||
unsigned start = _skippedBlocks.back().utf16charsBegin();
|
||||
int start = _skippedBlocks.back().utf16charsBegin();
|
||||
if (start > utf16charsOffset)
|
||||
_skippedBlocks.removeLast(); // Ignore this block, it's invalid.
|
||||
else
|
||||
@@ -783,7 +777,7 @@ static QList<Macro> macrosDefinedUntilLine(const QList<Macro> ¯os, int line)
|
||||
QList<Macro> filtered;
|
||||
|
||||
foreach (const Macro ¯o, macros) {
|
||||
if (macro.line() <= unsigned(line))
|
||||
if (macro.line() <= line)
|
||||
filtered.append(macro);
|
||||
else
|
||||
break;
|
||||
|
@@ -71,11 +71,11 @@ public:
|
||||
|
||||
void appendMacro(const Macro ¯o);
|
||||
void addMacroUse(const Macro ¯o,
|
||||
unsigned bytesOffset, unsigned bytesLength,
|
||||
unsigned utf16charsOffset, unsigned utf16charLength,
|
||||
unsigned beginLine, const QVector<MacroArgumentReference> &range);
|
||||
int bytesOffset, int bytesLength,
|
||||
int utf16charsOffset, int utf16charLength,
|
||||
int beginLine, const QVector<MacroArgumentReference> &range);
|
||||
void addUndefinedMacroUse(const QByteArray &name,
|
||||
unsigned bytesOffset, unsigned utf16charsOffset);
|
||||
int bytesOffset, int utf16charsOffset);
|
||||
|
||||
Control *control() const;
|
||||
Control *swapControl(Control *newControl);
|
||||
@@ -84,8 +84,8 @@ public:
|
||||
bool skipFunctionBody() const;
|
||||
void setSkipFunctionBody(bool skipFunctionBody);
|
||||
|
||||
unsigned globalSymbolCount() const;
|
||||
Symbol *globalSymbolAt(unsigned index) const;
|
||||
int globalSymbolCount() const;
|
||||
Symbol *globalSymbolAt(int index) const;
|
||||
|
||||
Namespace *globalNamespace() const;
|
||||
void setGlobalNamespace(Namespace *globalNamespace); // ### internal
|
||||
@@ -93,10 +93,10 @@ public:
|
||||
QList<Macro> definedMacros() const
|
||||
{ return _definedMacros; }
|
||||
|
||||
QString functionAt(int line, int column, int *lineOpeningDeclaratorParenthesis = 0,
|
||||
int *lineClosingBrace = 0) const;
|
||||
Symbol *lastVisibleSymbolAt(unsigned line, unsigned column = 0) const;
|
||||
Scope *scopeAt(unsigned line, unsigned column = 0);
|
||||
QString functionAt(int line, int column, int *lineOpeningDeclaratorParenthesis = nullptr,
|
||||
int *lineClosingBrace = nullptr) const;
|
||||
Symbol *lastVisibleSymbolAt(int line, int column = 0) const;
|
||||
Scope *scopeAt(int line, int column = 0);
|
||||
|
||||
QByteArray utf8Source() const;
|
||||
void setUtf8Source(const QByteArray &utf8Source);
|
||||
@@ -108,8 +108,8 @@ public:
|
||||
LanguageFeatures languageFeatures() const;
|
||||
void setLanguageFeatures(LanguageFeatures features);
|
||||
|
||||
void startSkippingBlocks(unsigned utf16charsOffset);
|
||||
void stopSkippingBlocks(unsigned utf16charsOffset);
|
||||
void startSkippingBlocks(int utf16charsOffset);
|
||||
void stopSkippingBlocks(int utf16charsOffset);
|
||||
|
||||
enum ParseMode { // ### keep in sync with CPlusPlus::TranslationUnit
|
||||
ParseTranlationUnit,
|
||||
@@ -146,9 +146,9 @@ public:
|
||||
|
||||
public:
|
||||
DiagnosticMessage(int level, const QString &fileName,
|
||||
unsigned line, unsigned column,
|
||||
int line, int column,
|
||||
const QString &text,
|
||||
unsigned length = 0)
|
||||
int length = 0)
|
||||
: _level(level),
|
||||
_line(line),
|
||||
_fileName(fileName),
|
||||
@@ -172,13 +172,13 @@ public:
|
||||
QString fileName() const
|
||||
{ return _fileName; }
|
||||
|
||||
unsigned line() const
|
||||
int line() const
|
||||
{ return _line; }
|
||||
|
||||
unsigned column() const
|
||||
int column() const
|
||||
{ return _column; }
|
||||
|
||||
unsigned length() const
|
||||
int length() const
|
||||
{ return _length; }
|
||||
|
||||
QString text() const
|
||||
@@ -189,10 +189,10 @@ public:
|
||||
|
||||
private:
|
||||
int _level;
|
||||
unsigned _line;
|
||||
int _line;
|
||||
QString _fileName;
|
||||
unsigned _column;
|
||||
unsigned _length;
|
||||
int _column;
|
||||
int _length;
|
||||
QString _text;
|
||||
};
|
||||
|
||||
@@ -207,44 +207,44 @@ public:
|
||||
|
||||
class Block
|
||||
{
|
||||
unsigned _bytesBegin;
|
||||
unsigned _bytesEnd;
|
||||
unsigned _utf16charsBegin;
|
||||
unsigned _utf16charsEnd;
|
||||
int _bytesBegin;
|
||||
int _bytesEnd;
|
||||
int _utf16charsBegin;
|
||||
int _utf16charsEnd;
|
||||
|
||||
public:
|
||||
inline Block(unsigned bytesBegin = 0, unsigned bytesEnd = 0,
|
||||
unsigned utf16charsBegin = 0, unsigned utf16charsEnd = 0)
|
||||
inline Block(int bytesBegin = 0, int bytesEnd = 0,
|
||||
int utf16charsBegin = 0, int utf16charsEnd = 0)
|
||||
: _bytesBegin(bytesBegin),
|
||||
_bytesEnd(bytesEnd),
|
||||
_utf16charsBegin(utf16charsBegin),
|
||||
_utf16charsEnd(utf16charsEnd)
|
||||
{}
|
||||
|
||||
inline unsigned bytesBegin() const
|
||||
inline int bytesBegin() const
|
||||
{ return _bytesBegin; }
|
||||
|
||||
inline unsigned bytesEnd() const
|
||||
inline int bytesEnd() const
|
||||
{ return _bytesEnd; }
|
||||
|
||||
inline unsigned utf16charsBegin() const
|
||||
inline int utf16charsBegin() const
|
||||
{ return _utf16charsBegin; }
|
||||
|
||||
inline unsigned utf16charsEnd() const
|
||||
inline int utf16charsEnd() const
|
||||
{ return _utf16charsEnd; }
|
||||
|
||||
bool containsUtf16charOffset(unsigned utf16charOffset) const
|
||||
bool containsUtf16charOffset(int utf16charOffset) const
|
||||
{ return utf16charOffset >= _utf16charsBegin && utf16charOffset < _utf16charsEnd; }
|
||||
};
|
||||
|
||||
class Include {
|
||||
QString _resolvedFileName;
|
||||
QString _unresolvedFileName;
|
||||
unsigned _line;
|
||||
int _line;
|
||||
Client::IncludeType _type;
|
||||
|
||||
public:
|
||||
Include(const QString &unresolvedFileName, const QString &resolvedFileName, unsigned line,
|
||||
Include(const QString &unresolvedFileName, const QString &resolvedFileName, int line,
|
||||
Client::IncludeType type)
|
||||
: _resolvedFileName(resolvedFileName)
|
||||
, _unresolvedFileName(unresolvedFileName)
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
QString unresolvedFileName() const
|
||||
{ return _unresolvedFileName; }
|
||||
|
||||
unsigned line() const
|
||||
int line() const
|
||||
{ return _line; }
|
||||
|
||||
Client::IncludeType type() const
|
||||
@@ -268,13 +268,13 @@ public:
|
||||
class MacroUse: public Block {
|
||||
Macro _macro;
|
||||
QVector<Block> _arguments;
|
||||
unsigned _beginLine;
|
||||
int _beginLine;
|
||||
|
||||
public:
|
||||
inline MacroUse(const Macro ¯o,
|
||||
unsigned bytesBegin, unsigned bytesEnd,
|
||||
unsigned utf16charsBegin, unsigned utf16charsEnd,
|
||||
unsigned beginLine)
|
||||
int bytesBegin, int bytesEnd,
|
||||
int utf16charsBegin, int utf16charsEnd,
|
||||
int beginLine)
|
||||
: Block(bytesBegin, bytesEnd, utf16charsBegin, utf16charsEnd),
|
||||
_macro(macro),
|
||||
_beginLine(beginLine)
|
||||
@@ -289,7 +289,7 @@ public:
|
||||
QVector<Block> arguments() const
|
||||
{ return _arguments; }
|
||||
|
||||
unsigned beginLine() const
|
||||
int beginLine() const
|
||||
{ return _beginLine; }
|
||||
|
||||
private:
|
||||
@@ -308,8 +308,8 @@ public:
|
||||
public:
|
||||
inline UndefinedMacroUse(
|
||||
const QByteArray &name,
|
||||
unsigned bytesBegin,
|
||||
unsigned utf16charsBegin)
|
||||
int bytesBegin,
|
||||
int utf16charsBegin)
|
||||
: Block(bytesBegin,
|
||||
bytesBegin + name.length(),
|
||||
utf16charsBegin,
|
||||
@@ -346,9 +346,9 @@ public:
|
||||
QByteArray includeGuardMacroName() const
|
||||
{ return _includeGuardMacroName; }
|
||||
|
||||
const Macro *findMacroDefinitionAt(unsigned line) const;
|
||||
const MacroUse *findMacroUseAt(unsigned utf16charsOffset) const;
|
||||
const UndefinedMacroUse *findUndefinedMacroUseAt(unsigned utf16charsOffset) const;
|
||||
const Macro *findMacroDefinitionAt(int line) const;
|
||||
const MacroUse *findMacroUseAt(int utf16charsOffset) const;
|
||||
const UndefinedMacroUse *findUndefinedMacroUseAt(int utf16charsOffset) const;
|
||||
|
||||
void keepSourceAndAST();
|
||||
void releaseSourceAndAST();
|
||||
@@ -397,7 +397,7 @@ public:
|
||||
|
||||
typedef Base::const_iterator iterator;
|
||||
typedef Base::const_iterator const_iterator;
|
||||
typedef QPair<Document::Ptr, unsigned> IncludeLocation;
|
||||
typedef QPair<Document::Ptr, int> IncludeLocation;
|
||||
|
||||
int size() const; // ### remove
|
||||
bool isEmpty() const;
|
||||
|
@@ -257,7 +257,7 @@ public:
|
||||
void visit(const TemplateNameId *name) override
|
||||
{
|
||||
QVarLengthArray<FullySpecifiedType, 8> args(name->templateArgumentCount());
|
||||
for (unsigned i = 0; i < name->templateArgumentCount(); ++i)
|
||||
for (int i = 0; i < name->templateArgumentCount(); ++i)
|
||||
args[i] = rewrite->rewriteType(name->templateArgumentAt(i));
|
||||
temps.append(control()->templateNameId(identifier(name->identifier()), name->isSpecialization(),
|
||||
args.data(), args.size()));
|
||||
@@ -282,7 +282,7 @@ public:
|
||||
void visit(const SelectorNameId *name) override
|
||||
{
|
||||
QVarLengthArray<const Name *, 8> names(name->nameCount());
|
||||
for (unsigned i = 0; i < name->nameCount(); ++i)
|
||||
for (int i = 0; i < name->nameCount(); ++i)
|
||||
names[i] = rewrite->rewriteName(name->nameAt(i));
|
||||
temps.append(control()->selectorNameId(names.constData(), names.size(), name->hasArguments()));
|
||||
}
|
||||
|
@@ -136,7 +136,7 @@ private:
|
||||
|
||||
fun->setReturnType(q->apply(funTy->returnType()));
|
||||
|
||||
for (unsigned i = 0, argc = funTy->argumentCount(); i < argc; ++i) {
|
||||
for (int i = 0, argc = funTy->argumentCount(); i < argc; ++i) {
|
||||
Argument *originalArgument = funTy->argumentAt(i)->asArgument();
|
||||
Argument *arg = control()->newArgument(/*sourceLocation*/ 0,
|
||||
originalArgument->name());
|
||||
@@ -243,7 +243,7 @@ private:
|
||||
void visit(const TemplateNameId *name) override
|
||||
{
|
||||
QVarLengthArray<FullySpecifiedType, 8> arguments(name->templateArgumentCount());
|
||||
for (unsigned i = 0; i < name->templateArgumentCount(); ++i) {
|
||||
for (int i = 0; i < name->templateArgumentCount(); ++i) {
|
||||
FullySpecifiedType argTy = name->templateArgumentAt(i);
|
||||
arguments[i] = q->apply(argTy);
|
||||
}
|
||||
@@ -266,7 +266,7 @@ private:
|
||||
|
||||
} else if (const TemplateNameId *templId = name->asTemplateNameId()) {
|
||||
QVarLengthArray<FullySpecifiedType, 8> arguments(templId->templateArgumentCount());
|
||||
for (unsigned templateArgIndex = 0; templateArgIndex < templId->templateArgumentCount();
|
||||
for (int templateArgIndex = 0; templateArgIndex < templId->templateArgumentCount();
|
||||
++templateArgIndex) {
|
||||
FullySpecifiedType argTy = templId->templateArgumentAt(templateArgIndex);
|
||||
arguments[templateArgIndex] = q->apply(argTy);
|
||||
@@ -403,7 +403,7 @@ FullySpecifiedType DeprecatedGenTemplateInstance::instantiate(const Name *classN
|
||||
if (Template *templ = candidate->enclosingTemplate()) {
|
||||
DeprecatedGenTemplateInstance::Substitution subst;
|
||||
|
||||
for (unsigned i = 0; i < templId->templateArgumentCount(); ++i) {
|
||||
for (int i = 0; i < templId->templateArgumentCount(); ++i) {
|
||||
FullySpecifiedType templArgTy = templId->templateArgumentAt(i);
|
||||
|
||||
if (i < templ->templateParameterCount()) {
|
||||
|
@@ -70,7 +70,7 @@ QByteArray FastPreprocessor::run(Document::Ptr newDoc,
|
||||
return preprocessed;
|
||||
}
|
||||
|
||||
void FastPreprocessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType mode,
|
||||
void FastPreprocessor::sourceNeeded(int line, const QString &fileName, IncludeType mode,
|
||||
const QStringList &initialIncludes)
|
||||
{
|
||||
Q_UNUSED(initialIncludes)
|
||||
@@ -115,8 +115,8 @@ static const Macro revision(const Snapshot &s, const Macro &m)
|
||||
return m;
|
||||
}
|
||||
|
||||
void FastPreprocessor::passedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
unsigned line, const Macro ¯o)
|
||||
void FastPreprocessor::passedMacroDefinitionCheck(int bytesOffset, int utf16charsOffset,
|
||||
int line, const Macro ¯o)
|
||||
{
|
||||
Q_ASSERT(_currentDoc);
|
||||
|
||||
@@ -126,7 +126,7 @@ void FastPreprocessor::passedMacroDefinitionCheck(unsigned bytesOffset, unsigned
|
||||
line, QVector<MacroArgumentReference>());
|
||||
}
|
||||
|
||||
void FastPreprocessor::failedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
void FastPreprocessor::failedMacroDefinitionCheck(int bytesOffset, int utf16charsOffset,
|
||||
const ByteArrayRef &name)
|
||||
{
|
||||
Q_ASSERT(_currentDoc);
|
||||
@@ -135,8 +135,8 @@ void FastPreprocessor::failedMacroDefinitionCheck(unsigned bytesOffset, unsigned
|
||||
bytesOffset, utf16charsOffset);
|
||||
}
|
||||
|
||||
void FastPreprocessor::notifyMacroReference(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
unsigned line, const Macro ¯o)
|
||||
void FastPreprocessor::notifyMacroReference(int bytesOffset, int utf16charsOffset,
|
||||
int line, const Macro ¯o)
|
||||
{
|
||||
Q_ASSERT(_currentDoc);
|
||||
|
||||
@@ -146,8 +146,8 @@ void FastPreprocessor::notifyMacroReference(unsigned bytesOffset, unsigned utf16
|
||||
line, QVector<MacroArgumentReference>());
|
||||
}
|
||||
|
||||
void FastPreprocessor::startExpandingMacro(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
unsigned line, const Macro ¯o,
|
||||
void FastPreprocessor::startExpandingMacro(int bytesOffset, int utf16charsOffset,
|
||||
int line, const Macro ¯o,
|
||||
const QVector<MacroArgumentReference> &actuals)
|
||||
{
|
||||
Q_ASSERT(_currentDoc);
|
||||
|
@@ -55,26 +55,26 @@ public:
|
||||
bool mergeDefinedMacrosOfDocument = false);
|
||||
|
||||
// CPlusPlus::Client
|
||||
virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode,
|
||||
virtual void sourceNeeded(int line, const QString &fileName, IncludeType mode,
|
||||
const QStringList &initialIncludes = QStringList());
|
||||
|
||||
virtual void macroAdded(const Macro &);
|
||||
|
||||
virtual void passedMacroDefinitionCheck(unsigned, unsigned, unsigned, const Macro &);
|
||||
virtual void failedMacroDefinitionCheck(unsigned, unsigned, const ByteArrayRef &);
|
||||
virtual void passedMacroDefinitionCheck(int, int, int, const Macro &);
|
||||
virtual void failedMacroDefinitionCheck(int, int, const ByteArrayRef &);
|
||||
|
||||
virtual void notifyMacroReference(unsigned, unsigned, unsigned, const Macro &);
|
||||
virtual void notifyMacroReference(int, int, int, const Macro &);
|
||||
|
||||
virtual void startExpandingMacro(unsigned,
|
||||
unsigned,
|
||||
unsigned,
|
||||
virtual void startExpandingMacro(int,
|
||||
int,
|
||||
int,
|
||||
const Macro &,
|
||||
const QVector<MacroArgumentReference> &);
|
||||
virtual void stopExpandingMacro(unsigned, const Macro &) {}
|
||||
virtual void stopExpandingMacro(int, const Macro &) {}
|
||||
virtual void markAsIncludeGuard(const QByteArray ¯oName);
|
||||
|
||||
virtual void startSkippingBlocks(unsigned) {}
|
||||
virtual void stopSkippingBlocks(unsigned) {}
|
||||
virtual void startSkippingBlocks(int) {}
|
||||
virtual void stopSkippingBlocks(int) {}
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
@@ -157,10 +157,10 @@ void FindUsages::reportResult(unsigned tokenIndex)
|
||||
|
||||
_processed.insert(tokenIndex);
|
||||
|
||||
unsigned line, col;
|
||||
int line, col;
|
||||
getTokenStartPosition(tokenIndex, &line, &col);
|
||||
QString lineText;
|
||||
if (line < _sourceLineEnds.size())
|
||||
if (line < int(_sourceLineEnds.size()))
|
||||
lineText = fetchLine(line);
|
||||
else
|
||||
lineText = matchingLine(tk);
|
||||
|
@@ -299,7 +299,7 @@ QList<LookupItem> LookupContext::lookupByUsing(const Name *name,
|
||||
if (name->isNameId() || name->isTemplateNameId()) {
|
||||
foreach (Symbol *s, bindingScope->symbols()) {
|
||||
if (Scope *scope = s->asScope()) {
|
||||
for (unsigned i = 0, count = scope->memberCount(); i < count; ++i) {
|
||||
for (int i = 0, count = scope->memberCount(); i < count; ++i) {
|
||||
if (UsingDeclaration *u = scope->memberAt(i)->asUsingDeclaration()) {
|
||||
if (const Name *usingDeclarationName = u->name()) {
|
||||
if (const QualifiedNameId *q
|
||||
@@ -362,7 +362,7 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope,
|
||||
if (! scope || ! name) {
|
||||
return 0;
|
||||
} else if (Block *block = scope->asBlock()) {
|
||||
for (unsigned i = 0; i < block->memberCount(); ++i) {
|
||||
for (int i = 0; i < block->memberCount(); ++i) {
|
||||
Symbol *m = block->memberAt(i);
|
||||
if (UsingNamespaceDirective *u = m->asUsingNamespaceDirective()) {
|
||||
if (ClassOrNamespace *uu = lookupType(u->name(), scope->enclosingNamespace())) {
|
||||
@@ -450,7 +450,7 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
|
||||
break;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
for (int i = 0; i < scope->memberCount(); ++i) {
|
||||
if (UsingNamespaceDirective *u = scope->memberAt(i)->asUsingNamespaceDirective()) {
|
||||
if (ClassOrNamespace *uu = lookupType(u->name(), scope->enclosingNamespace())) {
|
||||
candidates = uu->find(name);
|
||||
@@ -905,7 +905,7 @@ Symbol *ClassOrNamespace::lookupInScope(const QList<const Name *> &fullName)
|
||||
|
||||
for (int j = 0; j < symbols().size(); ++j) {
|
||||
if (Scope *scope = symbols().at(j)->asScope()) {
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
for (int i = 0; i < scope->memberCount(); ++i) {
|
||||
Symbol *s = scope->memberAt(i);
|
||||
_scopeLookupCache->insert(LookupContext::fullyQualifiedName(s), s);
|
||||
}
|
||||
@@ -994,9 +994,9 @@ static ClassOrNamespace *findSpecializationWithMatchingTemplateArgument(const Na
|
||||
foreach (Symbol *s, reference->symbols()) {
|
||||
if (Class *clazz = s->asClass()) {
|
||||
if (Template *templateSpecialization = clazz->enclosingTemplate()) {
|
||||
const unsigned argumentCountOfSpecialization
|
||||
const int argumentCountOfSpecialization
|
||||
= templateSpecialization->templateParameterCount();
|
||||
for (unsigned i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
for (int i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
if (TypenameArgument *tParam
|
||||
= templateSpecialization->templateParameterAt(i)->asTypenameArgument()) {
|
||||
if (const Name *name = tParam->name()) {
|
||||
@@ -1018,14 +1018,14 @@ ClassOrNamespace *ClassOrNamespace::findSpecialization(const TemplateNameId *tem
|
||||
for (TemplateNameIdTable::const_iterator cit = specializations.begin();
|
||||
cit != specializations.end(); ++cit) {
|
||||
const TemplateNameId *specializationNameId = cit->first;
|
||||
const unsigned specializationTemplateArgumentCount
|
||||
const int specializationTemplateArgumentCount
|
||||
= specializationNameId->templateArgumentCount();
|
||||
const unsigned initializationTemplateArgumentCount
|
||||
const int initializationTemplateArgumentCount
|
||||
= templId->templateArgumentCount();
|
||||
// for now it works only when we have the same number of arguments in specialization
|
||||
// and initialization(in future it should be more clever)
|
||||
if (specializationTemplateArgumentCount == initializationTemplateArgumentCount) {
|
||||
for (unsigned i = 0; i < initializationTemplateArgumentCount; ++i) {
|
||||
for (int i = 0; i < initializationTemplateArgumentCount; ++i) {
|
||||
const FullySpecifiedType &specializationTemplateArgument
|
||||
= specializationNameId->templateArgumentAt(i);
|
||||
const FullySpecifiedType &initializationTemplateArgument
|
||||
@@ -1155,7 +1155,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
QList<const Name *> allBases;
|
||||
foreach (Symbol *s, reference->symbols()) {
|
||||
if (Class *clazz = s->asClass()) {
|
||||
for (unsigned i = 0; i < clazz->baseClassCount(); ++i) {
|
||||
for (int i = 0; i < clazz->baseClassCount(); ++i) {
|
||||
BaseClass *baseClass = clazz->baseClassAt(i);
|
||||
if (baseClass->name())
|
||||
allBases.append(baseClass->name());
|
||||
@@ -1207,18 +1207,18 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
// It gets a bit complicated if the reference is actually a class template because we
|
||||
// now must worry about dependent names in base classes.
|
||||
if (Template *templateSpecialization = referenceClass->enclosingTemplate()) {
|
||||
const unsigned argumentCountOfInitialization = templId->templateArgumentCount();
|
||||
const unsigned argumentCountOfSpecialization
|
||||
const int argumentCountOfInitialization = templId->templateArgumentCount();
|
||||
const int argumentCountOfSpecialization
|
||||
= templateSpecialization->templateParameterCount();
|
||||
|
||||
Subst subst(_control.data());
|
||||
if (_factory->expandTemplates()) {
|
||||
const TemplateNameId *templSpecId
|
||||
= templateSpecialization->name()->asTemplateNameId();
|
||||
const unsigned templSpecArgumentCount = templSpecId ?
|
||||
const int templSpecArgumentCount = templSpecId ?
|
||||
templSpecId->templateArgumentCount() : 0;
|
||||
Clone cloner(_control.data());
|
||||
for (unsigned i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
for (int i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
const TypenameArgument *tParam
|
||||
= templateSpecialization->templateParameterAt(i)->asTypenameArgument();
|
||||
if (!tParam)
|
||||
@@ -1251,8 +1251,8 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
oo.showTemplateParameters = true;
|
||||
qDebug() << "cloned" << oo(clone->type());
|
||||
if (Class *klass = clone->asClass()) {
|
||||
const unsigned klassMemberCount = klass->memberCount();
|
||||
for (unsigned i = 0; i < klassMemberCount; ++i){
|
||||
const int klassMemberCount = klass->memberCount();
|
||||
for (int i = 0; i < klassMemberCount; ++i){
|
||||
Symbol *klassMemberAsSymbol = klass->memberAt(i);
|
||||
if (klassMemberAsSymbol->isTypedef()) {
|
||||
if (Declaration *declaration = klassMemberAsSymbol->asDeclaration())
|
||||
@@ -1267,8 +1267,8 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
instantiation->_symbols.append(reference->symbols());
|
||||
}
|
||||
|
||||
QHash<const Name*, unsigned> templParams;
|
||||
for (unsigned i = 0; i < argumentCountOfSpecialization; ++i)
|
||||
QHash<const Name*, int> templParams;
|
||||
for (int i = 0; i < argumentCountOfSpecialization; ++i)
|
||||
templParams.insert(templateSpecialization->templateParameterAt(i)->name(), i);
|
||||
|
||||
foreach (const Name *baseName, allBases) {
|
||||
@@ -1278,7 +1278,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
// This is the simple case in which a template parameter is itself a base.
|
||||
// Ex.: template <class T> class A : public T {};
|
||||
if (templParams.contains(nameId)) {
|
||||
const unsigned parameterIndex = templParams.value(nameId);
|
||||
const int parameterIndex = templParams.value(nameId);
|
||||
if (parameterIndex < argumentCountOfInitialization) {
|
||||
const FullySpecifiedType &fullType =
|
||||
templId->templateArgumentAt(parameterIndex);
|
||||
@@ -1297,7 +1297,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
}
|
||||
} else {
|
||||
SubstitutionMap map;
|
||||
for (unsigned i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
for (int i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
const Name *name = templateSpecialization->templateParameterAt(i)->name();
|
||||
FullySpecifiedType ty = (i < argumentCountOfInitialization) ?
|
||||
templId->templateArgumentAt(i):
|
||||
@@ -1664,7 +1664,7 @@ bool CreateBindings::visit(Namespace *ns)
|
||||
{
|
||||
ClassOrNamespace *previous = enterClassOrNamespaceBinding(ns);
|
||||
|
||||
for (unsigned i = 0; i < ns->memberCount(); ++i)
|
||||
for (int i = 0; i < ns->memberCount(); ++i)
|
||||
process(ns->memberAt(i));
|
||||
|
||||
if (ns->isInline() && previous)
|
||||
@@ -1689,10 +1689,10 @@ bool CreateBindings::visit(Class *klass)
|
||||
_currentClassOrNamespace = binding;
|
||||
_currentClassOrNamespace->addSymbol(klass);
|
||||
|
||||
for (unsigned i = 0; i < klass->baseClassCount(); ++i)
|
||||
for (int i = 0; i < klass->baseClassCount(); ++i)
|
||||
process(klass->baseClassAt(i));
|
||||
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i)
|
||||
for (int i = 0; i < klass->memberCount(); ++i)
|
||||
process(klass->memberAt(i));
|
||||
|
||||
_currentClassOrNamespace = previous;
|
||||
@@ -1759,7 +1759,7 @@ bool CreateBindings::visit(Function *function)
|
||||
if (!binding)
|
||||
return false;
|
||||
_currentClassOrNamespace = binding;
|
||||
for (unsigned i = 0, count = function->memberCount(); i < count; ++i) {
|
||||
for (int i = 0, count = function->memberCount(); i < count; ++i) {
|
||||
Symbol *s = function->memberAt(i);
|
||||
if (Block *b = s->asBlock())
|
||||
visit(b);
|
||||
@@ -1778,7 +1778,7 @@ bool CreateBindings::visit(Block *block)
|
||||
_currentClassOrNamespace = binding;
|
||||
_currentClassOrNamespace->addSymbol(block);
|
||||
|
||||
for (unsigned i = 0; i < block->memberCount(); ++i)
|
||||
for (int i = 0; i < block->memberCount(); ++i)
|
||||
// we cannot use lazy processing here, because we have to know
|
||||
// does this block contain any other blocks or classOrNamespaces
|
||||
process(block->memberAt(i), _currentClassOrNamespace);
|
||||
@@ -1862,10 +1862,10 @@ bool CreateBindings::visit(ObjCClass *klass)
|
||||
|
||||
process(klass->baseClass());
|
||||
|
||||
for (unsigned i = 0; i < klass->protocolCount(); ++i)
|
||||
for (int i = 0; i < klass->protocolCount(); ++i)
|
||||
process(klass->protocolAt(i));
|
||||
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i)
|
||||
for (int i = 0; i < klass->memberCount(); ++i)
|
||||
process(klass->memberAt(i));
|
||||
|
||||
_currentClassOrNamespace = previous;
|
||||
@@ -1894,10 +1894,10 @@ bool CreateBindings::visit(ObjCProtocol *proto)
|
||||
{
|
||||
ClassOrNamespace *previous = enterGlobalClassOrNamespace(proto);
|
||||
|
||||
for (unsigned i = 0; i < proto->protocolCount(); ++i)
|
||||
for (int i = 0; i < proto->protocolCount(); ++i)
|
||||
process(proto->protocolAt(i));
|
||||
|
||||
for (unsigned i = 0; i < proto->memberCount(); ++i)
|
||||
for (int i = 0; i < proto->memberCount(); ++i)
|
||||
process(proto->memberAt(i));
|
||||
|
||||
_currentClassOrNamespace = previous;
|
||||
@@ -1930,12 +1930,12 @@ bool CreateBindings::visit(ObjCMethod *)
|
||||
Symbol *CreateBindings::instantiateTemplateFunction(const TemplateNameId *instantiation,
|
||||
Template *specialization) const
|
||||
{
|
||||
const unsigned argumentCountOfInitialization = instantiation->templateArgumentCount();
|
||||
const unsigned argumentCountOfSpecialization = specialization->templateParameterCount();
|
||||
const int argumentCountOfInitialization = instantiation->templateArgumentCount();
|
||||
const int argumentCountOfSpecialization = specialization->templateParameterCount();
|
||||
|
||||
Clone cloner(_control.data());
|
||||
Subst subst(_control.data());
|
||||
for (unsigned i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
for (int i = 0; i < argumentCountOfSpecialization; ++i) {
|
||||
const TypenameArgument *tParam
|
||||
= specialization->templateParameterAt(i)->asTypenameArgument();
|
||||
if (!tParam)
|
||||
|
@@ -100,10 +100,10 @@ public:
|
||||
void setFileRevision(unsigned fileRevision)
|
||||
{ _fileRevision = fileRevision; }
|
||||
|
||||
unsigned line() const
|
||||
int line() const
|
||||
{ return _line; }
|
||||
|
||||
void setLine(unsigned line)
|
||||
void setLine(int line)
|
||||
{ _line = line; }
|
||||
|
||||
unsigned bytesOffset() const
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
QString _fileName;
|
||||
unsigned _hashcode;
|
||||
unsigned _fileRevision;
|
||||
unsigned _line;
|
||||
int _line;
|
||||
unsigned _bytesOffset;
|
||||
unsigned _utf16charsOffset;
|
||||
unsigned _length;
|
||||
|
@@ -128,7 +128,7 @@ static int countSkippedChars(const QString &blockText, const QString &textToProc
|
||||
return skippedChars;
|
||||
}
|
||||
|
||||
static const Token tokenAtPosition(const Tokens &tokens, const unsigned pos)
|
||||
static const Token tokenAtPosition(const Tokens &tokens, const int pos)
|
||||
{
|
||||
for (int i = tokens.size() - 1; i >= 0; --i) {
|
||||
const Token tk = tokens.at(i);
|
||||
@@ -450,7 +450,7 @@ bool MatchingText::contextAllowsElectricCharacters(const QTextCursor &cursor)
|
||||
return false;
|
||||
|
||||
if (token.isStringLiteral() || token.isCharLiteral()) {
|
||||
const unsigned pos = cursor.selectionEnd() - cursor.block().position();
|
||||
const int pos = cursor.selectionEnd() - cursor.block().position();
|
||||
if (pos <= token.utf16charsEnd())
|
||||
return false;
|
||||
}
|
||||
@@ -485,7 +485,7 @@ bool MatchingText::isInCommentHelper(const QTextCursor &cursor, Token *retToken)
|
||||
int prevState = 0;
|
||||
const Tokens tokens = getTokens(cursor, prevState);
|
||||
|
||||
const unsigned pos = cursor.selectionEnd() - cursor.block().position();
|
||||
const int pos = cursor.selectionEnd() - cursor.block().position();
|
||||
|
||||
if (tokens.isEmpty() || pos < tokens.first().utf16charsBegin())
|
||||
return prevState > 0;
|
||||
@@ -510,7 +510,7 @@ Kind MatchingText::stringKindAtCursor(const QTextCursor &cursor)
|
||||
int prevState = 0;
|
||||
const Tokens tokens = getTokens(cursor, prevState);
|
||||
|
||||
const unsigned pos = cursor.selectionEnd() - cursor.block().position();
|
||||
const int pos = cursor.selectionEnd() - cursor.block().position();
|
||||
|
||||
if (tokens.isEmpty() || pos <= tokens.first().utf16charsBegin())
|
||||
return T_EOF_SYMBOL;
|
||||
|
@@ -76,7 +76,7 @@ void NamePrettyPrinter::visit(const TemplateNameId *name)
|
||||
else
|
||||
_name = QLatin1String("anonymous");
|
||||
_name += QLatin1Char('<');
|
||||
for (unsigned index = 0; index < name->templateArgumentCount(); ++index) {
|
||||
for (int index = 0; index < name->templateArgumentCount(); ++index) {
|
||||
if (index != 0)
|
||||
_name += QLatin1String(", ");
|
||||
|
||||
@@ -253,7 +253,7 @@ void NamePrettyPrinter::visit(const QualifiedNameId *name)
|
||||
|
||||
void NamePrettyPrinter::visit(const SelectorNameId *name)
|
||||
{
|
||||
for (unsigned i = 0; i < name->nameCount(); ++i) {
|
||||
for (int i = 0; i < name->nameCount(); ++i) {
|
||||
const Name *n = name->nameAt(i);
|
||||
if (!n)
|
||||
continue;
|
||||
|
@@ -70,7 +70,7 @@ public:
|
||||
bool showEnclosingTemplate: 1;
|
||||
bool includeWhiteSpaceInOperatorName: 1; /// "operator =()" vs "operator=()"
|
||||
|
||||
unsigned markedArgument;
|
||||
int markedArgument;
|
||||
int markedArgumentBegin;
|
||||
int markedArgumentEnd;
|
||||
};
|
||||
|
@@ -40,7 +40,7 @@ using namespace CPlusPlus;
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void Client::passedMacroDefinitionCheck(unsigned offset, unsigned line, const Macro ¯o)
|
||||
\fn void Client::passedMacroDefinitionCheck(int offset, int line, const Macro ¯o)
|
||||
|
||||
Called when the preprocessor checks whether a macro is defined or not and the
|
||||
result is positive.
|
||||
@@ -49,7 +49,7 @@ using namespace CPlusPlus;
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void Client::failedMacroDefinitionCheck(unsigned offset, const ByteArrayRef &name)
|
||||
\fn void Client::failedMacroDefinitionCheck(int offset, const ByteArrayRef &name)
|
||||
|
||||
Called when the preprocessor checks whether a macro is defined or not and the
|
||||
result is negative.
|
||||
@@ -58,8 +58,8 @@ using namespace CPlusPlus;
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void Client::startExpandingMacro(unsigned offset,
|
||||
unsigned line,
|
||||
\fn void Client::startExpandingMacro(int offset,
|
||||
int line,
|
||||
const Macro ¯o,
|
||||
const QVector<MacroArgumentReference> &actuals
|
||||
= QVector<MacroArgumentReference>())
|
||||
|
@@ -41,30 +41,30 @@ class Macro;
|
||||
|
||||
class CPLUSPLUS_EXPORT MacroArgumentReference
|
||||
{
|
||||
unsigned _bytesOffset;
|
||||
unsigned _bytesLength;
|
||||
unsigned _utf16charsOffset;
|
||||
unsigned _utf16charsLength;
|
||||
int _bytesOffset;
|
||||
int _bytesLength;
|
||||
int _utf16charsOffset;
|
||||
int _utf16charsLength;
|
||||
|
||||
public:
|
||||
explicit MacroArgumentReference(unsigned bytesOffset = 0, unsigned bytesLength = 0,
|
||||
unsigned utf16charsOffset = 0, unsigned utf16charsLength = 0)
|
||||
explicit MacroArgumentReference(int bytesOffset = 0, int bytesLength = 0,
|
||||
int utf16charsOffset = 0, int utf16charsLength = 0)
|
||||
: _bytesOffset(bytesOffset)
|
||||
, _bytesLength(bytesLength)
|
||||
, _utf16charsOffset(utf16charsOffset)
|
||||
, _utf16charsLength(utf16charsLength)
|
||||
{ }
|
||||
|
||||
unsigned bytesOffset() const
|
||||
int bytesOffset() const
|
||||
{ return _bytesOffset; }
|
||||
|
||||
unsigned bytesLength() const
|
||||
int bytesLength() const
|
||||
{ return _bytesLength; }
|
||||
|
||||
unsigned utf16charsOffset() const
|
||||
int utf16charsOffset() const
|
||||
{ return _utf16charsOffset; }
|
||||
|
||||
unsigned utf16charsLength() const
|
||||
int utf16charsLength() const
|
||||
{ return _utf16charsLength; }
|
||||
};
|
||||
|
||||
@@ -86,28 +86,28 @@ public:
|
||||
|
||||
virtual void macroAdded(const Macro ¯o) = 0;
|
||||
|
||||
virtual void passedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
unsigned line, const Macro ¯o) = 0;
|
||||
virtual void failedMacroDefinitionCheck(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
virtual void passedMacroDefinitionCheck(int bytesOffset, int utf16charsOffset,
|
||||
int line, const Macro ¯o) = 0;
|
||||
virtual void failedMacroDefinitionCheck(int bytesOffset, int utf16charsOffset,
|
||||
const ByteArrayRef &name) = 0;
|
||||
|
||||
virtual void notifyMacroReference(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
unsigned line, const Macro ¯o) = 0;
|
||||
virtual void notifyMacroReference(int bytesOffset, int utf16charsOffset,
|
||||
int line, const Macro ¯o) = 0;
|
||||
|
||||
virtual void startExpandingMacro(unsigned bytesOffset, unsigned utf16charsOffset,
|
||||
unsigned line, const Macro ¯o,
|
||||
virtual void startExpandingMacro(int bytesOffset, int utf16charsOffset,
|
||||
int line, const Macro ¯o,
|
||||
const QVector<MacroArgumentReference> &actuals
|
||||
= QVector<MacroArgumentReference>()) = 0;
|
||||
virtual void stopExpandingMacro(unsigned bytesOffset, const Macro ¯o) = 0; // TODO: ?!
|
||||
virtual void stopExpandingMacro(int bytesOffset, const Macro ¯o) = 0; // TODO: ?!
|
||||
|
||||
/// Mark the given macro name as the include guard for the current file.
|
||||
virtual void markAsIncludeGuard(const QByteArray ¯oName) = 0;
|
||||
|
||||
/// Start skipping from the given utf16charsOffset.
|
||||
virtual void startSkippingBlocks(unsigned utf16charsOffset) = 0;
|
||||
virtual void stopSkippingBlocks(unsigned utf16charsOffset) = 0;
|
||||
virtual void startSkippingBlocks(int utf16charsOffset) = 0;
|
||||
virtual void stopSkippingBlocks(int utf16charsOffset) = 0;
|
||||
|
||||
virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode,
|
||||
virtual void sourceNeeded(int line, const QString &fileName, IncludeType mode,
|
||||
const QStringList &initialIncludes = QStringList()) = 0;
|
||||
|
||||
static inline bool isInjectedFile(const QString &fileName)
|
||||
|
@@ -88,7 +88,7 @@ private:
|
||||
public:
|
||||
QString currentFile;
|
||||
QByteArray currentFileUtf8;
|
||||
unsigned currentLine;
|
||||
int currentLine;
|
||||
bool hideNext;
|
||||
|
||||
private:
|
||||
|
@@ -110,7 +110,7 @@ Tokens SimpleLexer::operator()(const QString &text, int state)
|
||||
return tokens;
|
||||
}
|
||||
|
||||
int SimpleLexer::tokenAt(const Tokens &tokens, unsigned utf16charsOffset)
|
||||
int SimpleLexer::tokenAt(const Tokens &tokens, int utf16charsOffset)
|
||||
{
|
||||
for (int index = tokens.size() - 1; index >= 0; --index) {
|
||||
const Token &tk = tokens.at(index);
|
||||
@@ -122,7 +122,7 @@ int SimpleLexer::tokenAt(const Tokens &tokens, unsigned utf16charsOffset)
|
||||
}
|
||||
|
||||
Token SimpleLexer::tokenAt(const QString &text,
|
||||
unsigned utf16charsOffset,
|
||||
int utf16charsOffset,
|
||||
int state,
|
||||
const LanguageFeatures &languageFeatures)
|
||||
{
|
||||
@@ -133,7 +133,7 @@ Token SimpleLexer::tokenAt(const QString &text,
|
||||
return (tokenIdx == -1) ? Token() : tokens.at(tokenIdx);
|
||||
}
|
||||
|
||||
int SimpleLexer::tokenBefore(const Tokens &tokens, unsigned utf16charsOffset)
|
||||
int SimpleLexer::tokenBefore(const Tokens &tokens, int utf16charsOffset)
|
||||
{
|
||||
for (int index = tokens.size() - 1; index >= 0; --index) {
|
||||
const Token &tk = tokens.at(index);
|
||||
|
@@ -59,13 +59,13 @@ public:
|
||||
int state() const
|
||||
{ return _lastState; }
|
||||
|
||||
static int tokenAt(const Tokens &tokens, unsigned utf16charsOffset);
|
||||
static int tokenAt(const Tokens &tokens, int utf16charsOffset);
|
||||
static Token tokenAt(const QString &text,
|
||||
unsigned utf16charsOffset,
|
||||
int utf16charsOffset,
|
||||
int state,
|
||||
const LanguageFeatures &languageFeatures);
|
||||
|
||||
static int tokenBefore(const Tokens &tokens, unsigned utf16charsOffset);
|
||||
static int tokenBefore(const Tokens &tokens, int utf16charsOffset);
|
||||
|
||||
private:
|
||||
int _lastState;
|
||||
|
@@ -169,7 +169,7 @@ void TypePrettyPrinter::visit(Template *type)
|
||||
const Overview &oo = *overview();
|
||||
if (oo.showTemplateParameters && ! _name.isEmpty()) {
|
||||
_name += QLatin1Char('<');
|
||||
for (unsigned index = 0; index < type->templateParameterCount(); ++index) {
|
||||
for (int index = 0; index < type->templateParameterCount(); ++index) {
|
||||
if (index)
|
||||
_name += QLatin1String(", ");
|
||||
QString arg = oo.prettyName(type->templateParameterAt(index)->name());
|
||||
@@ -410,7 +410,7 @@ void TypePrettyPrinter::visit(Function *type)
|
||||
if (_overview->showEnclosingTemplate) {
|
||||
if (Template *templ = type->enclosingTemplate()) {
|
||||
QString templateScope = "template<";
|
||||
for (unsigned i = 0, total = templ->templateParameterCount(); i < total; ++i) {
|
||||
for (int i = 0, total = templ->templateParameterCount(); i < total; ++i) {
|
||||
if (Symbol *param = templ->templateParameterAt(i)) {
|
||||
if (i > 0)
|
||||
templateScope.append(", ");
|
||||
@@ -437,7 +437,7 @@ void TypePrettyPrinter::visit(Function *type)
|
||||
|
||||
_text += QLatin1Char('(');
|
||||
|
||||
for (unsigned index = 0, argc = type->argumentCount(); index < argc; ++index) {
|
||||
for (int index = 0, argc = type->argumentCount(); index < argc; ++index) {
|
||||
if (index != 0)
|
||||
_text += QLatin1String(", ");
|
||||
|
||||
|
@@ -39,7 +39,7 @@ FindCdbBreakpoint::FindCdbBreakpoint(TranslationUnit *unit)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned FindCdbBreakpoint::searchFrom(unsigned line)
|
||||
int FindCdbBreakpoint::searchFrom(int line)
|
||||
{
|
||||
m_initialLine = line;
|
||||
m_breakpointLine = NO_LINE_FOUND;
|
||||
@@ -51,18 +51,18 @@ unsigned FindCdbBreakpoint::searchFrom(unsigned line)
|
||||
|
||||
void FindCdbBreakpoint::foundLine(unsigned tokenIndex)
|
||||
{
|
||||
unsigned dummy = 0;
|
||||
int dummy = 0;
|
||||
getTokenStartPosition(tokenIndex, &m_breakpointLine, &dummy);
|
||||
}
|
||||
|
||||
unsigned FindCdbBreakpoint::endLine(unsigned tokenIndex) const
|
||||
int FindCdbBreakpoint::endLine(unsigned tokenIndex) const
|
||||
{
|
||||
unsigned line = 0, column = 0;
|
||||
int line = 0, column = 0;
|
||||
getTokenEndPosition(tokenIndex, &line, &column);
|
||||
return line;
|
||||
}
|
||||
|
||||
unsigned FindCdbBreakpoint::endLine(AST *ast) const
|
||||
int FindCdbBreakpoint::endLine(AST *ast) const
|
||||
{
|
||||
if (ast)
|
||||
return endLine(ast->lastToken() - 1);
|
||||
|
@@ -33,13 +33,12 @@ namespace CPlusPlus {
|
||||
class CPLUSPLUS_EXPORT FindCdbBreakpoint: protected ASTVisitor
|
||||
{
|
||||
public:
|
||||
static const unsigned NO_LINE_FOUND = 0;
|
||||
static const int NO_LINE_FOUND = 0;
|
||||
|
||||
public:
|
||||
FindCdbBreakpoint(TranslationUnit *unit);
|
||||
|
||||
unsigned operator()(unsigned line)
|
||||
{ return searchFrom(line); }
|
||||
int operator()(int line) { return searchFrom(line); }
|
||||
|
||||
/**
|
||||
* Search for the next breakable line of code.
|
||||
@@ -49,12 +48,12 @@ public:
|
||||
* \return the next breakable code line (1-based), or \c NO_LINE_FOUND if
|
||||
* no line could be found.
|
||||
*/
|
||||
unsigned searchFrom(unsigned line);
|
||||
int searchFrom(int line);
|
||||
|
||||
protected:
|
||||
void foundLine(unsigned tokenIndex);
|
||||
unsigned endLine(unsigned tokenIndex) const;
|
||||
unsigned endLine(AST *ast) const;
|
||||
int endLine(unsigned tokenIndex) const;
|
||||
int endLine(AST *ast) const;
|
||||
|
||||
protected:
|
||||
using ASTVisitor::visit;
|
||||
@@ -86,9 +85,9 @@ protected:
|
||||
bool visit(ObjCSynchronizedStatementAST *ast);
|
||||
|
||||
private:
|
||||
unsigned m_initialLine;
|
||||
int m_initialLine;
|
||||
|
||||
unsigned m_breakpointLine;
|
||||
int m_breakpointLine;
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
@@ -1321,7 +1321,7 @@ void Preprocessor::trackExpansionCycles(PPToken *tk)
|
||||
}
|
||||
}
|
||||
|
||||
static void adjustForCommentOrStringNewlines(unsigned *currentLine, const PPToken &tk)
|
||||
static void adjustForCommentOrStringNewlines(int *currentLine, const PPToken &tk)
|
||||
{
|
||||
if (tk.isComment() || tk.isStringLiteral())
|
||||
(*currentLine) += tk.asByteArrayRef().count('\n');
|
||||
@@ -1343,7 +1343,7 @@ void Preprocessor::synchronizeOutputLines(const PPToken &tk, bool forceLine)
|
||||
generateOutputLineMarker(tk.lineno);
|
||||
}
|
||||
} else {
|
||||
for (unsigned i = m_env->currentLine; i < tk.lineno; ++i)
|
||||
for (int i = m_env->currentLine; i < tk.lineno; ++i)
|
||||
currentOutputBuffer().append('\n');
|
||||
}
|
||||
|
||||
@@ -1419,7 +1419,7 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source,
|
||||
|
||||
ScopedSwap<QString> savedFileName(m_env->currentFile, fileName);
|
||||
ScopedSwap<QByteArray> savedUtf8FileName(m_env->currentFileUtf8, fileName.toUtf8());
|
||||
ScopedSwap<unsigned> savedCurrentLine(m_env->currentLine, 1);
|
||||
ScopedSwap<int> savedCurrentLine(m_env->currentLine, 1);
|
||||
|
||||
if (!m_state.m_noLines)
|
||||
generateOutputLineMarker(1);
|
||||
|
@@ -133,7 +133,7 @@ private:
|
||||
unsigned m_bytesOffsetRef;
|
||||
unsigned m_utf16charsOffsetRef;
|
||||
QByteArray *m_result;
|
||||
unsigned m_lineRef;
|
||||
int m_lineRef;
|
||||
|
||||
ExpansionStatus m_expansionStatus;
|
||||
void setExpansionStatus(ExpansionStatus status)
|
||||
|
@@ -57,7 +57,7 @@ class ContextProperty {
|
||||
public:
|
||||
QString name;
|
||||
QString expression;
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
};
|
||||
|
||||
class FindExportsVisitor : protected ASTVisitor
|
||||
@@ -245,7 +245,7 @@ protected:
|
||||
if (StringLiteralAST *nameAst = skipStringCall(nameExp)->asStringLiteral())
|
||||
nameLit = translationUnit()->stringLiteral(nameAst->literal_token);
|
||||
if (!nameLit) {
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
translationUnit()->getTokenStartPosition(nameExp->firstToken(), &line, &column);
|
||||
_messages += Document::DiagnosticMessage(
|
||||
Document::DiagnosticMessage::Warning,
|
||||
@@ -290,7 +290,7 @@ protected:
|
||||
const Token end = _doc->translationUnit()->tokenAt(ast->firstToken());
|
||||
|
||||
// go through comments backwards to find the annotation closest to the call
|
||||
for (unsigned i = _doc->translationUnit()->commentCount(); i-- > 0; ) {
|
||||
for (int i = _doc->translationUnit()->commentCount(); i-- > 0; ) {
|
||||
const Token commentToken = _doc->translationUnit()->commentAt(i);
|
||||
if (commentToken.utf16charsBegin() >= end.utf16charsBegin()
|
||||
|| commentToken.utf16charsEnd() <= begin.utf16charsBegin()) {
|
||||
@@ -305,7 +305,7 @@ protected:
|
||||
}
|
||||
if (packageName.isEmpty()) {
|
||||
packageName = QmlJS::CppQmlTypes::defaultPackage;
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
translationUnit()->getTokenStartPosition(ast->firstToken(), &line, &column);
|
||||
_messages += Document::DiagnosticMessage(
|
||||
Document::DiagnosticMessage::Warning,
|
||||
@@ -341,7 +341,7 @@ protected:
|
||||
}
|
||||
|
||||
// we want to do lookup later, so also store the surrounding scope
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
translationUnit()->getTokenStartPosition(ast->firstToken(), &line, &column);
|
||||
exportedType.scope = _doc->scopeAt(line, column);
|
||||
|
||||
@@ -483,7 +483,7 @@ protected:
|
||||
if (StringLiteralAST *nameAst = skipStringCall(ast->expression_list->value)->asStringLiteral())
|
||||
nameLit = translationUnit()->stringLiteral(nameAst->literal_token);
|
||||
if (!nameLit) {
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
translationUnit()->getTokenStartPosition(ast->expression_list->value->firstToken(), &line, &column);
|
||||
_messages += Document::DiagnosticMessage(
|
||||
Document::DiagnosticMessage::Warning,
|
||||
@@ -666,7 +666,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
||||
// add the no-package export, so the cpp name can be used in properties
|
||||
fmo->addExport(fmo->className(), QmlJS::CppQmlTypes::cppPackage, ComponentVersion());
|
||||
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i) {
|
||||
for (int i = 0; i < klass->memberCount(); ++i) {
|
||||
Symbol *member = klass->memberAt(i);
|
||||
if (!member->name())
|
||||
continue;
|
||||
@@ -678,7 +678,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
||||
method.setMethodType(FakeMetaMethod::Signal);
|
||||
else
|
||||
method.setMethodType(FakeMetaMethod::Slot);
|
||||
for (unsigned a = 0, argc = func->argumentCount(); a < argc; ++a) {
|
||||
for (int a = 0, argc = func->argumentCount(); a < argc; ++a) {
|
||||
Symbol *arg = func->argumentAt(a);
|
||||
QString name;
|
||||
if (arg->name())
|
||||
@@ -715,7 +715,7 @@ static LanguageUtils::FakeMetaObject::Ptr buildFakeMetaObject(
|
||||
continue;
|
||||
|
||||
FakeMetaEnum metaEnum(namePrinter.prettyName(e->name()));
|
||||
for (unsigned j = 0; j < e->memberCount(); ++j) {
|
||||
for (int j = 0; j < e->memberCount(); ++j) {
|
||||
Symbol *enumMember = e->memberAt(j);
|
||||
if (!enumMember->name())
|
||||
continue;
|
||||
|
@@ -80,7 +80,7 @@ QString textAt(QTextCursor tc, int pos, int length)
|
||||
return tc.selectedText().replace(QChar::ParagraphSeparator, QLatin1Char('\n'));
|
||||
}
|
||||
|
||||
QTextCursor selectAt(QTextCursor textCursor, uint line, uint column, uint length)
|
||||
QTextCursor selectAt(QTextCursor textCursor, int line, int column, uint length)
|
||||
{
|
||||
if (line < 1)
|
||||
line = 1;
|
||||
|
@@ -48,7 +48,7 @@ QTCREATOR_UTILS_EXPORT int positionInText(const QTextDocument *textDocument, int
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QString textAt(QTextCursor tc, int pos, int length);
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QTextCursor selectAt(QTextCursor textCursor, uint line, uint column, uint length);
|
||||
QTCREATOR_UTILS_EXPORT QTextCursor selectAt(QTextCursor textCursor, int line, int column, uint length);
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QTextCursor flippedCursor(const QTextCursor &cursor);
|
||||
|
||||
|
@@ -288,7 +288,7 @@ void AutotestPlugin::onRunUnderCursorTriggered(TestRunMode mode)
|
||||
return; // Wrong location triggered
|
||||
|
||||
// check whether we have been triggered on a test function definition
|
||||
const uint line = uint(currentEditor->currentLine());
|
||||
const int line = currentEditor->currentLine();
|
||||
const QString &filePath = currentEditor->textDocument()->filePath().toString();
|
||||
const QList<TestTreeItem *> filteredItems = Utils::filtered(testsItems, [&](TestTreeItem *it){
|
||||
return it->line() == line && it->filePath() == filePath;
|
||||
|
@@ -75,7 +75,7 @@ private:
|
||||
QVector<BoostTestInfo> m_suites;
|
||||
QString m_currentSuite;
|
||||
BoostTestTreeItem::TestStates m_currentState = BoostTestTreeItem::Enabled;
|
||||
unsigned m_lineNo = 0;
|
||||
int m_lineNo = 0;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
|
@@ -88,7 +88,7 @@ struct BoostTestInfo
|
||||
{
|
||||
QString fullName; // formatted like UNIX path
|
||||
BoostTestTreeItem::TestStates state;
|
||||
unsigned line;
|
||||
int line;
|
||||
};
|
||||
|
||||
typedef QVector<BoostTestInfo> BoostTestInfoList;
|
||||
|
@@ -69,8 +69,8 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
|
||||
|
||||
const bool disabled = testName.startsWith(disabledPrefix);
|
||||
const bool disabledCase = testCaseName.startsWith(disabledPrefix);
|
||||
unsigned line = 0;
|
||||
unsigned column = 0;
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
unsigned token = id->firstToken();
|
||||
m_document->translationUnit()->getTokenStartPosition(token, &line, &column);
|
||||
|
||||
|
@@ -51,8 +51,8 @@ public:
|
||||
QString fileName;
|
||||
QString proFile;
|
||||
QString name;
|
||||
unsigned line = 0;
|
||||
unsigned column = 0;
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
};
|
||||
|
||||
using TestParseResultPtr = QSharedPointer<TestParseResult>;
|
||||
|
@@ -126,8 +126,8 @@ static CPlusPlus::Document::Ptr declaringDocument(CPlusPlus::Document::Ptr doc,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const QString &testCaseName,
|
||||
const QStringList &alternativeFiles = {},
|
||||
unsigned *line = nullptr,
|
||||
unsigned *column = nullptr)
|
||||
int *line = nullptr,
|
||||
int *column = nullptr)
|
||||
{
|
||||
CPlusPlus::Document::Ptr declaringDoc;
|
||||
CPlusPlus::TypeOfExpression typeOfExpr;
|
||||
@@ -293,8 +293,8 @@ static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
|
||||
if (testCaseName.isEmpty())
|
||||
testCaseName = oldTestCaseName;
|
||||
if (!testCaseName.isEmpty()) {
|
||||
unsigned line = 0;
|
||||
unsigned column = 0;
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
CPlusPlus::Document::Ptr declaringDoc = declaringDocument(document, snapshot, testCaseName,
|
||||
alternativeFiles, &line, &column);
|
||||
if (declaringDoc.isNull())
|
||||
|
@@ -50,8 +50,8 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
|
||||
const CPlusPlus::Overview o;
|
||||
CPlusPlus::LookupContext lc;
|
||||
|
||||
unsigned count = symbol->memberCount();
|
||||
for (unsigned i = 0; i < count; ++i) {
|
||||
int count = symbol->memberCount();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
CPlusPlus::Symbol *member = symbol->memberAt(i);
|
||||
CPlusPlus::Type *type = member->type().type();
|
||||
|
||||
@@ -87,7 +87,7 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
|
||||
m_privSlots.insert(className + "::" + name, locationAndType);
|
||||
}
|
||||
}
|
||||
for (unsigned counter = 0, end = symbol->baseClassCount(); counter < end; ++counter) {
|
||||
for (int counter = 0, end = symbol->baseClassCount(); counter < end; ++counter) {
|
||||
if (CPlusPlus::BaseClass *base = symbol->baseClassAt(counter)) {
|
||||
const QString &baseClassName = o.prettyName(lc.fullyQualifiedName(base));
|
||||
if (baseClassName != "QObject")
|
||||
@@ -224,8 +224,8 @@ bool TestDataFunctionVisitor::visit(CPlusPlus::CallAST *ast)
|
||||
bool ok = false;
|
||||
QString name = extractNameFromAST(stringLiteral, &ok);
|
||||
if (ok) {
|
||||
unsigned line = 0;
|
||||
unsigned column = 0;
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
m_currentDoc->translationUnit()->getTokenStartPosition(
|
||||
firstToken, &line, &column);
|
||||
QtTestCodeLocationAndType locationAndType;
|
||||
|
@@ -88,10 +88,10 @@ public:
|
||||
void setName(const QString &name) { m_name = name; }
|
||||
const QString filePath() const { return m_filePath; }
|
||||
void setFilePath(const QString &filePath) { m_filePath = filePath; }
|
||||
void setLine(unsigned line) { m_line = line;}
|
||||
unsigned line() const { return m_line; }
|
||||
void setColumn(unsigned column) { m_column = column; }
|
||||
unsigned column() const { return m_column; }
|
||||
void setLine(int line) { m_line = line;}
|
||||
int line() const { return m_line; }
|
||||
void setColumn(int column) { m_column = column; }
|
||||
int column() const { return m_column; }
|
||||
QString proFile() const { return m_proFile; }
|
||||
void setProFile(const QString &proFile) { m_proFile = proFile; }
|
||||
virtual Qt::CheckState checked() const;
|
||||
@@ -151,8 +151,8 @@ private:
|
||||
QString m_filePath;
|
||||
Qt::CheckState m_checked;
|
||||
Type m_type;
|
||||
unsigned m_line = 0;
|
||||
unsigned m_column = 0;
|
||||
int m_line = 0;
|
||||
int m_column = 0;
|
||||
QString m_proFile;
|
||||
Status m_status = NewlyAdded;
|
||||
|
||||
@@ -163,8 +163,8 @@ class TestCodeLocationAndType
|
||||
{
|
||||
public:
|
||||
QString m_name; // tag name for m_type == TestDataTag, file name for other values
|
||||
unsigned m_line = 0;
|
||||
unsigned m_column = 0;
|
||||
int m_line = 0;
|
||||
int m_column = 0;
|
||||
TestTreeItem::Type m_type = TestTreeItem::Root;
|
||||
};
|
||||
|
||||
|
@@ -219,7 +219,7 @@ CppTools::CursorInfo::Range toCursorInfoRange(const SourceRangeContainer &source
|
||||
{
|
||||
const SourceLocationContainer &start = sourceRange.start;
|
||||
const SourceLocationContainer &end = sourceRange.end;
|
||||
const unsigned length = end.column - start.column;
|
||||
const int length = end.column - start.column;
|
||||
|
||||
return {start.line, start.column, length};
|
||||
}
|
||||
@@ -249,10 +249,10 @@ CppTools::SymbolInfo toSymbolInfo(const FollowSymbolMessage &message)
|
||||
|
||||
const SourceLocationContainer &start = range.start;
|
||||
const SourceLocationContainer &end = range.end;
|
||||
result.startLine = static_cast<int>(start.line);
|
||||
result.startColumn = static_cast<int>(start.column);
|
||||
result.endLine = static_cast<int>(end.line);
|
||||
result.endColumn = static_cast<int>(end.column);
|
||||
result.startLine = start.line;
|
||||
result.startColumn = start.column;
|
||||
result.endLine = end.line;
|
||||
result.endColumn = end.column;
|
||||
result.fileName = start.filePath;
|
||||
|
||||
result.isResultOnlyForFallBack = message.result.isResultOnlyForFallBack;
|
||||
|
@@ -189,7 +189,7 @@ CodeCompletions ClangCompletionAssistProcessor::applyCompletionFixIt(const CodeC
|
||||
ClangFixItOperation fixItOperation(Utf8String(), completion.requiredFixIts);
|
||||
fixItOperation.perform();
|
||||
|
||||
const int fixItLength = static_cast<int>(fixIt.range.end.column - fixIt.range.start.column);
|
||||
const int fixItLength = fixIt.range.end.column - fixIt.range.start.column;
|
||||
const QString fixItText = fixIt.text.toString();
|
||||
m_positionForProposal += fixItText.length() - fixItLength;
|
||||
|
||||
|
@@ -75,7 +75,7 @@ static Core::LocatorFilterEntry makeEntry(Core::ILocatorFilter *filter,
|
||||
{
|
||||
const ClangBackEnd::ExtraInfo &extraInfo = info.extraInfo;
|
||||
QString displayName = extraInfo.token;
|
||||
::Utils::LineColumn lineColumn(static_cast<int>(info.line), static_cast<int>(info.column));
|
||||
::Utils::LineColumn lineColumn(info.line, info.column);
|
||||
Core::LocatorFilterEntry entry(filter, displayName, QVariant::fromValue(lineColumn));
|
||||
QString extra;
|
||||
ClangBackEnd::HighlightingType mainType = info.types.mainHighlightingType;
|
||||
|
@@ -63,7 +63,7 @@ bool hasFixItAt(const QVector<ClangBackEnd::FixItContainer> &fixits,
|
||||
{
|
||||
const auto isFixitForLocation = [filePath, line] (const ClangBackEnd::FixItContainer &fixit) {
|
||||
const ClangBackEnd::SourceLocationContainer &location = fixit.range.start;
|
||||
return location.filePath == filePath && location.line == uint(line);
|
||||
return location.filePath == filePath && location.line == line;
|
||||
};
|
||||
|
||||
return Utils::anyOf(fixits, isFixitForLocation);
|
||||
|
@@ -43,8 +43,8 @@ namespace Internal {
|
||||
|
||||
// Returns invalid Mark if it is not found at (line, column)
|
||||
static bool findMark(const QVector<ClangBackEnd::TokenInfoContainer> &marks,
|
||||
uint line,
|
||||
uint column,
|
||||
int line,
|
||||
int column,
|
||||
ClangBackEnd::TokenInfoContainer &mark)
|
||||
{
|
||||
mark = Utils::findOrDefault(marks,
|
||||
|
@@ -65,7 +65,7 @@ private:
|
||||
int m_chunkSize = 100;
|
||||
|
||||
bool m_flushRequested = false;
|
||||
unsigned m_flushLine = 0;
|
||||
int m_flushLine = 0;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -31,8 +31,8 @@ namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
static bool isWithinRange(const ClangBackEnd::SourceRangeContainer &range,
|
||||
uint line,
|
||||
uint column)
|
||||
int line,
|
||||
int column)
|
||||
{
|
||||
const ClangBackEnd::SourceLocationContainer &startLocation = range.start;
|
||||
const ClangBackEnd::SourceLocationContainer &endLocation = range.end;
|
||||
@@ -44,8 +44,8 @@ static bool isWithinRange(const ClangBackEnd::SourceRangeContainer &range,
|
||||
}
|
||||
|
||||
static bool isWithinOneRange(const QVector<ClangBackEnd::SourceRangeContainer> &ranges,
|
||||
uint line,
|
||||
uint column)
|
||||
int line,
|
||||
int column)
|
||||
{
|
||||
for (const ClangBackEnd::SourceRangeContainer &range : ranges) {
|
||||
if (isWithinRange(range, line, column))
|
||||
@@ -57,8 +57,8 @@ static bool isWithinOneRange(const QVector<ClangBackEnd::SourceRangeContainer> &
|
||||
|
||||
bool isDiagnosticRelatedToLocation(const ClangBackEnd::DiagnosticContainer &diagnostic,
|
||||
const QVector<ClangBackEnd::SourceRangeContainer> &additionalRanges,
|
||||
uint line,
|
||||
uint column)
|
||||
int line,
|
||||
int column)
|
||||
{
|
||||
const ClangBackEnd::SourceLocationContainer &location = diagnostic.location;
|
||||
|
||||
|
@@ -53,8 +53,8 @@ void ClangQueryHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorW
|
||||
int line = textCursor.blockNumber() + 1;
|
||||
int column = textCursor.columnNumber() + 1;
|
||||
|
||||
Messages messages = m_highligher->messagesForLineAndColumn(uint(line), uint(column));
|
||||
Contexts contexts = m_highligher->contextsForLineAndColumn(uint(line), uint(column));
|
||||
Messages messages = m_highligher->messagesForLineAndColumn(line, column);
|
||||
Contexts contexts = m_highligher->contextsForLineAndColumn(line, column);
|
||||
|
||||
if (!messages.empty())
|
||||
setToolTip(QString("%1: %2").arg(QString(messages[0].errorTypeText())).arg(QString(messages[0].arguments.join(", "))));
|
||||
|
@@ -902,7 +902,7 @@ QModelIndex SymbolsModel::index(int row, int column, const QModelIndex &parent)
|
||||
scope = m_document->globalNamespace();
|
||||
|
||||
if (scope) {
|
||||
if ((unsigned)row < scope->memberCount())
|
||||
if (row < scope->memberCount())
|
||||
return createIndex(row, column, scope->memberAt(row));
|
||||
}
|
||||
|
||||
@@ -997,8 +997,8 @@ public:
|
||||
private:
|
||||
struct TokenInfo {
|
||||
Token token;
|
||||
unsigned line;
|
||||
unsigned column;
|
||||
int line;
|
||||
int column;
|
||||
};
|
||||
QList<TokenInfo> m_tokenInfos;
|
||||
};
|
||||
|
@@ -94,8 +94,8 @@ public:
|
||||
// The 'target' prefix denotes information about the remote declaration matching
|
||||
// the 'source' declaration, where we will try to apply the user changes.
|
||||
// 1-based line and column
|
||||
unsigned targetLine = 0;
|
||||
unsigned targetColumn = 0;
|
||||
int targetLine = 0;
|
||||
int targetColumn = 0;
|
||||
QString targetInitial;
|
||||
|
||||
CppTools::CppRefactoringFileConstPtr targetFile;
|
||||
|
@@ -86,7 +86,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
||||
return;
|
||||
}
|
||||
|
||||
const unsigned firstNonSpace = tokens.first().utf16charsBegin();
|
||||
const int firstNonSpace = tokens.first().utf16charsBegin();
|
||||
|
||||
Parentheses parentheses;
|
||||
parentheses.reserve(5);
|
||||
@@ -97,7 +97,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
||||
for (int i = 0; i < tokens.size(); ++i) {
|
||||
const Token &tk = tokens.at(i);
|
||||
|
||||
unsigned previousTokenEnd = 0;
|
||||
int previousTokenEnd = 0;
|
||||
if (i != 0) {
|
||||
// mark the whitespaces
|
||||
previousTokenEnd = tokens.at(i - 1).utf16charsBegin() +
|
||||
|
@@ -844,7 +844,7 @@ public:
|
||||
|
||||
// make target lookup context
|
||||
Document::Ptr implementationDoc = implementationFile->cppDocument();
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
implementationDoc->translationUnit()->getPosition(insertPos, &line, &column);
|
||||
Scope *targetScope = implementationDoc->scopeAt(line, column);
|
||||
const LookupContext targetContext(implementationDoc, snapshot());
|
||||
@@ -853,7 +853,7 @@ public:
|
||||
targetCoN = targetContext.globalNamespace();
|
||||
|
||||
// Loop through inserted declarations
|
||||
for (unsigned i = targetClass->memberCount(); i < clazz->memberCount(); ++i) {
|
||||
for (int i = targetClass->memberCount(); i < clazz->memberCount(); ++i) {
|
||||
Declaration *decl = clazz->memberAt(i)->asDeclaration();
|
||||
if (!decl)
|
||||
continue;
|
||||
|
@@ -131,7 +131,7 @@ InsertionLocation insertLocationForMethodDefinition(Symbol *symbol, const bool u
|
||||
// ...failed,
|
||||
// if class member try to get position right after class
|
||||
CppRefactoringFilePtr file = refactoring.file(fileName);
|
||||
unsigned line = 0, column = 0;
|
||||
int line = 0, column = 0;
|
||||
if (Class *clazz = symbol->enclosingClass()) {
|
||||
if (symbol->fileName() == fileName.toUtf8()) {
|
||||
file->cppDocument()->translationUnit()->getPosition(clazz->endOffset(), &line, &column);
|
||||
@@ -1854,7 +1854,7 @@ bool canLookupDefinition(const CppQuickFixInterface &interface, const NameAST *n
|
||||
QTC_ASSERT(nameAst && nameAst->name, return false);
|
||||
|
||||
// Find the enclosing scope
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
const Document::Ptr &doc = interface.semanticInfo().doc;
|
||||
doc->translationUnit()->getTokenStartPosition(nameAst->firstToken(), &line, &column);
|
||||
Scope *scope = doc->scopeAt(line, column);
|
||||
@@ -2364,7 +2364,7 @@ void CompleteSwitchCaseStatement::match(const CppQuickFixInterface &interface,
|
||||
// check the possible enum values
|
||||
QStringList values;
|
||||
Overview prettyPrint;
|
||||
for (unsigned i = 0; i < e->memberCount(); ++i) {
|
||||
for (int i = 0; i < e->memberCount(); ++i) {
|
||||
if (Declaration *decl = e->memberAt(i)->asDeclaration())
|
||||
values << prettyPrint.prettyName(LookupContext::fullyQualifiedName(decl));
|
||||
}
|
||||
@@ -2752,7 +2752,7 @@ void InsertDefFromDecl::match(const CppQuickFixInterface &interface, QuickFixOpe
|
||||
|
||||
// Insert Position: Inside Class
|
||||
// Determine insert location direct after the declaration.
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
const CppRefactoringFilePtr file = interface.currentFile();
|
||||
file->lineAndColumn(file->endOf(simpleDecl), &line, &column);
|
||||
const InsertionLocation loc
|
||||
@@ -2779,7 +2779,7 @@ bool hasClassMemberWithGetPrefix(const Class *klass)
|
||||
if (!klass)
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i) {
|
||||
for (int i = 0; i < klass->memberCount(); ++i) {
|
||||
const Symbol *symbol = klass->memberAt(i);
|
||||
if (symbol->isFunction() || symbol->isDeclaration()) {
|
||||
if (const Name *symbolName = symbol->name()) {
|
||||
@@ -2872,7 +2872,7 @@ public:
|
||||
bool hasGetter = false;
|
||||
bool hasSetter = false;
|
||||
if (Class *klass = m_classSpecifier->symbol) {
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i) {
|
||||
for (int i = 0; i < klass->memberCount(); ++i) {
|
||||
Symbol *symbol = klass->memberAt(i);
|
||||
if (symbol->isQtPropertyDeclaration())
|
||||
continue;
|
||||
@@ -3125,7 +3125,7 @@ public:
|
||||
|
||||
// Create and apply changes
|
||||
ChangeSet currChanges;
|
||||
int declInsertPos = currentFile->position(qMax(1u, declLocation.line()),
|
||||
int declInsertPos = currentFile->position(qMax(1, declLocation.line()),
|
||||
declLocation.column());
|
||||
currChanges.insert(declInsertPos, declaration);
|
||||
|
||||
@@ -4608,7 +4608,7 @@ void InsertQtPropertyMembers::match(const CppQuickFixInterface &interface,
|
||||
Class *c = klass->symbol;
|
||||
|
||||
Overview overview;
|
||||
for (unsigned i = 0; i < c->memberCount(); ++i) {
|
||||
for (int i = 0; i < c->memberCount(); ++i) {
|
||||
Symbol *member = c->memberAt(i);
|
||||
FullySpecifiedType type = member->type();
|
||||
if (member->asFunction() || (type.isValid() && type->asFunctionType())) {
|
||||
|
@@ -232,7 +232,7 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti
|
||||
i = j - 1; // Continue with next not expanded token
|
||||
} else {
|
||||
// Position the cursor on the token
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
translationUnit->getPosition(token.utf16charsBegin(), &line, &column);
|
||||
editor->gotoLine(line, column - 1);
|
||||
QApplication::processEvents();
|
||||
@@ -287,7 +287,7 @@ void TestActionsTestCase::moveWordCamelCaseToToken(TranslationUnit *translationU
|
||||
CppEditorWidget *editorWidget = dynamic_cast<CppEditorWidget *>(editor->editorWidget());
|
||||
QVERIFY(editorWidget);
|
||||
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
translationUnit->getPosition(token.utf16charsBegin(), &line, &column);
|
||||
|
||||
while (editor->currentLine() < (int) line
|
||||
|
@@ -55,26 +55,24 @@ CursorInfo::Range toRange(const SemanticInfo::Use &use)
|
||||
|
||||
CursorInfo::Range toRange(int tokenIndex, TranslationUnit *translationUnit)
|
||||
{
|
||||
unsigned line, column;
|
||||
translationUnit->getTokenPosition(static_cast<unsigned>(tokenIndex), &line, &column);
|
||||
int line, column;
|
||||
translationUnit->getTokenPosition(tokenIndex, &line, &column);
|
||||
if (column)
|
||||
--column; // adjust the column position.
|
||||
|
||||
return {line,
|
||||
column + 1,
|
||||
translationUnit->tokenAt(static_cast<unsigned>(tokenIndex)).utf16chars()};
|
||||
translationUnit->tokenAt(tokenIndex).utf16chars()};
|
||||
}
|
||||
|
||||
CursorInfo::Range toRange(const QTextCursor &textCursor,
|
||||
unsigned utf16offset,
|
||||
unsigned length)
|
||||
CursorInfo::Range toRange(const QTextCursor &textCursor, int utf16offset, int length)
|
||||
{
|
||||
QTextCursor cursor(textCursor.document());
|
||||
cursor.setPosition(static_cast<int>(utf16offset));
|
||||
cursor.setPosition(utf16offset);
|
||||
const QTextBlock textBlock = cursor.block();
|
||||
|
||||
return {static_cast<unsigned>(textBlock.blockNumber() + 1),
|
||||
static_cast<unsigned>(cursor.position() - textBlock.position() + 1),
|
||||
return {textBlock.blockNumber() + 1,
|
||||
cursor.position() - textBlock.position() + 1,
|
||||
length};
|
||||
}
|
||||
|
||||
@@ -102,8 +100,8 @@ CursorInfo::Ranges toRanges(const QList<int> &tokenIndices, TranslationUnit *tra
|
||||
|
||||
class FunctionDefinitionUnderCursor: protected ASTVisitor
|
||||
{
|
||||
unsigned m_line = 0;
|
||||
unsigned m_column = 0;
|
||||
int m_line = 0;
|
||||
int m_column = 0;
|
||||
DeclarationAST *m_functionDefinition = nullptr;
|
||||
|
||||
public:
|
||||
@@ -111,7 +109,7 @@ public:
|
||||
: ASTVisitor(translationUnit)
|
||||
{ }
|
||||
|
||||
DeclarationAST *operator()(AST *ast, unsigned line, unsigned column)
|
||||
DeclarationAST *operator()(AST *ast, int line, int column)
|
||||
{
|
||||
m_functionDefinition = nullptr;
|
||||
m_line = line;
|
||||
@@ -140,8 +138,8 @@ protected:
|
||||
private:
|
||||
bool checkDeclaration(DeclarationAST *ast)
|
||||
{
|
||||
unsigned startLine, startColumn;
|
||||
unsigned endLine, endColumn;
|
||||
int startLine, startColumn;
|
||||
int endLine, endColumn;
|
||||
getTokenStartPosition(ast->firstToken(), &startLine, &startColumn);
|
||||
getTokenEndPosition(ast->lastToken() - 1, &endLine, &endColumn);
|
||||
|
||||
@@ -214,9 +212,8 @@ private:
|
||||
|
||||
bool good = false;
|
||||
foreach (const CppTools::SemanticInfo::Use &use, uses) {
|
||||
const auto l = static_cast<unsigned>(m_line);
|
||||
const auto c = static_cast<unsigned>(m_column);
|
||||
if (l == use.line && c >= use.column && c <= (use.column + use.length)) {
|
||||
if (m_line == use.line && m_column >= use.column
|
||||
&& m_column <= static_cast<int>(use.column + use.length)) {
|
||||
good = true;
|
||||
break;
|
||||
}
|
||||
@@ -293,7 +290,7 @@ bool handleMacroCase(const Document::Ptr document,
|
||||
if (!macro)
|
||||
return false;
|
||||
|
||||
const unsigned length = static_cast<unsigned>(macro->nameToQString().size());
|
||||
const int length = macro->nameToQString().size();
|
||||
|
||||
// Macro definition
|
||||
if (macro->fileName() == document->fileName())
|
||||
@@ -359,9 +356,7 @@ BuiltinCursorInfo::findLocalUses(const Document::Ptr &document, int line, int co
|
||||
|
||||
AST *ast = document->translationUnit()->ast();
|
||||
FunctionDefinitionUnderCursor functionDefinitionUnderCursor(document->translationUnit());
|
||||
DeclarationAST *declaration = functionDefinitionUnderCursor(ast,
|
||||
static_cast<unsigned>(line),
|
||||
static_cast<unsigned>(column));
|
||||
DeclarationAST *declaration = functionDefinitionUnderCursor(ast, line, column);
|
||||
return CppTools::LocalSymbols(document, declaration).uses;
|
||||
}
|
||||
|
||||
|
@@ -71,7 +71,7 @@ QList<QTextEdit::ExtraSelection> toTextEditorSelections(
|
||||
QTextCursor c(textDocument->findBlockByNumber(m.line() - 1));
|
||||
const QString text = c.block().text();
|
||||
const int startPos = m.column() > 0 ? m.column() - 1 : 0;
|
||||
if (m.length() > 0 && startPos + m.length() <= (unsigned)text.size()) {
|
||||
if (m.length() > 0 && startPos + m.length() <= text.size()) {
|
||||
c.setPosition(c.position() + startPos);
|
||||
c.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, m.length());
|
||||
} else {
|
||||
|
@@ -314,9 +314,9 @@ CheckSymbols::CheckSymbols(Document::Ptr doc, const LookupContext &context, cons
|
||||
: ASTVisitor(doc->translationUnit()), _doc(doc), _context(context)
|
||||
, _lineOfLastUsage(0), _macroUses(macroUses)
|
||||
{
|
||||
unsigned line = 0;
|
||||
int line = 0;
|
||||
getTokenEndPosition(translationUnit()->ast()->lastToken(), &line, nullptr);
|
||||
_chunkSize = qMax(50U, line / 200);
|
||||
_chunkSize = qMax(50, line / 200);
|
||||
_usages.reserve(_chunkSize);
|
||||
|
||||
_astStack.reserve(200);
|
||||
@@ -365,7 +365,7 @@ bool CheckSymbols::warning(AST *ast, const QString &text)
|
||||
const Token &lastToken = tokenAt(ast->lastToken() - 1);
|
||||
|
||||
const unsigned length = lastToken.utf16charsEnd() - firstToken.utf16charsBegin();
|
||||
unsigned line = 1, column = 1;
|
||||
int line = 1, column = 1;
|
||||
getTokenStartPosition(ast->firstToken(), &line, &column);
|
||||
|
||||
warning(line, column, text, length);
|
||||
@@ -478,7 +478,7 @@ bool CheckSymbols::visit(NamespaceAST *ast)
|
||||
if (ast->identifier_token) {
|
||||
const Token &tok = tokenAt(ast->identifier_token);
|
||||
if (!tok.generated()) {
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(ast->identifier_token, &line, &column);
|
||||
Result use(line, column, tok.utf16chars(), SemanticHighlighter::TypeUse);
|
||||
addUse(use);
|
||||
@@ -786,7 +786,7 @@ void CheckSymbols::checkNamespace(NameAST *name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(name->firstToken(), &line, &column);
|
||||
|
||||
if (ClassOrNamespace *b = _context.lookupType(name->name, enclosingScope())) {
|
||||
@@ -1184,7 +1184,7 @@ void CheckSymbols::addUse(unsigned tokenIndex, Kind kind)
|
||||
if (tok.generated())
|
||||
return;
|
||||
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(tokenIndex, &line, &column);
|
||||
const unsigned length = tok.utf16chars();
|
||||
|
||||
@@ -1221,7 +1221,7 @@ void CheckSymbols::addType(ClassOrNamespace *b, NameAST *ast)
|
||||
if (tok.generated())
|
||||
return;
|
||||
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(startToken, &line, &column);
|
||||
const unsigned length = tok.utf16chars();
|
||||
const Result use(line, column, length, SemanticHighlighter::TypeUse);
|
||||
@@ -1263,7 +1263,7 @@ bool CheckSymbols::maybeAddTypeOrStatic(const QList<LookupItem> &candidates, Nam
|
||||
c->isClass() || c->isEnum() || isTemplateClass(c) ||
|
||||
c->isForwardClassDeclaration() || c->isTypenameArgument() || c->enclosingEnum() != nullptr) {
|
||||
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(startToken, &line, &column);
|
||||
const unsigned length = tok.utf16chars();
|
||||
|
||||
@@ -1305,7 +1305,7 @@ bool CheckSymbols::maybeAddField(const QList<LookupItem> &candidates, NameAST *a
|
||||
else if (c->isTypedef() || (c->type() && c->type()->isFunctionType()))
|
||||
return false; // shadowed
|
||||
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(startToken, &line, &column);
|
||||
const unsigned length = tok.utf16chars();
|
||||
|
||||
@@ -1319,9 +1319,9 @@ bool CheckSymbols::maybeAddField(const QList<LookupItem> &candidates, NameAST *a
|
||||
}
|
||||
|
||||
bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST *ast,
|
||||
unsigned argumentCount, FunctionKind functionKind)
|
||||
int argumentCount, FunctionKind functionKind)
|
||||
{
|
||||
unsigned startToken = ast->firstToken();
|
||||
int startToken = ast->firstToken();
|
||||
bool isDestructor = false;
|
||||
bool isConstructor = false;
|
||||
if (DestructorNameAST *dtor = ast->asDestructorName()) {
|
||||
@@ -1399,7 +1399,7 @@ bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(startToken, &line, &column);
|
||||
const unsigned length = tok.utf16chars();
|
||||
|
||||
|
@@ -132,7 +132,7 @@ protected:
|
||||
bool maybeAddField(const QList<CPlusPlus::LookupItem> &candidates,
|
||||
CPlusPlus::NameAST *ast);
|
||||
bool maybeAddFunction(const QList<CPlusPlus::LookupItem> &candidates,
|
||||
CPlusPlus::NameAST *ast, unsigned argumentCount,
|
||||
CPlusPlus::NameAST *ast, int argumentCount,
|
||||
FunctionKind functionKind);
|
||||
|
||||
bool isTemplateClass(CPlusPlus::Symbol *s) const;
|
||||
@@ -201,7 +201,7 @@ private:
|
||||
QVector<Result> _usages;
|
||||
QList<CPlusPlus::Document::DiagnosticMessage> _diagMsgs;
|
||||
int _chunkSize;
|
||||
unsigned _lineOfLastUsage;
|
||||
int _lineOfLastUsage;
|
||||
QList<Result> _macroUses;
|
||||
};
|
||||
|
||||
|
@@ -45,7 +45,7 @@ using namespace CppTools::Internal;
|
||||
namespace {
|
||||
|
||||
Document::Ptr createDocument(const QString &filePath, const QByteArray &text,
|
||||
unsigned expectedGlobalSymbolCount)
|
||||
int expectedGlobalSymbolCount)
|
||||
{
|
||||
Document::Ptr document = Document::create(filePath);
|
||||
document->setUtf8Source(text);
|
||||
@@ -59,7 +59,7 @@ Document::Ptr createDocument(const QString &filePath, const QByteArray &text,
|
||||
Document::Ptr createDocumentAndFile(Tests::TemporaryDir *temporaryDir,
|
||||
const QByteArray relativeFilePath,
|
||||
const QByteArray text,
|
||||
unsigned expectedGlobalSymbolCount)
|
||||
int expectedGlobalSymbolCount)
|
||||
{
|
||||
QTC_ASSERT(temporaryDir, return Document::Ptr());
|
||||
const QString absoluteFilePath = temporaryDir->createFile(relativeFilePath, text);
|
||||
@@ -80,13 +80,13 @@ void CppToolsPlugin::test_codegen_public_in_empty_class()
|
||||
"{\n"
|
||||
"};\n"
|
||||
"\n";
|
||||
Document::Ptr doc = createDocument(QLatin1String("public_in_empty_class"), src, 1U);
|
||||
Document::Ptr doc = createDocument(QLatin1String("public_in_empty_class"), src, 1);
|
||||
QVERIFY(doc);
|
||||
|
||||
Class *foo = doc->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
@@ -99,8 +99,8 @@ void CppToolsPlugin::test_codegen_public_in_empty_class()
|
||||
QVERIFY(loc.isValid());
|
||||
QCOMPARE(loc.prefix(), QLatin1String("public:\n"));
|
||||
QVERIFY(loc.suffix().isEmpty());
|
||||
QCOMPARE(loc.line(), 3U);
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 3);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -114,13 +114,13 @@ void CppToolsPlugin::test_codegen_public_in_nonempty_class()
|
||||
"public:\n" // line 3
|
||||
"};\n" // line 4
|
||||
"\n";
|
||||
Document::Ptr doc = createDocument(QLatin1String("public_in_nonempty_class"), src, 1U);
|
||||
Document::Ptr doc = createDocument(QLatin1String("public_in_nonempty_class"), src, 1);
|
||||
QVERIFY(doc);
|
||||
|
||||
Class *foo = doc->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
@@ -133,8 +133,8 @@ void CppToolsPlugin::test_codegen_public_in_nonempty_class()
|
||||
QVERIFY(loc.isValid());
|
||||
QVERIFY(loc.prefix().isEmpty());
|
||||
QVERIFY(loc.suffix().isEmpty());
|
||||
QCOMPARE(loc.line(), 4U);
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 4);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -148,13 +148,13 @@ void CppToolsPlugin::test_codegen_public_before_protected()
|
||||
"protected:\n" // line 3
|
||||
"};\n"
|
||||
"\n";
|
||||
Document::Ptr doc = createDocument(QLatin1String("public_before_protected"), src, 1U);
|
||||
Document::Ptr doc = createDocument(QLatin1String("public_before_protected"), src, 1);
|
||||
QVERIFY(doc);
|
||||
|
||||
Class *foo = doc->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
@@ -167,8 +167,8 @@ void CppToolsPlugin::test_codegen_public_before_protected()
|
||||
QVERIFY(loc.isValid());
|
||||
QCOMPARE(loc.prefix(), QLatin1String("public:\n"));
|
||||
QCOMPARE(loc.suffix(), QLatin1String("\n"));
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 3U);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
QCOMPARE(loc.line(), 3);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -183,13 +183,13 @@ void CppToolsPlugin::test_codegen_private_after_protected()
|
||||
"protected:\n" // line 3
|
||||
"};\n"
|
||||
"\n";
|
||||
Document::Ptr doc = createDocument(QLatin1String("private_after_protected"), src, 1U);
|
||||
Document::Ptr doc = createDocument(QLatin1String("private_after_protected"), src, 1);
|
||||
QVERIFY(doc);
|
||||
|
||||
Class *foo = doc->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
@@ -202,8 +202,8 @@ void CppToolsPlugin::test_codegen_private_after_protected()
|
||||
QVERIFY(loc.isValid());
|
||||
QCOMPARE(loc.prefix(), QLatin1String("private:\n"));
|
||||
QVERIFY(loc.suffix().isEmpty());
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 4U);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
QCOMPARE(loc.line(), 4);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -218,13 +218,13 @@ void CppToolsPlugin::test_codegen_protected_in_nonempty_class()
|
||||
"public:\n" // line 3
|
||||
"};\n" // line 4
|
||||
"\n";
|
||||
Document::Ptr doc = createDocument(QLatin1String("protected_in_nonempty_class"), src, 1U);
|
||||
Document::Ptr doc = createDocument(QLatin1String("protected_in_nonempty_class"), src, 1);
|
||||
QVERIFY(doc);
|
||||
|
||||
Class *foo = doc->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
@@ -237,8 +237,8 @@ void CppToolsPlugin::test_codegen_protected_in_nonempty_class()
|
||||
QVERIFY(loc.isValid());
|
||||
QCOMPARE(loc.prefix(), QLatin1String("protected:\n"));
|
||||
QVERIFY(loc.suffix().isEmpty());
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 4U);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
QCOMPARE(loc.line(), 4);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -253,13 +253,13 @@ void CppToolsPlugin::test_codegen_protected_between_public_and_private()
|
||||
"private:\n" // line 4
|
||||
"};\n" // line 5
|
||||
"\n";
|
||||
Document::Ptr doc = createDocument(QLatin1String("protected_betwee_public_and_private"), src, 1U);
|
||||
Document::Ptr doc = createDocument(QLatin1String("protected_betwee_public_and_private"), src, 1);
|
||||
QVERIFY(doc);
|
||||
|
||||
Class *foo = doc->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
@@ -272,8 +272,8 @@ void CppToolsPlugin::test_codegen_protected_between_public_and_private()
|
||||
QVERIFY(loc.isValid());
|
||||
QCOMPARE(loc.prefix(), QLatin1String("protected:\n"));
|
||||
QCOMPARE(loc.suffix(), QLatin1String("\n"));
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 4U);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
QCOMPARE(loc.line(), 4);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -309,13 +309,13 @@ void CppToolsPlugin::test_codegen_qtdesigner_integration()
|
||||
"\n"
|
||||
"#endif // MAINWINDOW_H\n";
|
||||
|
||||
Document::Ptr doc = createDocument(QLatin1String("qtdesigner_integration"), src, 2U);
|
||||
Document::Ptr doc = createDocument(QLatin1String("qtdesigner_integration"), src, 2);
|
||||
QVERIFY(doc);
|
||||
|
||||
Class *foo = doc->globalSymbolAt(1)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 10U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->line(), 10);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
@@ -328,8 +328,8 @@ void CppToolsPlugin::test_codegen_qtdesigner_integration()
|
||||
QVERIFY(loc.isValid());
|
||||
QCOMPARE(loc.prefix(), QLatin1String("private slots:\n"));
|
||||
QCOMPARE(loc.suffix(), QLatin1String("\n"));
|
||||
QCOMPARE(loc.line(), 18U);
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 18);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_codegen_definition_empty_class()
|
||||
@@ -343,13 +343,13 @@ void CppToolsPlugin::test_codegen_definition_empty_class()
|
||||
"void foo();\n" // line 3
|
||||
"};\n"
|
||||
"\n";
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1U);
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1);
|
||||
QVERIFY(headerDocument);
|
||||
|
||||
const QByteArray sourceText = "\n"
|
||||
"int x;\n" // line 1
|
||||
"\n";
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 1U);
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 1);
|
||||
QVERIFY(sourceDocument);
|
||||
|
||||
Snapshot snapshot;
|
||||
@@ -358,13 +358,13 @@ void CppToolsPlugin::test_codegen_definition_empty_class()
|
||||
|
||||
Class *foo = headerDocument->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->memberCount(), 1U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
QCOMPARE(foo->memberCount(), 1);
|
||||
Declaration *decl = foo->memberAt(0)->asDeclaration();
|
||||
QVERIFY(decl);
|
||||
QCOMPARE(decl->line(), 3U);
|
||||
QCOMPARE(decl->column(), 6U);
|
||||
QCOMPARE(decl->line(), 3);
|
||||
QCOMPARE(decl->column(), 6);
|
||||
|
||||
CppRefactoringChanges changes(snapshot);
|
||||
InsertionPointLocator find(changes);
|
||||
@@ -374,8 +374,8 @@ void CppToolsPlugin::test_codegen_definition_empty_class()
|
||||
QCOMPARE(loc.fileName(), sourceDocument->fileName());
|
||||
QCOMPARE(loc.prefix(), QLatin1String("\n\n"));
|
||||
QCOMPARE(loc.suffix(), QString());
|
||||
QCOMPARE(loc.line(), 3U);
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 3);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_codegen_definition_first_member()
|
||||
@@ -390,7 +390,7 @@ void CppToolsPlugin::test_codegen_definition_first_member()
|
||||
"void bar();\n" // line 4
|
||||
"};\n"
|
||||
"\n";
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1U);
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1);
|
||||
QVERIFY(headerDocument);
|
||||
|
||||
const QByteArray sourceText = QString::fromLatin1(
|
||||
@@ -404,7 +404,7 @@ void CppToolsPlugin::test_codegen_definition_first_member()
|
||||
"}\n"
|
||||
"\n"
|
||||
"int y;\n").arg(temporaryDir.path()).toLatin1();
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3U);
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3);
|
||||
QVERIFY(sourceDocument);
|
||||
sourceDocument->addIncludeFile(Document::Include(QLatin1String("file.h"),
|
||||
headerDocument->fileName(), 1,
|
||||
@@ -416,13 +416,13 @@ void CppToolsPlugin::test_codegen_definition_first_member()
|
||||
|
||||
Class *foo = headerDocument->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->memberCount(), 2U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
QCOMPARE(foo->memberCount(), 2);
|
||||
Declaration *decl = foo->memberAt(0)->asDeclaration();
|
||||
QVERIFY(decl);
|
||||
QCOMPARE(decl->line(), 3U);
|
||||
QCOMPARE(decl->column(), 6U);
|
||||
QCOMPARE(decl->line(), 3);
|
||||
QCOMPARE(decl->column(), 6);
|
||||
|
||||
CppRefactoringChanges changes(snapshot);
|
||||
InsertionPointLocator find(changes);
|
||||
@@ -430,8 +430,8 @@ void CppToolsPlugin::test_codegen_definition_first_member()
|
||||
QVERIFY(locList.size() == 1);
|
||||
InsertionLocation loc = locList.first();
|
||||
QCOMPARE(loc.fileName(), sourceDocument->fileName());
|
||||
QCOMPARE(loc.line(), 4U);
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 4);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
QCOMPARE(loc.suffix(), QLatin1String("\n\n"));
|
||||
QCOMPARE(loc.prefix(), QString());
|
||||
}
|
||||
@@ -448,7 +448,7 @@ void CppToolsPlugin::test_codegen_definition_last_member()
|
||||
"void bar();\n" // line 4
|
||||
"};\n"
|
||||
"\n";
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1U);
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1);
|
||||
QVERIFY(headerDocument);
|
||||
|
||||
const QByteArray sourceText = QString::fromLatin1(
|
||||
@@ -463,7 +463,7 @@ void CppToolsPlugin::test_codegen_definition_last_member()
|
||||
"\n"
|
||||
"int y;\n").arg(temporaryDir.path()).toLatin1();
|
||||
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3U);
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3);
|
||||
QVERIFY(sourceDocument);
|
||||
sourceDocument->addIncludeFile(Document::Include(QLatin1String("file.h"),
|
||||
headerDocument->fileName(), 1,
|
||||
@@ -475,13 +475,13 @@ void CppToolsPlugin::test_codegen_definition_last_member()
|
||||
|
||||
Class *foo = headerDocument->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->memberCount(), 2U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
QCOMPARE(foo->memberCount(), 2);
|
||||
Declaration *decl = foo->memberAt(1)->asDeclaration();
|
||||
QVERIFY(decl);
|
||||
QCOMPARE(decl->line(), 4U);
|
||||
QCOMPARE(decl->column(), 6U);
|
||||
QCOMPARE(decl->line(), 4);
|
||||
QCOMPARE(decl->column(), 6);
|
||||
|
||||
CppRefactoringChanges changes(snapshot);
|
||||
InsertionPointLocator find(changes);
|
||||
@@ -489,8 +489,8 @@ void CppToolsPlugin::test_codegen_definition_last_member()
|
||||
QVERIFY(locList.size() == 1);
|
||||
InsertionLocation loc = locList.first();
|
||||
QCOMPARE(loc.fileName(), sourceDocument->fileName());
|
||||
QCOMPARE(loc.line(), 7U);
|
||||
QCOMPARE(loc.column(), 2U);
|
||||
QCOMPARE(loc.line(), 7);
|
||||
QCOMPARE(loc.column(), 2);
|
||||
QCOMPARE(loc.prefix(), QLatin1String("\n\n"));
|
||||
QCOMPARE(loc.suffix(), QString());
|
||||
}
|
||||
@@ -509,7 +509,7 @@ void CppToolsPlugin::test_codegen_definition_middle_member()
|
||||
"};\n"
|
||||
"\n";
|
||||
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1U);
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1);
|
||||
QVERIFY(headerDocument);
|
||||
|
||||
const QByteArray sourceText = QString::fromLatin1(
|
||||
@@ -529,7 +529,7 @@ void CppToolsPlugin::test_codegen_definition_middle_member()
|
||||
"\n"
|
||||
"int y;\n").arg(Utils::TemporaryDirectory::masterDirectoryPath()).toLatin1();
|
||||
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 4U);
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 4);
|
||||
QVERIFY(sourceDocument);
|
||||
sourceDocument->addIncludeFile(Document::Include(QLatin1String("file.h"),
|
||||
headerDocument->fileName(), 1,
|
||||
@@ -541,13 +541,13 @@ void CppToolsPlugin::test_codegen_definition_middle_member()
|
||||
|
||||
Class *foo = headerDocument->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->memberCount(), 3U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
QCOMPARE(foo->memberCount(), 3);
|
||||
Declaration *decl = foo->memberAt(1)->asDeclaration();
|
||||
QVERIFY(decl);
|
||||
QCOMPARE(decl->line(), 4U);
|
||||
QCOMPARE(decl->column(), 6U);
|
||||
QCOMPARE(decl->line(), 4);
|
||||
QCOMPARE(decl->column(), 6);
|
||||
|
||||
CppRefactoringChanges changes(snapshot);
|
||||
InsertionPointLocator find(changes);
|
||||
@@ -555,8 +555,8 @@ void CppToolsPlugin::test_codegen_definition_middle_member()
|
||||
QVERIFY(locList.size() == 1);
|
||||
InsertionLocation loc = locList.first();
|
||||
QCOMPARE(loc.fileName(), sourceDocument->fileName());
|
||||
QCOMPARE(loc.line(), 7U);
|
||||
QCOMPARE(loc.column(), 2U);
|
||||
QCOMPARE(loc.line(), 7);
|
||||
QCOMPARE(loc.column(), 2);
|
||||
QCOMPARE(loc.prefix(), QLatin1String("\n\n"));
|
||||
QCOMPARE(loc.suffix(), QString());
|
||||
}
|
||||
@@ -575,7 +575,7 @@ void CppToolsPlugin::test_codegen_definition_middle_member_surrounded_by_undefin
|
||||
"void car();\n" // line 6
|
||||
"};\n"
|
||||
"\n";
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1U);
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 1);
|
||||
QVERIFY(headerDocument);
|
||||
|
||||
const QByteArray sourceText = QString::fromLatin1(
|
||||
@@ -589,7 +589,7 @@ void CppToolsPlugin::test_codegen_definition_middle_member_surrounded_by_undefin
|
||||
"}\n"
|
||||
"\n"
|
||||
"int y;\n").arg(temporaryDir.path()).toLatin1();
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3U);
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3);
|
||||
QVERIFY(sourceDocument);
|
||||
sourceDocument->addIncludeFile(Document::Include(QLatin1String("file.h"),
|
||||
headerDocument->fileName(), 1,
|
||||
@@ -601,13 +601,13 @@ void CppToolsPlugin::test_codegen_definition_middle_member_surrounded_by_undefin
|
||||
|
||||
Class *foo = headerDocument->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->memberCount(), 4U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
QCOMPARE(foo->memberCount(), 4);
|
||||
Declaration *decl = foo->memberAt(1)->asDeclaration();
|
||||
QVERIFY(decl);
|
||||
QCOMPARE(decl->line(), 4U);
|
||||
QCOMPARE(decl->column(), 6U);
|
||||
QCOMPARE(decl->line(), 4);
|
||||
QCOMPARE(decl->column(), 6);
|
||||
|
||||
CppRefactoringChanges changes(snapshot);
|
||||
InsertionPointLocator find(changes);
|
||||
@@ -615,8 +615,8 @@ void CppToolsPlugin::test_codegen_definition_middle_member_surrounded_by_undefin
|
||||
QVERIFY(locList.size() == 1);
|
||||
InsertionLocation loc = locList.first();
|
||||
QCOMPARE(loc.fileName(), sourceDocument->fileName());
|
||||
QCOMPARE(loc.line(), 4U);
|
||||
QCOMPARE(loc.column(), 1U);
|
||||
QCOMPARE(loc.line(), 4);
|
||||
QCOMPARE(loc.column(), 1);
|
||||
QCOMPARE(loc.prefix(), QString());
|
||||
QCOMPARE(loc.suffix(), QLatin1String("\n\n"));
|
||||
}
|
||||
@@ -638,7 +638,7 @@ void CppToolsPlugin::test_codegen_definition_member_specific_file()
|
||||
"{\n"
|
||||
"\n"
|
||||
"}\n";
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 2U);
|
||||
Document::Ptr headerDocument = createDocumentAndFile(&temporaryDir, "file.h", headerText, 2);
|
||||
QVERIFY(headerDocument);
|
||||
|
||||
const QByteArray sourceText = QString::fromLatin1(
|
||||
@@ -652,7 +652,7 @@ void CppToolsPlugin::test_codegen_definition_member_specific_file()
|
||||
"}\n" // line 7
|
||||
"\n"
|
||||
"int y;\n").arg(temporaryDir.path()).toLatin1();
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3U);
|
||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 3);
|
||||
QVERIFY(sourceDocument);
|
||||
sourceDocument->addIncludeFile(Document::Include(QLatin1String("file.h"),
|
||||
headerDocument->fileName(), 1,
|
||||
@@ -664,13 +664,13 @@ void CppToolsPlugin::test_codegen_definition_member_specific_file()
|
||||
|
||||
Class *foo = headerDocument->globalSymbolAt(0)->asClass();
|
||||
QVERIFY(foo);
|
||||
QCOMPARE(foo->line(), 1U);
|
||||
QCOMPARE(foo->column(), 7U);
|
||||
QCOMPARE(foo->memberCount(), 3U);
|
||||
QCOMPARE(foo->line(), 1);
|
||||
QCOMPARE(foo->column(), 7);
|
||||
QCOMPARE(foo->memberCount(), 3);
|
||||
Declaration *decl = foo->memberAt(2)->asDeclaration();
|
||||
QVERIFY(decl);
|
||||
QCOMPARE(decl->line(), 5U);
|
||||
QCOMPARE(decl->column(), 6U);
|
||||
QCOMPARE(decl->line(), 5);
|
||||
QCOMPARE(decl->column(), 6);
|
||||
|
||||
CppRefactoringChanges changes(snapshot);
|
||||
InsertionPointLocator find(changes);
|
||||
@@ -678,8 +678,8 @@ void CppToolsPlugin::test_codegen_definition_member_specific_file()
|
||||
QVERIFY(locList.size() == 1);
|
||||
InsertionLocation loc = locList.first();
|
||||
QCOMPARE(loc.fileName(), sourceDocument->fileName());
|
||||
QCOMPARE(loc.line(), 7U);
|
||||
QCOMPARE(loc.column(), 2U);
|
||||
QCOMPARE(loc.line(), 7);
|
||||
QCOMPARE(loc.column(), 2);
|
||||
QCOMPARE(loc.prefix(), QLatin1String("\n\n"));
|
||||
QCOMPARE(loc.suffix(), QString());
|
||||
}
|
||||
|
@@ -53,6 +53,11 @@ QString Utils::toString(bool value)
|
||||
return value ? QLatin1String("Yes") : QLatin1String("No");
|
||||
}
|
||||
|
||||
QString Utils::toString(int value)
|
||||
{
|
||||
return QString::number(value);
|
||||
}
|
||||
|
||||
QString Utils::toString(unsigned value)
|
||||
{
|
||||
return QString::number(value);
|
||||
|
@@ -42,6 +42,7 @@ namespace CppCodeModelInspector {
|
||||
struct CPPTOOLS_EXPORT Utils
|
||||
{
|
||||
static QString toString(bool value);
|
||||
static QString toString(int value);
|
||||
static QString toString(unsigned value);
|
||||
static QString toString(const QDateTime &dateTime);
|
||||
static QString toString(CPlusPlus::Document::CheckMode checkMode);
|
||||
|
@@ -1203,7 +1203,7 @@ void InternalCppCompletionAssistProcessor::completeObjCMsgSend(ClassOrNamespace
|
||||
}
|
||||
|
||||
foreach (Scope *scope, memberScopes) {
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
for (int i = 0; i < scope->memberCount(); ++i) {
|
||||
Symbol *symbol = scope->memberAt(i);
|
||||
|
||||
if (ObjCMethod *method = symbol->type()->asObjCMethodType()) {
|
||||
@@ -1214,7 +1214,7 @@ void InternalCppCompletionAssistProcessor::completeObjCMsgSend(ClassOrNamespace
|
||||
QString text;
|
||||
QString data;
|
||||
if (selectorName->hasArguments()) {
|
||||
for (unsigned i = 0; i < selectorName->nameCount(); ++i) {
|
||||
for (int i = 0; i < selectorName->nameCount(); ++i) {
|
||||
if (i > 0)
|
||||
text += QLatin1Char(' ');
|
||||
Symbol *arg = method->argumentAt(i);
|
||||
@@ -1320,8 +1320,8 @@ bool InternalCppCompletionAssistProcessor::objcKeywordsWanted() const
|
||||
}
|
||||
|
||||
int InternalCppCompletionAssistProcessor::startCompletionInternal(const QString &fileName,
|
||||
unsigned line,
|
||||
unsigned positionInBlock,
|
||||
int line,
|
||||
int positionInBlock,
|
||||
const QString &expr,
|
||||
int endOfExpression)
|
||||
{
|
||||
@@ -1467,7 +1467,7 @@ bool InternalCppCompletionAssistProcessor::globalCompletion(Scope *currentScope)
|
||||
for (Scope *scope = currentScope; scope; scope = scope->enclosingScope()) {
|
||||
if (Block *block = scope->asBlock()) {
|
||||
if (ClassOrNamespace *binding = context.lookupType(scope)) {
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
for (int i = 0; i < scope->memberCount(); ++i) {
|
||||
Symbol *member = scope->memberAt(i);
|
||||
if (member->isEnum()) {
|
||||
if (ClassOrNamespace *b = binding->findBlock(block))
|
||||
@@ -1494,13 +1494,13 @@ bool InternalCppCompletionAssistProcessor::globalCompletion(Scope *currentScope)
|
||||
|
||||
for (Scope *scope = currentScope; scope; scope = scope->enclosingScope()) {
|
||||
if (scope->isBlock()) {
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i)
|
||||
for (int i = 0; i < scope->memberCount(); ++i)
|
||||
addCompletionItem(scope->memberAt(i), FunctionLocalsOrder);
|
||||
} else if (Function *fun = scope->asFunction()) {
|
||||
for (unsigned i = 0, argc = fun->argumentCount(); i < argc; ++i)
|
||||
for (int i = 0, argc = fun->argumentCount(); i < argc; ++i)
|
||||
addCompletionItem(fun->argumentAt(i), FunctionArgumentsOrder);
|
||||
} else if (Template *templ = scope->asTemplate()) {
|
||||
for (unsigned i = 0, argc = templ->templateParameterCount(); i < argc; ++i)
|
||||
for (int i = 0, argc = templ->templateParameterCount(); i < argc; ++i)
|
||||
addCompletionItem(templ->templateParameterAt(i), FunctionArgumentsOrder);
|
||||
break;
|
||||
}
|
||||
@@ -1799,7 +1799,7 @@ bool InternalCppCompletionAssistProcessor::completeQtMethod(const QList<LookupIt
|
||||
if (!klass)
|
||||
continue;
|
||||
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
for (int i = 0; i < scope->memberCount(); ++i) {
|
||||
Symbol *member = scope->memberAt(i);
|
||||
Function *fun = member->type()->asFunctionType();
|
||||
if (!fun || fun->isGenerated())
|
||||
@@ -1809,7 +1809,7 @@ bool InternalCppCompletionAssistProcessor::completeQtMethod(const QList<LookupIt
|
||||
else if (!wantSignals && type == CompleteQt4Slots && !fun->isSlot())
|
||||
continue;
|
||||
|
||||
unsigned count = fun->argumentCount();
|
||||
int count = fun->argumentCount();
|
||||
while (true) {
|
||||
const QString completionText = wantQt5SignalOrSlot
|
||||
? createQt5SignalOrSlot(fun, o)
|
||||
@@ -1937,7 +1937,7 @@ bool InternalCppCompletionAssistProcessor::completeConstructorOrFunction(const Q
|
||||
if (!className)
|
||||
continue; // nothing to do for anonymous classes.
|
||||
|
||||
for (unsigned i = 0; i < klass->memberCount(); ++i) {
|
||||
for (int i = 0; i < klass->memberCount(); ++i) {
|
||||
Symbol *member = klass->memberAt(i);
|
||||
const Name *memberName = member->name();
|
||||
|
||||
|
@@ -111,7 +111,7 @@ private:
|
||||
bool tryObjCCompletion();
|
||||
bool objcKeywordsWanted() const;
|
||||
int startCompletionInternal(const QString &fileName,
|
||||
unsigned line, unsigned positionInBlock,
|
||||
int line, int positionInBlock,
|
||||
const QString &expression,
|
||||
int endOfExpression);
|
||||
|
||||
|
@@ -46,16 +46,16 @@ class CPPTOOLS_EXPORT CursorInfo
|
||||
public:
|
||||
struct Range {
|
||||
Range() = default;
|
||||
Range(unsigned line, unsigned column, unsigned length)
|
||||
Range(int line, int column, int length)
|
||||
: line(line)
|
||||
, column(column)
|
||||
, length(length)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned line = 0; // 1-based
|
||||
unsigned column = 0; // 1-based
|
||||
unsigned length = 0;
|
||||
int line = 0; // 1-based
|
||||
int column = 0; // 1-based
|
||||
int length = 0;
|
||||
};
|
||||
using Ranges = QVector<Range>;
|
||||
|
||||
|
@@ -397,7 +397,7 @@ void CppElementEvaluator::checkDiagnosticMessage(int pos)
|
||||
}
|
||||
}
|
||||
|
||||
bool CppElementEvaluator::matchIncludeFile(const Document::Ptr &document, unsigned line)
|
||||
bool CppElementEvaluator::matchIncludeFile(const Document::Ptr &document, int line)
|
||||
{
|
||||
foreach (const Document::Include &includeFile, document->resolvedIncludes()) {
|
||||
if (includeFile.line() == line) {
|
||||
@@ -408,11 +408,11 @@ bool CppElementEvaluator::matchIncludeFile(const Document::Ptr &document, unsign
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CppElementEvaluator::matchMacroInUse(const Document::Ptr &document, unsigned pos)
|
||||
bool CppElementEvaluator::matchMacroInUse(const Document::Ptr &document, int pos)
|
||||
{
|
||||
foreach (const Document::MacroUse &use, document->macroUses()) {
|
||||
if (use.containsUtf16charOffset(pos)) {
|
||||
const unsigned begin = use.utf16charsBegin();
|
||||
const int begin = use.utf16charsBegin();
|
||||
if (pos < begin + use.macro().nameToQString().size()) {
|
||||
m_element = QSharedPointer<CppElement>(new CppMacro(use.macro()));
|
||||
return true;
|
||||
|
@@ -65,8 +65,8 @@ public:
|
||||
private:
|
||||
void clear();
|
||||
void checkDiagnosticMessage(int pos);
|
||||
bool matchIncludeFile(const CPlusPlus::Document::Ptr &document, unsigned line);
|
||||
bool matchMacroInUse(const CPlusPlus::Document::Ptr &document, unsigned pos);
|
||||
bool matchIncludeFile(const CPlusPlus::Document::Ptr &document, int line);
|
||||
bool matchMacroInUse(const CPlusPlus::Document::Ptr &document, int pos);
|
||||
void handleLookupItemMatch(const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::LookupItem &lookupItem,
|
||||
const CPlusPlus::LookupContext &lookupContext,
|
||||
|
@@ -353,7 +353,7 @@ Link attemptFuncDeclDef(const QTextCursor &cursor, Snapshot snapshot,
|
||||
if (target) {
|
||||
result = target->toLink();
|
||||
|
||||
unsigned startLine, startColumn, endLine, endColumn;
|
||||
int startLine, startColumn, endLine, endColumn;
|
||||
document->translationUnit()->getTokenStartPosition(name->firstToken(), &startLine,
|
||||
&startColumn);
|
||||
document->translationUnit()->getTokenEndPosition(name->lastToken() - 1, &endLine,
|
||||
@@ -540,8 +540,7 @@ void FollowSymbolUnderCursor::findLink(
|
||||
for (int i = 0; i < tokens.size(); ++i) {
|
||||
const Token &tk = tokens.at(i);
|
||||
|
||||
if (static_cast<unsigned>(positionInBlock) >= tk.utf16charsBegin()
|
||||
&& static_cast<unsigned>(positionInBlock) < tk.utf16charsEnd()) {
|
||||
if (positionInBlock >= tk.utf16charsBegin() && positionInBlock < tk.utf16charsEnd()) {
|
||||
int closingParenthesisPos = tokens.size();
|
||||
if (i >= 2 && tokens.at(i).is(T_IDENTIFIER) && tokens.at(i - 1).is(T_LPAREN)
|
||||
&& (tokens.at(i - 2).is(T_SIGNAL) || tokens.at(i - 2).is(T_SLOT))) {
|
||||
@@ -583,8 +582,7 @@ void FollowSymbolUnderCursor::findLink(
|
||||
|
||||
// In this case we want to look at one token before the current position to recognize
|
||||
// an operator if the cursor is inside the actual operator: operator[$]
|
||||
if (static_cast<unsigned>(positionInBlock) >= tk.utf16charsBegin()
|
||||
&& static_cast<unsigned>(positionInBlock) <= tk.utf16charsEnd()) {
|
||||
if (positionInBlock >= tk.utf16charsBegin() && positionInBlock <= tk.utf16charsEnd()) {
|
||||
cursorRegionReached = true;
|
||||
if (tk.is(T_OPERATOR)) {
|
||||
link = attemptFuncDeclDef(cursor, theSnapshot,
|
||||
@@ -633,7 +631,7 @@ void FollowSymbolUnderCursor::findLink(
|
||||
|
||||
// Handle include directives
|
||||
if (tk.is(T_STRING_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL)) {
|
||||
const unsigned lineno = cursor.blockNumber() + 1;
|
||||
const int lineno = cursor.blockNumber() + 1;
|
||||
foreach (const Document::Include &incl, doc->resolvedIncludes()) {
|
||||
if (incl.line() == lineno) {
|
||||
link.targetFileName = incl.resolvedFileName();
|
||||
@@ -697,8 +695,7 @@ void FollowSymbolUnderCursor::findLink(
|
||||
if (d->isDeclaration() || d->isFunction()) {
|
||||
const QString fileName = QString::fromUtf8(d->fileName(), d->fileNameLength());
|
||||
if (data.filePath().toString() == fileName) {
|
||||
if (static_cast<unsigned>(line) == d->line()
|
||||
&& static_cast<unsigned>(positionInBlock) >= d->column()) {
|
||||
if (line == d->line() && positionInBlock >= d->column()) {
|
||||
// TODO: check the end
|
||||
result = r; // take the symbol under cursor.
|
||||
break;
|
||||
@@ -709,9 +706,9 @@ void FollowSymbolUnderCursor::findLink(
|
||||
int tokenBeginColumnNumber = 0;
|
||||
Utils::Text::convertPosition(document, beginOfToken, &tokenBeginLineNumber,
|
||||
&tokenBeginColumnNumber);
|
||||
if (static_cast<unsigned>(tokenBeginLineNumber) > d->line()
|
||||
|| (static_cast<unsigned>(tokenBeginLineNumber) == d->line()
|
||||
&& static_cast<unsigned>(tokenBeginColumnNumber) >= d->column())) {
|
||||
if (tokenBeginLineNumber > d->line()
|
||||
|| (tokenBeginLineNumber == d->line()
|
||||
&& tokenBeginColumnNumber >= d->column())) {
|
||||
result = r; // take the symbol under cursor.
|
||||
break;
|
||||
}
|
||||
|
@@ -71,14 +71,14 @@ protected:
|
||||
{
|
||||
_scopeStack.append(scope);
|
||||
|
||||
for (unsigned i = 0; i < scope->memberCount(); ++i) {
|
||||
for (int i = 0; i < scope->memberCount(); ++i) {
|
||||
if (Symbol *member = scope->memberAt(i)) {
|
||||
if (member->isTypedef())
|
||||
continue;
|
||||
if (!member->isGenerated() && (member->isDeclaration() || member->isArgument())) {
|
||||
if (member->name() && member->name()->isNameId()) {
|
||||
const Token token = tokenAt(member->sourceLocation());
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getPosition(token.utf16charsBegin(), &line, &column);
|
||||
localUses[member].append(
|
||||
HighlightingResult(line, column, token.utf16chars(),
|
||||
@@ -89,7 +89,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
bool checkLocalUse(NameAST *nameAst, unsigned firstToken)
|
||||
bool checkLocalUse(NameAST *nameAst, int firstToken)
|
||||
{
|
||||
if (SimpleNameAST *simpleName = nameAst->asSimpleName()) {
|
||||
const Token token = tokenAt(simpleName->identifier_token);
|
||||
@@ -102,7 +102,7 @@ protected:
|
||||
continue;
|
||||
if (!member->isGenerated() && (member->sourceLocation() < firstToken
|
||||
|| member->enclosingScope()->isFunction())) {
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
getTokenStartPosition(simpleName->identifier_token, &line, &column);
|
||||
localUses[member].append(
|
||||
HighlightingResult(line, column, token.utf16chars(),
|
||||
|
@@ -498,7 +498,7 @@ void CppToolsPlugin::test_modelmanager_refresh_timeStampModified_if_sourcefiles_
|
||||
|
||||
document = snapshot.document(fileToChange);
|
||||
const QDateTime lastModifiedBefore = document->lastModified();
|
||||
QCOMPARE(document->globalSymbolCount(), 1U);
|
||||
QCOMPARE(document->globalSymbolCount(), 1);
|
||||
QCOMPARE(document->globalSymbolAt(0)->name()->identifier()->chars(), "someGlobal");
|
||||
|
||||
// Modify the file
|
||||
@@ -527,7 +527,7 @@ void CppToolsPlugin::test_modelmanager_refresh_timeStampModified_if_sourcefiles_
|
||||
document = snapshot.document(fileToChange);
|
||||
const QDateTime lastModifiedAfter = document->lastModified();
|
||||
QVERIFY(lastModifiedAfter > lastModifiedBefore);
|
||||
QCOMPARE(document->globalSymbolCount(), 2U);
|
||||
QCOMPARE(document->globalSymbolCount(), 2);
|
||||
QCOMPARE(document->globalSymbolAt(0)->name()->identifier()->chars(), "someGlobal");
|
||||
QCOMPARE(document->globalSymbolAt(1)->name()->identifier()->chars(), "addedOtherGlobal");
|
||||
}
|
||||
|
@@ -82,8 +82,8 @@ QVariant SymbolItem::data(int /*column*/, int role) const
|
||||
if (Template *t = symbl->asTemplate())
|
||||
if (Symbol *templateDeclaration = t->declaration()) {
|
||||
QStringList parameters;
|
||||
parameters.reserve(static_cast<int>(t->templateParameterCount()));
|
||||
for (unsigned i = 0; i < t->templateParameterCount(); ++i) {
|
||||
parameters.reserve(t->templateParameterCount());
|
||||
for (int i = 0; i < t->templateParameterCount(); ++i) {
|
||||
parameters.append(overviewModel->_overview.prettyName(
|
||||
t->templateParameterAt(i)->name()));
|
||||
}
|
||||
@@ -119,7 +119,7 @@ QVariant SymbolItem::data(int /*column*/, int role) const
|
||||
return Icons::iconForSymbol(symbol);
|
||||
|
||||
case AbstractOverviewModel::FileNameRole:
|
||||
return QString::fromUtf8(symbol->fileName(), static_cast<int>(symbol->fileNameLength()));
|
||||
return QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
|
||||
|
||||
case AbstractOverviewModel::LineNumberRole:
|
||||
return symbol->line();
|
||||
@@ -135,15 +135,15 @@ bool OverviewModel::hasDocument() const
|
||||
return _cppDocument;
|
||||
}
|
||||
|
||||
unsigned OverviewModel::globalSymbolCount() const
|
||||
int OverviewModel::globalSymbolCount() const
|
||||
{
|
||||
unsigned count = 0;
|
||||
int count = 0;
|
||||
if (_cppDocument)
|
||||
count += _cppDocument->globalSymbolCount();
|
||||
return count;
|
||||
}
|
||||
|
||||
Symbol *OverviewModel::globalSymbolAt(unsigned index) const
|
||||
Symbol *OverviewModel::globalSymbolAt(int index) const
|
||||
{ return _cppDocument->globalSymbolAt(index); }
|
||||
|
||||
Symbol *OverviewModel::symbolFromIndex(const QModelIndex &index) const
|
||||
@@ -185,8 +185,8 @@ Utils::LineColumn OverviewModel::lineColumnFromIndex(const QModelIndex &sourceIn
|
||||
CPlusPlus::Symbol *symbol = symbolFromIndex(sourceIndex);
|
||||
if (!symbol)
|
||||
return lineColumn;
|
||||
lineColumn.line = static_cast<int>(symbol->line());
|
||||
lineColumn.column = static_cast<int>(symbol->column());
|
||||
lineColumn.line = symbol->line();
|
||||
lineColumn.column = symbol->column();
|
||||
return lineColumn;
|
||||
}
|
||||
|
||||
@@ -202,8 +202,8 @@ void OverviewModel::buildTree(SymbolItem *root, bool isRoot)
|
||||
return;
|
||||
|
||||
if (isRoot) {
|
||||
unsigned rows = globalSymbolCount();
|
||||
for (unsigned row = 0; row < rows; ++row) {
|
||||
int rows = globalSymbolCount();
|
||||
for (int row = 0; row < rows; ++row) {
|
||||
Symbol *symbol = globalSymbolAt(row);
|
||||
auto currentItem = new SymbolItem(symbol);
|
||||
buildTree(currentItem, false);
|
||||
|
@@ -59,8 +59,8 @@ public:
|
||||
private:
|
||||
CPlusPlus::Symbol *symbolFromIndex(const QModelIndex &index) const;
|
||||
bool hasDocument() const;
|
||||
unsigned globalSymbolCount() const;
|
||||
CPlusPlus::Symbol *globalSymbolAt(unsigned index) const;
|
||||
int globalSymbolCount() const;
|
||||
CPlusPlus::Symbol *globalSymbolAt(int index) const;
|
||||
void buildTree(SymbolItem *root, bool isRoot);
|
||||
|
||||
private:
|
||||
|
@@ -377,7 +377,7 @@ void PointerDeclarationFormatter::checkAndRewrite(DeclaratorAST *declarator,
|
||||
CHECK_R(symbol, "No symbol");
|
||||
|
||||
// Check for expanded tokens
|
||||
for (unsigned token = tokenRange.start; token <= tokenRange.end; ++token)
|
||||
for (int token = tokenRange.start; token <= tokenRange.end; ++token)
|
||||
CHECK_R(!tokenAt(token).expanded(), "Token is expanded");
|
||||
|
||||
Utils::ChangeSet::Range range(m_cppRefactoringFile->startOf(tokenRange.start),
|
||||
@@ -455,7 +455,7 @@ void PointerDeclarationFormatter::printCandidate(AST *ast)
|
||||
{
|
||||
#if DEBUG_OUTPUT
|
||||
QString tokens;
|
||||
for (unsigned token = ast->firstToken(); token < ast->lastToken(); token++)
|
||||
for (int token = ast->firstToken(); token < ast->lastToken(); token++)
|
||||
tokens += QString::fromLatin1(tokenAt(token).spell()) + QLatin1Char(' ');
|
||||
|
||||
# ifdef __GNUC__
|
||||
|
@@ -101,9 +101,9 @@ private:
|
||||
class TokenRange {
|
||||
public:
|
||||
TokenRange() = default;
|
||||
TokenRange(unsigned start, unsigned end) : start(start), end(end) {}
|
||||
unsigned start = 0;
|
||||
unsigned end = 0;
|
||||
TokenRange(int start, int end) : start(start), end(end) {}
|
||||
int start = 0;
|
||||
int end = 0;
|
||||
};
|
||||
|
||||
void processIfWhileForStatement(ExpressionAST *expression, Symbol *symbol);
|
||||
|
@@ -159,7 +159,7 @@ void CppRefactoringFile::setCppDocument(Document::Ptr document)
|
||||
|
||||
Scope *CppRefactoringFile::scopeAt(unsigned index) const
|
||||
{
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
cppDocument()->translationUnit()->getTokenStartPosition(index, &line, &column);
|
||||
return cppDocument()->scopeAt(line, column);
|
||||
}
|
||||
@@ -195,10 +195,10 @@ bool CppRefactoringFile::isCursorOn(const AST *ast) const
|
||||
Utils::ChangeSet::Range CppRefactoringFile::range(unsigned tokenIndex) const
|
||||
{
|
||||
const Token &token = tokenAt(tokenIndex);
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
cppDocument()->translationUnit()->getPosition(token.utf16charsBegin(), &line, &column);
|
||||
const int start = document()->findBlockByNumber(line - 1).position() + column - 1;
|
||||
return {start, static_cast<int>(start + token.utf16chars())};
|
||||
return {start, start + token.utf16chars()};
|
||||
}
|
||||
|
||||
Utils::ChangeSet::Range CppRefactoringFile::range(AST *ast) const
|
||||
@@ -208,7 +208,7 @@ Utils::ChangeSet::Range CppRefactoringFile::range(AST *ast) const
|
||||
|
||||
int CppRefactoringFile::startOf(unsigned index) const
|
||||
{
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
cppDocument()->translationUnit()->getPosition(tokenAt(index).utf16charsBegin(), &line, &column);
|
||||
return document()->findBlockByNumber(line - 1).position() + column - 1;
|
||||
}
|
||||
@@ -220,21 +220,21 @@ int CppRefactoringFile::startOf(const AST *ast) const
|
||||
|
||||
int CppRefactoringFile::endOf(unsigned index) const
|
||||
{
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
cppDocument()->translationUnit()->getPosition(tokenAt(index).utf16charsEnd(), &line, &column);
|
||||
return document()->findBlockByNumber(line - 1).position() + column - 1;
|
||||
}
|
||||
|
||||
int CppRefactoringFile::endOf(const AST *ast) const
|
||||
{
|
||||
unsigned end = ast->lastToken();
|
||||
int end = ast->lastToken();
|
||||
QTC_ASSERT(end > 0, return -1);
|
||||
return endOf(end - 1);
|
||||
}
|
||||
|
||||
void CppRefactoringFile::startAndEndOf(unsigned index, int *start, int *end) const
|
||||
{
|
||||
unsigned line, column;
|
||||
int line, column;
|
||||
Token token(tokenAt(index));
|
||||
cppDocument()->translationUnit()->getPosition(token.utf16charsBegin(), &line, &column);
|
||||
*start = document()->findBlockByNumber(line - 1).position() + column - 1;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user