~ubuntu-branches/ubuntu/utopic/kdevplatform/utopic-proposed

« back to all changes in this revision

Viewing changes to language/duchain/declaration.cpp

  • Committer: Package Import Robot
  • Author(s): Scarlett Clark
  • Date: 2014-08-30 03:52:11 UTC
  • mfrom: (0.3.26)
  • Revision ID: package-import@ubuntu.com-20140830035211-wndqlc843eu2v8nk
Tags: 1.7.0-0ubuntu1
* New upstream release
* Add XS-Testsuite: autopkgtest

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
REGISTER_DUCHAIN_ITEM(Declaration);
54
54
 
55
55
DeclarationData::DeclarationData()
56
 
  : m_comment(0), m_isDefinition(false), m_inSymbolTable(false), m_isTypeAlias(false),
57
 
    m_anonymousInContext(false), m_isFinal(false), m_alwaysForceDirect(false), m_isAutoDeclaration(false), m_isExplicitlyDeleted(false)
 
56
  : m_comment(0)
 
57
  , m_isDefinition(false)
 
58
  , m_inSymbolTable(false)
 
59
  , m_isTypeAlias(false)
 
60
  , m_anonymousInContext(false)
 
61
  , m_isDeprecated(false)
 
62
  , m_alwaysForceDirect(false)
 
63
  , m_isAutoDeclaration(false)
 
64
  , m_isExplicitlyDeleted(false)
58
65
{
59
66
  m_kind = Declaration::Instance;
60
67
}
70
77
m_inSymbolTable(rhs.m_inSymbolTable),
71
78
m_isTypeAlias(rhs.m_isTypeAlias),
72
79
m_anonymousInContext(rhs.m_anonymousInContext),
73
 
m_isFinal(rhs.m_isFinal),
 
80
m_isDeprecated(rhs.m_isDeprecated),
74
81
m_alwaysForceDirect(rhs.m_alwaysForceDirect),
75
82
m_isAutoDeclaration(rhs.m_isAutoDeclaration),
76
83
m_isExplicitlyDeleted(rhs.m_isExplicitlyDeleted)
192
199
  }
193
200
  Q_ASSERT(d_func()->isDynamic() == (!topContext->deleting() || !topContext->isOnDisk() || topContext->m_dynamicData->isTemporaryDeclarationIndex(oldOwnIndex)));
194
201
  Q_UNUSED(oldOwnIndex);
195
 
  //DUChain::declarationChanged(this, DUChainObserver::Deletion, DUChainObserver::NotApplicable);
196
202
}
197
203
 
198
204
QByteArray Declaration::comment() const {
252
258
  d->m_identifier = identifier;
253
259
 
254
260
  setInSymbolTable(wasInSymbolTable);
255
 
  //DUChain::declarationChanged(this, DUChainObserver::Change, DUChainObserver::Identifier);
256
261
}
257
262
 
258
263
IndexedType Declaration::indexedType() const
271
276
  ENSURE_CAN_WRITE
272
277
  DUCHAIN_D_DYNAMIC(Declaration);
273
278
 
274
 
  //if (d->m_type)
275
 
    //DUChain::declarationChanged(this, DUChainObserver::Removal, DUChainObserver::DataType);
276
 
 
277
279
  d->m_type = type->indexed();
278
280
 
279
281
  updateCodeModel();
280
 
  //if (d->m_type)
281
 
    //DUChain::declarationChanged(this, DUChainObserver::Addition, DUChainObserver::DataType);
282
282
}
283
283
 
284
284
Declaration* Declaration::specialize(const IndexedInstantiationInformation& /*specialization*/, const TopDUContext* topContext, int /*upDistance*/)
325
325
void Declaration::setContext(DUContext* context, bool anonymous)
326
326
{
327
327
  Q_ASSERT(!context || context->topContext());
328
 
  ///@todo re-enable. In C++ support we need a short window to put visible declarations into template contexts
329
 
  if(!specialization().index()) {
330
 
    //problem: specialization() doesn't work during destructor
331
 
//     ENSURE_CAN_WRITE
332
 
  }
333
328
 
334
329
  setInSymbolTable(false);
335
330
 
345
340
  if (m_context) {
346
341
    if( !d->m_anonymousInContext ) {
347
342
      m_context->m_dynamicData->removeDeclaration(this);
348
 
        //DUChain::declarationChanged(this, DUChainObserver::Removal, DUChainObserver::Context, m_context);
349
343
    }
350
344
  }
351
345
 
363
357
 
364
358
    if(!d->m_anonymousInContext) {
365
359
      context->m_dynamicData->addDeclaration(this);
366
 
      //DUChain::declarationChanged(this, DUChainObserver::Addition, DUChainObserver::Context, m_context);
367
360
    }
368
361
 
369
362
    if(context->inSymbolTable() && !anonymous)
532
525
  d_func_dynamic()->m_isAutoDeclaration = _auto;
533
526
}
534
527
 
535
 
bool Declaration::isFinal() const
 
528
bool Declaration::isDeprecated() const
536
529
{
537
 
  return d_func()->m_isFinal;
 
530
  return d_func()->m_isDeprecated;
538
531
}
539
532
 
540
 
void Declaration::setFinal(bool final)
 
533
void Declaration::setDeprecated(bool deprecated)
541
534
{
542
 
  d_func_dynamic()->m_isFinal = final;
 
535
  d_func_dynamic()->m_isDeprecated = deprecated;
543
536
}
544
537
 
545
538
bool Declaration::alwaysForceDirect() const