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;
|
||||
|
||||
Reference in New Issue
Block a user