summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/Symbol.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-05-10 12:19:13 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2010-05-10 12:19:47 +0200
commit139087ee5c262937c6476fadd26955e4f9a5ad10 (patch)
tree6a1cfd24ac86c7708116f2237ef16907cb7cd551 /src/shared/cplusplus/Symbol.cpp
parent9a51f684ee23404c17fec92cf6d869c1030d3a64 (diff)
downloadqt-creator-139087ee5c262937c6476fadd26955e4f9a5ad10.tar.gz
Introduced Symbol::copy(otherSymbol) and removed some deprecated code.
Diffstat (limited to 'src/shared/cplusplus/Symbol.cpp')
-rw-r--r--src/shared/cplusplus/Symbol.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/shared/cplusplus/Symbol.cpp b/src/shared/cplusplus/Symbol.cpp
index 93725ee224..8572f191dc 100644
--- a/src/shared/cplusplus/Symbol.cpp
+++ b/src/shared/cplusplus/Symbol.cpp
@@ -161,7 +161,7 @@ private:
};
Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
- : _control(translationUnit->control()),
+ : _control(0),
_sourceLocation(sourceLocation),
_sourceOffset(0),
_startOffset(0),
@@ -175,7 +175,11 @@ Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const
_next(0),
_isGenerated(false)
{
- setSourceLocation(sourceLocation);
+ if (translationUnit) {
+ _control = translationUnit->control();
+ setSourceLocation(sourceLocation);
+ }
+
setName(name);
}
@@ -504,3 +508,22 @@ bool Symbol::isObjCMethod() const
bool Symbol::isObjCPropertyDeclaration() const
{ return asObjCPropertyDeclaration() != 0; }
+
+void Symbol::copy(Symbol *other)
+{
+ _control = other->_control;
+ _sourceLocation = other->_sourceLocation;
+ _sourceOffset = other->_sourceOffset;
+ _startOffset = other->_startOffset;
+ _endOffset = other->_endOffset;
+ _name = other->_name;
+ _hashCode = other->_hashCode;
+ _storage = other->_storage;
+ _visibility = other->_visibility;
+ _scope = other->_scope;
+ _index = other->_index;
+ _next = other->_next;
+
+ _isGenerated = other->_isGenerated;
+ _isDeprecated = other->_isDeprecated;
+}