forked from qt-creator/qt-creator
Fixed alignment issues with 64 bits ABIs.
This commit is contained in:
@@ -626,7 +626,7 @@ bool Bind::visit(OperatorAST *ast)
|
||||
return false;
|
||||
}
|
||||
|
||||
int Bind::cppOperator(OperatorAST *ast)
|
||||
OperatorNameId::Kind Bind::cppOperator(OperatorAST *ast)
|
||||
{
|
||||
OperatorNameId::Kind kind = OperatorNameId::InvalidOp;
|
||||
|
||||
@@ -2423,7 +2423,7 @@ bool Bind::visit(QualifiedNameAST *ast)
|
||||
|
||||
bool Bind::visit(OperatorFunctionIdAST *ast)
|
||||
{
|
||||
const int op = this->cppOperator(ast->op);
|
||||
const OperatorNameId::Kind op = this->cppOperator(ast->op);
|
||||
ast->name = _name = control()->operatorNameId(op);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
#include "ASTVisitor.h"
|
||||
#include "FullySpecifiedType.h"
|
||||
#include "Names.h"
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
@@ -117,7 +118,7 @@ protected:
|
||||
FullySpecifiedType newArrayDeclarator(NewArrayDeclaratorAST *ast, const FullySpecifiedType &init);
|
||||
void newInitializer(NewInitializerAST *ast);
|
||||
FullySpecifiedType newTypeId(NewTypeIdAST *ast);
|
||||
int cppOperator(OperatorAST *ast);
|
||||
OperatorNameId::Kind cppOperator(OperatorAST *ast);
|
||||
void parameterDeclarationClause(ParameterDeclarationClauseAST *ast, unsigned lparen_token, Function *fun);
|
||||
void translationUnit(TranslationUnitAST *ast);
|
||||
void objCProtocolRefs(ObjCProtocolRefsAST *ast, Symbol *objcClassOrProtocol);
|
||||
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
return destructorNameIds.intern(DestructorNameId(id));
|
||||
}
|
||||
|
||||
const OperatorNameId *findOrInsertOperatorNameId(int kind)
|
||||
const OperatorNameId *findOrInsertOperatorNameId(OperatorNameId::Kind kind)
|
||||
{
|
||||
return operatorNameIds.intern(OperatorNameId(kind));
|
||||
}
|
||||
@@ -609,7 +609,7 @@ const TemplateNameId *Control::templateNameId(const Identifier *id,
|
||||
const DestructorNameId *Control::destructorNameId(const Identifier *id)
|
||||
{ return d->findOrInsertDestructorNameId(id); }
|
||||
|
||||
const OperatorNameId *Control::operatorNameId(int kind)
|
||||
const OperatorNameId *Control::operatorNameId(OperatorNameId::Kind kind)
|
||||
{ return d->findOrInsertOperatorNameId(kind); }
|
||||
|
||||
const ConversionNameId *Control::conversionNameId(const FullySpecifiedType &type)
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#define CPLUSPLUS_CONTROL_H
|
||||
|
||||
#include "CPlusPlusForwardDeclarations.h"
|
||||
#include "Names.h"
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
@@ -74,7 +75,7 @@ public:
|
||||
const DestructorNameId *destructorNameId(const Identifier *id);
|
||||
|
||||
/// Returns the canonical operator name id.
|
||||
const OperatorNameId *operatorNameId(int operatorId);
|
||||
const OperatorNameId *operatorNameId(OperatorNameId::Kind operatorId);
|
||||
|
||||
/// Returns the canonical conversion name id.
|
||||
const ConversionNameId *conversionNameId(const FullySpecifiedType &type);
|
||||
|
||||
@@ -56,7 +56,7 @@ using namespace CPlusPlus;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Literal::Literal(const char *chars, unsigned size)
|
||||
: _index(0), _next(0)
|
||||
: _next(0), _index(0)
|
||||
{
|
||||
_chars = new char[size + 1];
|
||||
|
||||
|
||||
@@ -80,15 +80,15 @@ public:
|
||||
|
||||
bool equalTo(const Literal *other) const;
|
||||
|
||||
Literal *_next; // ## private
|
||||
|
||||
private:
|
||||
char *_chars;
|
||||
unsigned _size;
|
||||
unsigned _hashCode;
|
||||
|
||||
public:
|
||||
// ### private
|
||||
unsigned _index;
|
||||
Literal *_next;
|
||||
unsigned _index; // ### private
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT StringLiteral: public Literal
|
||||
|
||||
@@ -153,7 +153,7 @@ bool TemplateNameId::isEqualTo(const Name *other) const
|
||||
return true;
|
||||
}
|
||||
|
||||
OperatorNameId::OperatorNameId(int kind)
|
||||
OperatorNameId::OperatorNameId(Kind kind)
|
||||
: _kind(kind)
|
||||
{ }
|
||||
|
||||
@@ -163,7 +163,7 @@ OperatorNameId::~OperatorNameId()
|
||||
void OperatorNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
int OperatorNameId::kind() const
|
||||
OperatorNameId::Kind OperatorNameId::kind() const
|
||||
{ return _kind; }
|
||||
|
||||
const Identifier *OperatorNameId::identifier() const
|
||||
|
||||
@@ -193,10 +193,10 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
OperatorNameId(int kind);
|
||||
OperatorNameId(Kind kind);
|
||||
virtual ~OperatorNameId();
|
||||
|
||||
int kind() const;
|
||||
Kind kind() const;
|
||||
|
||||
virtual const Identifier *identifier() const;
|
||||
virtual bool isEqualTo(const Name *other) const;
|
||||
@@ -208,7 +208,7 @@ protected:
|
||||
virtual void accept0(NameVisitor *visitor) const;
|
||||
|
||||
private:
|
||||
int _kind;
|
||||
Kind _kind;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ConversionNameId: public Name
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
iterator lastSymbol() const;
|
||||
|
||||
Symbol *lookat(const Identifier *id) const;
|
||||
Symbol *lookat(int operatorId) const;
|
||||
Symbol *lookat(OperatorNameId::Kind operatorId) const;
|
||||
|
||||
private:
|
||||
/// Returns the hash value for the given Symbol.
|
||||
@@ -186,7 +186,7 @@ Symbol *SymbolTable::lookat(const Identifier *id) const
|
||||
return symbol;
|
||||
}
|
||||
|
||||
Symbol *SymbolTable::lookat(int operatorId) const
|
||||
Symbol *SymbolTable::lookat(OperatorNameId::Kind operatorId) const
|
||||
{
|
||||
if (! _hash)
|
||||
return 0;
|
||||
@@ -290,7 +290,7 @@ Scope::iterator Scope::lastMember() const
|
||||
Symbol *Scope::find(const Identifier *id) const
|
||||
{ return _members ? _members->lookat(id) : 0; }
|
||||
|
||||
Symbol *Scope::find(int operatorId) const
|
||||
Symbol *Scope::find(OperatorNameId::Kind operatorId) const
|
||||
{ return _members ? _members->lookat(operatorId) : 0; }
|
||||
|
||||
/// Set the start offset of the scope
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
#include "CPlusPlusForwardDeclarations.h"
|
||||
#include "Symbol.h"
|
||||
#include "Names.h"
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
@@ -81,7 +82,7 @@ public:
|
||||
iterator lastMember() const;
|
||||
|
||||
Symbol *find(const Identifier *id) const;
|
||||
Symbol *find(int operatorId) const;
|
||||
Symbol *find(OperatorNameId::Kind operatorId) const;
|
||||
|
||||
/// Set the start offset of the scope
|
||||
unsigned startOffset() const;
|
||||
|
||||
@@ -112,12 +112,16 @@ private:
|
||||
|
||||
Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
: _name(0),
|
||||
_scope(0),
|
||||
_next(0),
|
||||
_fileId(0),
|
||||
_sourceLocation(0),
|
||||
_hashCode(0),
|
||||
_storage(Symbol::NoStorage),
|
||||
_visibility(Symbol::Public),
|
||||
_scope(0),
|
||||
_index(0),
|
||||
_next(0),
|
||||
_line(0),
|
||||
_column(0),
|
||||
_isGenerated(false),
|
||||
_isDeprecated(false),
|
||||
_isUnavailable(false)
|
||||
|
||||
@@ -319,15 +319,15 @@ protected:
|
||||
virtual void visitSymbol0(SymbolVisitor *visitor) = 0;
|
||||
|
||||
private:
|
||||
unsigned _sourceLocation;
|
||||
const Name *_name;
|
||||
Scope *_scope;
|
||||
Symbol *_next;
|
||||
const StringLiteral *_fileId;
|
||||
unsigned _sourceLocation;
|
||||
unsigned _hashCode;
|
||||
int _storage;
|
||||
int _visibility;
|
||||
Scope *_scope;
|
||||
unsigned _index;
|
||||
Symbol *_next;
|
||||
const StringLiteral *_fileId;
|
||||
unsigned _line;
|
||||
unsigned _column;
|
||||
|
||||
|
||||
@@ -681,10 +681,10 @@ void ObjCBaseProtocol::visitSymbol0(SymbolVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
ObjCClass::ObjCClass(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name):
|
||||
Scope(translationUnit, sourceLocation, name),
|
||||
_isInterface(false),
|
||||
_categoryName(0),
|
||||
_baseClass(0)
|
||||
Scope(translationUnit, sourceLocation, name),
|
||||
_categoryName(0),
|
||||
_baseClass(0),
|
||||
_isInterface(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -992,9 +992,9 @@ ObjCPropertyDeclaration::ObjCPropertyDeclaration(TranslationUnit *translationUni
|
||||
unsigned sourceLocation,
|
||||
const Name *name):
|
||||
Symbol(translationUnit, sourceLocation, name),
|
||||
_propertyAttributes(None),
|
||||
_getterName(0),
|
||||
_setterName(0)
|
||||
_setterName(0),
|
||||
_propertyAttributes(None)
|
||||
{}
|
||||
|
||||
ObjCPropertyDeclaration::~ObjCPropertyDeclaration()
|
||||
|
||||
@@ -171,8 +171,8 @@ protected:
|
||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||
|
||||
private:
|
||||
FullySpecifiedType _type;
|
||||
const StringLiteral *_initializer;
|
||||
FullySpecifiedType _type;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT TypenameArgument: public Symbol
|
||||
@@ -531,8 +531,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ObjCBaseProtocol: public Symbol
|
||||
@@ -552,8 +550,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ObjCForwardProtocolDeclaration: public Symbol, public Type
|
||||
@@ -647,8 +643,6 @@ protected:
|
||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ObjCClass: public Scope, public Type
|
||||
@@ -695,10 +689,10 @@ protected:
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
|
||||
private:
|
||||
bool _isInterface;
|
||||
const Name *_categoryName;
|
||||
ObjCBaseClass * _baseClass;
|
||||
std::vector<ObjCBaseProtocol *> _protocols;
|
||||
bool _isInterface;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ObjCMethod: public Scope, public Type
|
||||
@@ -808,10 +802,10 @@ protected:
|
||||
virtual void visitSymbol0(SymbolVisitor *visitor);
|
||||
|
||||
private:
|
||||
FullySpecifiedType _type;
|
||||
int _propertyAttributes;
|
||||
const Name *_getterName;
|
||||
const Name *_setterName;
|
||||
FullySpecifiedType _type;
|
||||
int _propertyAttributes;
|
||||
};
|
||||
|
||||
} // end of namespace CPlusPlus
|
||||
|
||||
Reference in New Issue
Block a user