diff --git a/src/shared/cplusplus/CheckExpression.cpp b/src/shared/cplusplus/CheckExpression.cpp index 01259d3c2cfdf52e0639477005251c5bbe2d1a52..ad1bb3a46e599c26c1591bbb4eea090c8cf9054d 100644 --- a/src/shared/cplusplus/CheckExpression.cpp +++ b/src/shared/cplusplus/CheckExpression.cpp @@ -86,7 +86,7 @@ ExpressionAST *CheckExpression::switchExpression(ExpressionAST *expression) return previousExpression; } -FullySpecifiedType CheckExpression::switchFullySpecifiedType(FullySpecifiedType type) +FullySpecifiedType CheckExpression::switchFullySpecifiedType(const FullySpecifiedType &type) { FullySpecifiedType previousType = _fullySpecifiedType; _fullySpecifiedType = type; diff --git a/src/shared/cplusplus/CheckExpression.h b/src/shared/cplusplus/CheckExpression.h index 2ef3a6290386b3d5ae2564d9ecf538a2a6229ea9..8085731df5da9e68c8e6567ce207dd4e388cdd5e 100644 --- a/src/shared/cplusplus/CheckExpression.h +++ b/src/shared/cplusplus/CheckExpression.h @@ -66,7 +66,7 @@ public: protected: ExpressionAST *switchExpression(ExpressionAST *expression); - FullySpecifiedType switchFullySpecifiedType(FullySpecifiedType type); + FullySpecifiedType switchFullySpecifiedType(const FullySpecifiedType &type); Scope *switchScope(Scope *scope); using ASTVisitor::visit; diff --git a/src/shared/cplusplus/Control.cpp b/src/shared/cplusplus/Control.cpp index d2b91e14a2b682eebfc12a0700bdc85539470232..4d36658e5ca669645db9c0e24c8721d71e87888d 100644 --- a/src/shared/cplusplus/Control.cpp +++ b/src/shared/cplusplus/Control.cpp @@ -180,7 +180,7 @@ public: return it->second; } - ConversionNameId *findOrInsertConversionNameId(FullySpecifiedType type) + ConversionNameId *findOrInsertConversionNameId(const FullySpecifiedType &type) { std::map<FullySpecifiedType, ConversionNameId *>::iterator it = conversionNameIds.lower_bound(type); @@ -238,7 +238,7 @@ public: return it->second; } - PointerType *findOrInsertPointerType(FullySpecifiedType elementType) + PointerType *findOrInsertPointerType(const FullySpecifiedType &elementType) { std::map<FullySpecifiedType, PointerType *>::iterator it = pointerTypes.lower_bound(elementType); @@ -247,7 +247,7 @@ public: return it->second; } - ReferenceType *findOrInsertReferenceType(FullySpecifiedType elementType) + ReferenceType *findOrInsertReferenceType(const FullySpecifiedType &elementType) { std::map<FullySpecifiedType, ReferenceType *>::iterator it = referenceTypes.lower_bound(elementType); @@ -256,7 +256,7 @@ public: return it->second; } - ArrayType *findOrInsertArrayType(FullySpecifiedType elementType, size_t size) + ArrayType *findOrInsertArrayType(const FullySpecifiedType &elementType, size_t size) { const ArrayKey key(elementType, size); std::map<ArrayKey, ArrayType *>::iterator it = @@ -494,7 +494,7 @@ public: size(0) { } - ArrayKey(FullySpecifiedType type, size_t size) : + ArrayKey(const FullySpecifiedType &type, size_t size) : type(type), size(size) { } @@ -696,7 +696,7 @@ DestructorNameId *Control::destructorNameId(Identifier *id) OperatorNameId *Control::operatorNameId(int kind) { return d->findOrInsertOperatorNameId(kind); } -ConversionNameId *Control::conversionNameId(FullySpecifiedType type) +ConversionNameId *Control::conversionNameId(const FullySpecifiedType &type) { return d->findOrInsertConversionNameId(type); } QualifiedNameId *Control::qualifiedNameId(Name *const *names, @@ -728,13 +728,13 @@ FloatType *Control::floatType(int kind) PointerToMemberType *Control::pointerToMemberType(Name *memberName, FullySpecifiedType elementType) { return d->findOrInsertPointerToMemberType(memberName, elementType); } -PointerType *Control::pointerType(FullySpecifiedType elementType) +PointerType *Control::pointerType(const FullySpecifiedType &elementType) { return d->findOrInsertPointerType(elementType); } -ReferenceType *Control::referenceType(FullySpecifiedType elementType) +ReferenceType *Control::referenceType(const FullySpecifiedType &elementType) { return d->findOrInsertReferenceType(elementType); } -ArrayType *Control::arrayType(FullySpecifiedType elementType, size_t size) +ArrayType *Control::arrayType(const FullySpecifiedType &elementType, size_t size) { return d->findOrInsertArrayType(elementType, size); } NamedType *Control::namedType(Name *name) diff --git a/src/shared/cplusplus/Control.h b/src/shared/cplusplus/Control.h index 6abeb8ef6d08713ed4489ecef7096ad993ec4fef..c13719f2d597313a6c90c52d388b4efd5f7bd916 100644 --- a/src/shared/cplusplus/Control.h +++ b/src/shared/cplusplus/Control.h @@ -82,7 +82,7 @@ public: OperatorNameId *operatorNameId(int operatorId); /// Returns the canonical conversion name id. - ConversionNameId *conversionNameId(FullySpecifiedType type); + ConversionNameId *conversionNameId(const FullySpecifiedType &type); /// Returns the canonical qualified name id. QualifiedNameId *qualifiedNameId(Name *const *names, @@ -107,13 +107,13 @@ public: FullySpecifiedType elementType); /// Returns a Type object of type PointerType. - PointerType *pointerType(FullySpecifiedType elementType); + PointerType *pointerType(const FullySpecifiedType &elementType); /// Returns a Type object of type ReferenceType. - ReferenceType *referenceType(FullySpecifiedType elementType); + ReferenceType *referenceType(const FullySpecifiedType &elementType); /// Retruns a Type object of type ArrayType. - ArrayType *arrayType(FullySpecifiedType elementType, size_t size = 0); + ArrayType *arrayType(const FullySpecifiedType &elementType, size_t size = 0); /// Returns a Type object of type NamedType. NamedType *namedType(Name *name); diff --git a/src/shared/cplusplus/CoreTypes.cpp b/src/shared/cplusplus/CoreTypes.cpp index 141ce3dc87b856b9a42907c9b36581c7817e2caf..87f41bfcdde515fce1ee4719829656c76df614af 100644 --- a/src/shared/cplusplus/CoreTypes.cpp +++ b/src/shared/cplusplus/CoreTypes.cpp @@ -90,7 +90,7 @@ bool PointerToMemberType::isEqualTo(const Type *other) const void PointerToMemberType::accept0(TypeVisitor *visitor) { visitor->visit(this); } -PointerType::PointerType(FullySpecifiedType elementType) +PointerType::PointerType(const FullySpecifiedType &elementType) : _elementType(elementType) { } @@ -111,7 +111,7 @@ void PointerType::accept0(TypeVisitor *visitor) FullySpecifiedType PointerType::elementType() const { return _elementType; } -ReferenceType::ReferenceType(FullySpecifiedType elementType) +ReferenceType::ReferenceType(const FullySpecifiedType &elementType) : _elementType(elementType) { } @@ -174,7 +174,7 @@ bool FloatType::isEqualTo(const Type *other) const return _kind == o->_kind; } -ArrayType::ArrayType(FullySpecifiedType elementType, size_t size) +ArrayType::ArrayType(const FullySpecifiedType &elementType, size_t size) : _elementType(elementType), _size(size) { } diff --git a/src/shared/cplusplus/CoreTypes.h b/src/shared/cplusplus/CoreTypes.h index 67d8a79515703b3fe1aefe50f8ad3f20593b72fe..2d03d8789629ce16564cc2027e397fe67ff594ed 100644 --- a/src/shared/cplusplus/CoreTypes.h +++ b/src/shared/cplusplus/CoreTypes.h @@ -156,7 +156,7 @@ private: class CPLUSPLUS_EXPORT PointerType: public Type { public: - PointerType(FullySpecifiedType elementType); + PointerType(const FullySpecifiedType &elementType); virtual ~PointerType(); FullySpecifiedType elementType() const; @@ -204,7 +204,7 @@ private: class CPLUSPLUS_EXPORT ReferenceType: public Type { public: - ReferenceType(FullySpecifiedType elementType); + ReferenceType(const FullySpecifiedType &elementType); virtual ~ReferenceType(); FullySpecifiedType elementType() const; @@ -227,7 +227,7 @@ private: class CPLUSPLUS_EXPORT ArrayType: public Type { public: - ArrayType(FullySpecifiedType elementType, size_t size); + ArrayType(const FullySpecifiedType &elementType, size_t size); virtual ~ArrayType(); FullySpecifiedType elementType() const; diff --git a/src/shared/cplusplus/Names.cpp b/src/shared/cplusplus/Names.cpp index 973e8d8366a976bc18213a7c61731757c3460294..e73abb5c471440d092069bb957f1c144fcbb287d 100644 --- a/src/shared/cplusplus/Names.cpp +++ b/src/shared/cplusplus/Names.cpp @@ -244,7 +244,7 @@ bool OperatorNameId::isEqualTo(const Name *other) const return _kind == o->kind(); } -ConversionNameId::ConversionNameId(FullySpecifiedType type) +ConversionNameId::ConversionNameId(const FullySpecifiedType &type) : _type(type) { } diff --git a/src/shared/cplusplus/Names.h b/src/shared/cplusplus/Names.h index e5fef0cbec284d74cad14da0aa2da1c6535f0f35..1dd475774ffed5339d5510e8f19ec6859bb96673 100644 --- a/src/shared/cplusplus/Names.h +++ b/src/shared/cplusplus/Names.h @@ -250,7 +250,7 @@ private: class CPLUSPLUS_EXPORT ConversionNameId: public Name { public: - ConversionNameId(FullySpecifiedType type); + ConversionNameId(const FullySpecifiedType &type); virtual ~ConversionNameId(); FullySpecifiedType type() const; diff --git a/src/shared/cplusplus/Symbols.cpp b/src/shared/cplusplus/Symbols.cpp index 819c8730ed516b5a2e720b3153f32c5605cc76ec..8ee8572d9b88473be9a4f3a216fe8a54d80ff3a7 100644 --- a/src/shared/cplusplus/Symbols.cpp +++ b/src/shared/cplusplus/Symbols.cpp @@ -117,7 +117,7 @@ TemplateParameters *Declaration::templateParameters() const void Declaration::setTemplateParameters(TemplateParameters *templateParameters) { _templateParameters = templateParameters; } -void Declaration::setType(FullySpecifiedType type) +void Declaration::setType(const FullySpecifiedType &type) { _type = type; } FullySpecifiedType Declaration::type() const @@ -140,7 +140,7 @@ bool Argument::hasInitializer() const void Argument::setInitializer(bool hasInitializer) { _initializer = hasInitializer; } -void Argument::setType(FullySpecifiedType type) +void Argument::setType(const FullySpecifiedType &type) { _type = type; } FullySpecifiedType Argument::type() const @@ -230,7 +230,7 @@ FullySpecifiedType Function::type() const FullySpecifiedType Function::returnType() const { return _returnType; } -void Function::setReturnType(FullySpecifiedType returnType) +void Function::setReturnType(const FullySpecifiedType &returnType) { _returnType = returnType; } bool Function::hasReturnType() const @@ -773,7 +773,7 @@ FullySpecifiedType ObjCMethod::type() const FullySpecifiedType ObjCMethod::returnType() const { return _returnType; } -void ObjCMethod::setReturnType(FullySpecifiedType returnType) +void ObjCMethod::setReturnType(const FullySpecifiedType &returnType) { _returnType = returnType; } bool ObjCMethod::hasReturnType() const diff --git a/src/shared/cplusplus/Symbols.h b/src/shared/cplusplus/Symbols.h index 88d8d521cdaf6990f81035d7b9da0de0a8be08d3..85d720dfc612e602bcb55aee39ed0cb1e6c98241 100644 --- a/src/shared/cplusplus/Symbols.h +++ b/src/shared/cplusplus/Symbols.h @@ -120,7 +120,7 @@ public: TemplateParameters *templateParameters() const; void setTemplateParameters(TemplateParameters *templateParameters); - void setType(FullySpecifiedType type); + void setType(const FullySpecifiedType &type); // Symbol's interface virtual FullySpecifiedType type() const; @@ -145,7 +145,7 @@ public: Argument(TranslationUnit *translationUnit, unsigned sourceLocation, Name *name); virtual ~Argument(); - void setType(FullySpecifiedType type); + void setType(const FullySpecifiedType &type); bool hasInitializer() const; void setInitializer(bool hasInitializer); @@ -295,7 +295,7 @@ public: void setTemplateParameters(TemplateParameters *templateParameters); FullySpecifiedType returnType() const; - void setReturnType(FullySpecifiedType returnType); + void setReturnType(const FullySpecifiedType &returnType); /** Convenience function that returns whether the function returns something (including void). */ bool hasReturnType() const; @@ -680,7 +680,7 @@ public: virtual ~ObjCMethod(); FullySpecifiedType returnType() const; - void setReturnType(FullySpecifiedType returnType); + void setReturnType(const FullySpecifiedType &returnType); /** Convenience function that returns whether the function returns something (including void). */ bool hasReturnType() const;