2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and Nokia.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 12:01:29 +01:00
|
|
|
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
|
|
// in the Software without restriction, including without limitation the rights
|
|
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
// THE SOFTWARE.
|
|
|
|
|
|
|
|
#include "Control.h"
|
|
|
|
#include "Literals.h"
|
|
|
|
#include "LiteralTable.h"
|
|
|
|
#include "TranslationUnit.h"
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
#include "Symbols.h"
|
|
|
|
#include "Names.h"
|
|
|
|
#include "Array.h"
|
2009-11-23 12:42:28 +01:00
|
|
|
#include "TypeMatcher.h"
|
2009-11-30 18:13:08 +01:00
|
|
|
#include <map>
|
|
|
|
#include <set>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-10-20 11:21:25 +02:00
|
|
|
using namespace CPlusPlus;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-11-30 18:13:08 +01:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
template <typename _Tp>
|
|
|
|
struct Compare;
|
|
|
|
|
|
|
|
template <> struct Compare<IntegerType>
|
|
|
|
{
|
|
|
|
bool operator()(const IntegerType &ty, const IntegerType &otherTy) const
|
|
|
|
{ return ty.kind() < otherTy.kind(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct Compare<FloatType>
|
|
|
|
{
|
|
|
|
bool operator()(const FloatType &ty, const FloatType &otherTy) const
|
|
|
|
{ return ty.kind() < otherTy.kind(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct Compare<PointerToMemberType>
|
|
|
|
{
|
|
|
|
bool operator()(const PointerToMemberType &ty, const PointerToMemberType &otherTy) const
|
|
|
|
{
|
|
|
|
if (ty.memberName() < otherTy.memberName())
|
|
|
|
return true;
|
|
|
|
|
|
|
|
else if (ty.memberName() == otherTy.memberName())
|
|
|
|
return ty.elementType() < otherTy.elementType();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct Compare<PointerType>
|
|
|
|
{
|
|
|
|
bool operator()(const PointerType &ty, const PointerType &otherTy) const
|
|
|
|
{
|
|
|
|
return ty.elementType() < otherTy.elementType();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct Compare<ReferenceType>
|
|
|
|
{
|
|
|
|
bool operator()(const ReferenceType &ty, const ReferenceType &otherTy) const
|
|
|
|
{
|
|
|
|
return ty.elementType() < otherTy.elementType();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct Compare<NamedType>
|
|
|
|
{
|
|
|
|
bool operator()(const NamedType &ty, const NamedType &otherTy) const
|
|
|
|
{
|
|
|
|
return ty.name() < otherTy.name();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct Compare<ArrayType>
|
|
|
|
{
|
|
|
|
bool operator()(const ArrayType &ty, const ArrayType &otherTy) const
|
|
|
|
{
|
|
|
|
if (ty.size() < otherTy.size())
|
|
|
|
return true;
|
|
|
|
|
|
|
|
else if (ty.size() == otherTy.size())
|
|
|
|
return ty.elementType() < otherTy.elementType();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename _Tp>
|
|
|
|
class Table: public std::set<_Tp, Compare<_Tp> >
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
_Tp *intern(const _Tp &element)
|
|
|
|
{ return const_cast<_Tp *>(&*insert(element).first); }
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end of anonymous namespace
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
template <typename _Iterator>
|
|
|
|
static void delete_map_entries(_Iterator first, _Iterator last)
|
|
|
|
{
|
|
|
|
for (; first != last; ++first)
|
|
|
|
delete first->second;
|
|
|
|
}
|
|
|
|
|
2009-11-30 17:37:08 +01:00
|
|
|
template <typename _Iterator>
|
|
|
|
static void delete_array_entries(_Iterator first, _Iterator last)
|
|
|
|
{
|
|
|
|
for (; first != last; ++first)
|
|
|
|
delete *first;
|
|
|
|
}
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
template <typename _Map>
|
|
|
|
static void delete_map_entries(const _Map &m)
|
|
|
|
{ delete_map_entries(m.begin(), m.end()); }
|
|
|
|
|
|
|
|
template <typename _Array>
|
|
|
|
static void delete_array_entries(const _Array &a)
|
2009-11-30 17:37:08 +01:00
|
|
|
{ delete_array_entries(a.begin(), a.end()); }
|
2009-11-23 12:42:28 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class Control::Data
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Data(Control *control)
|
|
|
|
: control(control),
|
|
|
|
translationUnit(0),
|
2009-10-07 13:56:59 +02:00
|
|
|
diagnosticClient(0)
|
2009-10-20 13:50:36 +02:00
|
|
|
{}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
~Data()
|
|
|
|
{
|
|
|
|
// names
|
|
|
|
delete_map_entries(nameIds);
|
|
|
|
delete_map_entries(destructorNameIds);
|
|
|
|
delete_map_entries(operatorNameIds);
|
|
|
|
delete_map_entries(conversionNameIds);
|
|
|
|
delete_map_entries(qualifiedNameIds);
|
|
|
|
delete_map_entries(templateNameIds);
|
|
|
|
|
|
|
|
// symbols
|
2009-11-23 13:27:57 +01:00
|
|
|
delete_array_entries(symbols);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const NameId *findOrInsertNameId(const Identifier *id)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
if (! id)
|
|
|
|
return 0;
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<const Identifier *, const NameId *>::iterator it = nameIds.lower_bound(id);
|
2008-12-02 12:01:29 +01:00
|
|
|
if (it == nameIds.end() || it->first != id)
|
|
|
|
it = nameIds.insert(it, std::make_pair(id, new NameId(id)));
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const TemplateNameId *findOrInsertTemplateNameId(const Identifier *id,
|
|
|
|
const std::vector<FullySpecifiedType> &templateArguments)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
if (! id)
|
|
|
|
return 0;
|
|
|
|
const TemplateNameIdKey key(id, templateArguments);
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<TemplateNameIdKey, const TemplateNameId *>::iterator it =
|
2008-12-02 12:01:29 +01:00
|
|
|
templateNameIds.lower_bound(key);
|
|
|
|
if (it == templateNameIds.end() || it->first != key) {
|
|
|
|
const FullySpecifiedType *args = 0;
|
|
|
|
if (templateArguments.size())
|
|
|
|
args = &templateArguments[0];
|
2009-12-01 12:46:15 +01:00
|
|
|
const TemplateNameId *templ = new TemplateNameId(id, args, templateArguments.size());
|
2008-12-02 12:01:29 +01:00
|
|
|
it = templateNameIds.insert(it, std::make_pair(key, templ));
|
|
|
|
}
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const DestructorNameId *findOrInsertDestructorNameId(const Identifier *id)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
if (! id)
|
|
|
|
return 0;
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<const Identifier *, const DestructorNameId *>::iterator it = destructorNameIds.lower_bound(id);
|
2008-12-02 12:01:29 +01:00
|
|
|
if (it == destructorNameIds.end() || it->first != id)
|
|
|
|
it = destructorNameIds.insert(it, std::make_pair(id, new DestructorNameId(id)));
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const OperatorNameId *findOrInsertOperatorNameId(int kind)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
const int key(kind);
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<int, const OperatorNameId *>::iterator it = operatorNameIds.lower_bound(key);
|
2008-12-02 12:01:29 +01:00
|
|
|
if (it == operatorNameIds.end() || it->first != key)
|
|
|
|
it = operatorNameIds.insert(it, std::make_pair(key, new OperatorNameId(kind)));
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const ConversionNameId *findOrInsertConversionNameId(const FullySpecifiedType &type)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<FullySpecifiedType, const ConversionNameId *>::iterator it =
|
2008-12-02 12:01:29 +01:00
|
|
|
conversionNameIds.lower_bound(type);
|
|
|
|
if (it == conversionNameIds.end() || it->first != type)
|
|
|
|
it = conversionNameIds.insert(it, std::make_pair(type, new ConversionNameId(type)));
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const QualifiedNameId *findOrInsertQualifiedNameId(const std::vector<const Name *> &names, bool isGlobal)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
const QualifiedNameIdKey key(names, isGlobal);
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<QualifiedNameIdKey, const QualifiedNameId *>::iterator it =
|
2008-12-02 12:01:29 +01:00
|
|
|
qualifiedNameIds.lower_bound(key);
|
|
|
|
if (it == qualifiedNameIds.end() || it->first != key) {
|
2009-12-01 12:46:15 +01:00
|
|
|
const QualifiedNameId *name = new QualifiedNameId(&names[0], names.size(), isGlobal);
|
2008-12-02 12:01:29 +01:00
|
|
|
it = qualifiedNameIds.insert(it, std::make_pair(key, name));
|
|
|
|
}
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const SelectorNameId *findOrInsertSelectorNameId(const std::vector<const Name *> &names, bool hasArguments)
|
2009-07-31 16:03:48 +02:00
|
|
|
{
|
|
|
|
const SelectorNameIdKey key(names, hasArguments);
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<SelectorNameIdKey, const SelectorNameId *>::iterator it = selectorNameIds.lower_bound(key);
|
2009-07-31 16:03:48 +02:00
|
|
|
if (it == selectorNameIds.end() || it->first != key)
|
|
|
|
it = selectorNameIds.insert(it, std::make_pair(key, new SelectorNameId(&names[0], names.size(), hasArguments)));
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
IntegerType *findOrInsertIntegerType(int kind)
|
|
|
|
{
|
2009-11-30 18:13:08 +01:00
|
|
|
return integerTypes.intern(IntegerType(kind));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
FloatType *findOrInsertFloatType(int kind)
|
|
|
|
{
|
2009-11-30 18:13:08 +01:00
|
|
|
return floatTypes.intern(FloatType(kind));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
PointerToMemberType *findOrInsertPointerToMemberType(const Name *memberName, const FullySpecifiedType &elementType)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-30 18:13:08 +01:00
|
|
|
return pointerToMemberTypes.intern(PointerToMemberType(memberName, elementType));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
2009-11-17 14:37:45 +01:00
|
|
|
PointerType *findOrInsertPointerType(const FullySpecifiedType &elementType)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-30 18:13:08 +01:00
|
|
|
return pointerTypes.intern(PointerType(elementType));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
2009-11-17 14:37:45 +01:00
|
|
|
ReferenceType *findOrInsertReferenceType(const FullySpecifiedType &elementType)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-30 18:13:08 +01:00
|
|
|
return referenceTypes.intern(ReferenceType(elementType));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
2009-11-23 12:42:28 +01:00
|
|
|
ArrayType *findOrInsertArrayType(const FullySpecifiedType &elementType, unsigned size)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-30 18:13:08 +01:00
|
|
|
return arrayTypes.intern(ArrayType(elementType, size));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
NamedType *findOrInsertNamedType(const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-30 18:13:08 +01:00
|
|
|
return namedTypes.intern(NamedType(name));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Declaration *newDeclaration(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
Declaration *declaration = new Declaration(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(declaration);
|
2008-12-02 12:01:29 +01:00
|
|
|
return declaration;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Argument *newArgument(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
Argument *argument = new Argument(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(argument);
|
2008-12-02 12:01:29 +01:00
|
|
|
return argument;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Function *newFunction(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
Function *function = new Function(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(function);
|
2008-12-02 12:01:29 +01:00
|
|
|
return function;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
BaseClass *newBaseClass(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
BaseClass *baseClass = new BaseClass(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(baseClass);
|
2008-12-02 12:01:29 +01:00
|
|
|
return baseClass;
|
|
|
|
}
|
|
|
|
|
|
|
|
Block *newBlock(unsigned sourceLocation)
|
|
|
|
{
|
|
|
|
Block *block = new Block(translationUnit, sourceLocation);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(block);
|
2008-12-02 12:01:29 +01:00
|
|
|
return block;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Class *newClass(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
Class *klass = new Class(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(klass);
|
2008-12-02 12:01:29 +01:00
|
|
|
return klass;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Namespace *newNamespace(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
Namespace *ns = new Namespace(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(ns);
|
2008-12-02 12:01:29 +01:00
|
|
|
return ns;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
UsingNamespaceDirective *newUsingNamespaceDirective(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
UsingNamespaceDirective *u = new UsingNamespaceDirective(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(u);
|
2008-12-02 12:01:29 +01:00
|
|
|
return u;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ForwardClassDeclaration *newForwardClassDeclaration(unsigned sourceLocation, const Name *name)
|
2009-02-16 15:43:24 +01:00
|
|
|
{
|
|
|
|
ForwardClassDeclaration *c = new ForwardClassDeclaration(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(c);
|
2009-02-16 15:43:24 +01:00
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCBaseClass *newObjCBaseClass(unsigned sourceLocation, const Name *name)
|
2009-10-05 18:02:01 +02:00
|
|
|
{
|
|
|
|
ObjCBaseClass *c = new ObjCBaseClass(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(c);
|
2009-10-05 18:02:01 +02:00
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCBaseProtocol *newObjCBaseProtocol(unsigned sourceLocation, const Name *name)
|
2009-10-05 18:02:01 +02:00
|
|
|
{
|
|
|
|
ObjCBaseProtocol *p = new ObjCBaseProtocol(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(p);
|
2009-10-05 18:02:01 +02:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCClass *newObjCClass(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
|
|
|
ObjCClass *c = new ObjCClass(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(c);
|
2009-07-28 16:34:15 +02:00
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCForwardClassDeclaration *newObjCForwardClassDeclaration(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
|
|
|
ObjCForwardClassDeclaration *fwd = new ObjCForwardClassDeclaration(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(fwd);
|
2009-07-28 16:34:15 +02:00
|
|
|
return fwd;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCProtocol *newObjCProtocol(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
|
|
|
ObjCProtocol *p = new ObjCProtocol(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(p);
|
2009-07-28 16:34:15 +02:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCForwardProtocolDeclaration *newObjCForwardProtocolDeclaration(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{
|
|
|
|
ObjCForwardProtocolDeclaration *fwd = new ObjCForwardProtocolDeclaration(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(fwd);
|
2009-07-28 16:34:15 +02:00
|
|
|
return fwd;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCMethod *newObjCMethod(unsigned sourceLocation, const Name *name)
|
2009-08-05 18:30:18 +02:00
|
|
|
{
|
|
|
|
ObjCMethod *method = new ObjCMethod(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(method);
|
2009-08-05 18:30:18 +02:00
|
|
|
return method;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCPropertyDeclaration *newObjCPropertyDeclaration(unsigned sourceLocation, const Name *name)
|
2009-11-11 09:32:05 +01:00
|
|
|
{
|
|
|
|
ObjCPropertyDeclaration *decl = new ObjCPropertyDeclaration(translationUnit, sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(decl);
|
2009-11-11 09:32:05 +01:00
|
|
|
return decl;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Enum *newEnum(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
Enum *e = new Enum(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(e);
|
2008-12-02 12:01:29 +01:00
|
|
|
return e;
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
UsingDeclaration *newUsingDeclaration(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
UsingDeclaration *u = new UsingDeclaration(translationUnit,
|
|
|
|
sourceLocation, name);
|
2009-11-23 13:27:57 +01:00
|
|
|
symbols.push_back(u);
|
2008-12-02 12:01:29 +01:00
|
|
|
return u;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TemplateNameIdKey {
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *id;
|
2008-12-02 12:01:29 +01:00
|
|
|
std::vector<FullySpecifiedType> templateArguments;
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
TemplateNameIdKey(const Identifier *id, const std::vector<FullySpecifiedType> &templateArguments)
|
2008-12-02 12:01:29 +01:00
|
|
|
: id(id), templateArguments(templateArguments)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
bool operator == (const TemplateNameIdKey &other) const
|
|
|
|
{ return id == other.id && templateArguments == other.templateArguments; }
|
|
|
|
|
|
|
|
bool operator != (const TemplateNameIdKey &other) const
|
|
|
|
{ return ! operator==(other); }
|
|
|
|
|
|
|
|
bool operator < (const TemplateNameIdKey &other) const
|
|
|
|
{
|
|
|
|
if (id == other.id)
|
|
|
|
return std::lexicographical_compare(templateArguments.begin(),
|
|
|
|
templateArguments.end(),
|
|
|
|
other.templateArguments.begin(),
|
|
|
|
other.templateArguments.end());
|
|
|
|
return id < other.id;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct QualifiedNameIdKey {
|
2009-12-01 12:46:15 +01:00
|
|
|
std::vector<const Name *> names;
|
2008-12-02 12:01:29 +01:00
|
|
|
bool isGlobal;
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
QualifiedNameIdKey(const std::vector<const Name *> &names, bool isGlobal) :
|
2008-12-02 12:01:29 +01:00
|
|
|
names(names), isGlobal(isGlobal)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
bool operator == (const QualifiedNameIdKey &other) const
|
|
|
|
{ return isGlobal == other.isGlobal && names == other.names; }
|
|
|
|
|
|
|
|
bool operator != (const QualifiedNameIdKey &other) const
|
|
|
|
{ return ! operator==(other); }
|
|
|
|
|
|
|
|
bool operator < (const QualifiedNameIdKey &other) const
|
|
|
|
{
|
|
|
|
if (isGlobal == other.isGlobal)
|
|
|
|
return std::lexicographical_compare(names.begin(), names.end(),
|
|
|
|
other.names.begin(), other.names.end());
|
|
|
|
return isGlobal < other.isGlobal;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-07-31 16:03:48 +02:00
|
|
|
struct SelectorNameIdKey {
|
2009-12-01 12:46:15 +01:00
|
|
|
std::vector<const Name *> _names;
|
2009-07-31 16:03:48 +02:00
|
|
|
bool _hasArguments;
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
SelectorNameIdKey(const std::vector<const Name *> &names, bool hasArguments): _names(names), _hasArguments(hasArguments) {}
|
2009-07-31 16:03:48 +02:00
|
|
|
|
|
|
|
bool operator==(const SelectorNameIdKey &other) const
|
|
|
|
{ return _names == other._names && _hasArguments == other._hasArguments; }
|
|
|
|
|
|
|
|
bool operator!=(const SelectorNameIdKey &other) const
|
|
|
|
{ return !operator==(other); }
|
|
|
|
|
|
|
|
bool operator<(const SelectorNameIdKey &other) const
|
|
|
|
{
|
|
|
|
if (_hasArguments == other._hasArguments)
|
|
|
|
return std::lexicographical_compare(_names.begin(), _names.end(), other._names.begin(), other._names.end());
|
|
|
|
else
|
|
|
|
return _hasArguments < other._hasArguments;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
Control *control;
|
|
|
|
TranslationUnit *translationUnit;
|
|
|
|
DiagnosticClient *diagnosticClient;
|
2009-11-23 12:42:28 +01:00
|
|
|
|
|
|
|
TypeMatcher matcher;
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
LiteralTable<Identifier> identifiers;
|
|
|
|
LiteralTable<StringLiteral> stringLiterals;
|
|
|
|
LiteralTable<NumericLiteral> numericLiterals;
|
|
|
|
|
|
|
|
// ### replace std::map with lookup tables. ASAP!
|
|
|
|
|
|
|
|
// names
|
2009-12-01 12:46:15 +01:00
|
|
|
std::map<const Identifier *, const NameId *> nameIds;
|
|
|
|
std::map<const Identifier *, const DestructorNameId *> destructorNameIds;
|
|
|
|
std::map<int, const OperatorNameId *> operatorNameIds;
|
|
|
|
std::map<FullySpecifiedType, const ConversionNameId *> conversionNameIds;
|
|
|
|
std::map<TemplateNameIdKey, const TemplateNameId *> templateNameIds;
|
|
|
|
std::map<QualifiedNameIdKey, const QualifiedNameId *> qualifiedNameIds;
|
|
|
|
std::map<SelectorNameIdKey, const SelectorNameId *> selectorNameIds;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
// types
|
|
|
|
VoidType voidType;
|
2009-11-30 18:13:08 +01:00
|
|
|
Table<IntegerType> integerTypes;
|
|
|
|
Table<FloatType> floatTypes;
|
|
|
|
Table<PointerToMemberType> pointerToMemberTypes;
|
|
|
|
Table<PointerType> pointerTypes;
|
|
|
|
Table<ReferenceType> referenceTypes;
|
|
|
|
Table<ArrayType> arrayTypes;
|
|
|
|
Table<NamedType> namedTypes;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
// symbols
|
2009-11-30 17:37:08 +01:00
|
|
|
std::vector<Symbol *> symbols;
|
2009-10-20 12:47:54 +02:00
|
|
|
|
|
|
|
// ObjC context keywords:
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *objcGetterId;
|
|
|
|
const Identifier *objcSetterId;
|
|
|
|
const Identifier *objcReadwriteId;
|
|
|
|
const Identifier *objcReadonlyId;
|
|
|
|
const Identifier *objcAssignId;
|
|
|
|
const Identifier *objcRetainId;
|
|
|
|
const Identifier *objcCopyId;
|
|
|
|
const Identifier *objcNonatomicId;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Control::Control()
|
2009-10-20 13:50:36 +02:00
|
|
|
{
|
|
|
|
d = new Data(this);
|
|
|
|
|
|
|
|
d->objcGetterId = findOrInsertIdentifier("getter");
|
|
|
|
d->objcSetterId = findOrInsertIdentifier("setter");
|
|
|
|
d->objcReadwriteId = findOrInsertIdentifier("readwrite");
|
|
|
|
d->objcReadonlyId = findOrInsertIdentifier("readonly");
|
|
|
|
d->objcAssignId = findOrInsertIdentifier("assign");
|
|
|
|
d->objcRetainId = findOrInsertIdentifier("retain");
|
|
|
|
d->objcCopyId = findOrInsertIdentifier("copy");
|
|
|
|
d->objcNonatomicId = findOrInsertIdentifier("nonatomic");
|
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
Control::~Control()
|
|
|
|
{ delete d; }
|
|
|
|
|
|
|
|
TranslationUnit *Control::translationUnit() const
|
|
|
|
{ return d->translationUnit; }
|
|
|
|
|
|
|
|
TranslationUnit *Control::switchTranslationUnit(TranslationUnit *unit)
|
|
|
|
{
|
|
|
|
TranslationUnit *previousTranslationUnit = d->translationUnit;
|
|
|
|
d->translationUnit = unit;
|
|
|
|
return previousTranslationUnit;
|
|
|
|
}
|
|
|
|
|
|
|
|
DiagnosticClient *Control::diagnosticClient() const
|
|
|
|
{ return d->diagnosticClient; }
|
|
|
|
|
|
|
|
void Control::setDiagnosticClient(DiagnosticClient *diagnosticClient)
|
|
|
|
{ d->diagnosticClient = diagnosticClient; }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::findIdentifier(const char *chars, unsigned size) const
|
2009-09-07 13:39:46 +02:00
|
|
|
{ return d->identifiers.findLiteral(chars, size); }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::findOrInsertIdentifier(const char *chars, unsigned size)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->identifiers.findOrInsertLiteral(chars, size); }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::findOrInsertIdentifier(const char *chars)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-23 11:56:44 +01:00
|
|
|
unsigned length = std::strlen(chars);
|
2008-12-02 12:01:29 +01:00
|
|
|
return findOrInsertIdentifier(chars, length);
|
|
|
|
}
|
|
|
|
|
2008-12-09 09:42:17 +01:00
|
|
|
Control::IdentifierIterator Control::firstIdentifier() const
|
|
|
|
{ return d->identifiers.begin(); }
|
|
|
|
|
|
|
|
Control::IdentifierIterator Control::lastIdentifier() const
|
|
|
|
{ return d->identifiers.end(); }
|
|
|
|
|
2009-06-05 12:08:36 +02:00
|
|
|
Control::StringLiteralIterator Control::firstStringLiteral() const
|
|
|
|
{ return d->stringLiterals.begin(); }
|
|
|
|
|
|
|
|
Control::StringLiteralIterator Control::lastStringLiteral() const
|
|
|
|
{ return d->stringLiterals.end(); }
|
|
|
|
|
|
|
|
Control::NumericLiteralIterator Control::firstNumericLiteral() const
|
|
|
|
{ return d->numericLiterals.begin(); }
|
|
|
|
|
|
|
|
Control::NumericLiteralIterator Control::lastNumericLiteral() const
|
|
|
|
{ return d->numericLiterals.end(); }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const StringLiteral *Control::findOrInsertStringLiteral(const char *chars, unsigned size)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->stringLiterals.findOrInsertLiteral(chars, size); }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const StringLiteral *Control::findOrInsertStringLiteral(const char *chars)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-23 11:56:44 +01:00
|
|
|
unsigned length = std::strlen(chars);
|
2008-12-02 12:01:29 +01:00
|
|
|
return findOrInsertStringLiteral(chars, length);
|
|
|
|
}
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const NumericLiteral *Control::findOrInsertNumericLiteral(const char *chars, unsigned size)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->numericLiterals.findOrInsertLiteral(chars, size); }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const NumericLiteral *Control::findOrInsertNumericLiteral(const char *chars)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-23 11:56:44 +01:00
|
|
|
unsigned length = std::strlen(chars);
|
2008-12-02 12:01:29 +01:00
|
|
|
return findOrInsertNumericLiteral(chars, length);
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const NameId *Control::nameId(const Identifier *id)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertNameId(id); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const TemplateNameId *Control::templateNameId(const Identifier *id,
|
|
|
|
const FullySpecifiedType *const args,
|
|
|
|
unsigned argv)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
std::vector<FullySpecifiedType> templateArguments(args, args + argv);
|
|
|
|
return d->findOrInsertTemplateNameId(id, templateArguments);
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const DestructorNameId *Control::destructorNameId(const Identifier *id)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertDestructorNameId(id); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const OperatorNameId *Control::operatorNameId(int kind)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertOperatorNameId(kind); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const ConversionNameId *Control::conversionNameId(const FullySpecifiedType &type)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertConversionNameId(type); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const QualifiedNameId *Control::qualifiedNameId(const Name *const *names,
|
|
|
|
unsigned nameCount,
|
|
|
|
bool isGlobal)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-12-01 12:46:15 +01:00
|
|
|
std::vector<const Name *> classOrNamespaceNames(names, names + nameCount);
|
2008-12-02 12:01:29 +01:00
|
|
|
return d->findOrInsertQualifiedNameId(classOrNamespaceNames, isGlobal);
|
|
|
|
}
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
const SelectorNameId *Control::selectorNameId(const Name *const *names,
|
|
|
|
unsigned nameCount,
|
|
|
|
bool hasArguments)
|
2009-07-31 16:03:48 +02:00
|
|
|
{
|
2009-12-01 12:46:15 +01:00
|
|
|
std::vector<const Name *> selectorNames(names, names + nameCount);
|
2009-07-31 16:03:48 +02:00
|
|
|
return d->findOrInsertSelectorNameId(selectorNames, hasArguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
VoidType *Control::voidType()
|
|
|
|
{ return &d->voidType; }
|
|
|
|
|
|
|
|
IntegerType *Control::integerType(int kind)
|
|
|
|
{ return d->findOrInsertIntegerType(kind); }
|
|
|
|
|
|
|
|
FloatType *Control::floatType(int kind)
|
|
|
|
{ return d->findOrInsertFloatType(kind); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
PointerToMemberType *Control::pointerToMemberType(const Name *memberName, const FullySpecifiedType &elementType)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertPointerToMemberType(memberName, elementType); }
|
|
|
|
|
2009-11-17 14:37:45 +01:00
|
|
|
PointerType *Control::pointerType(const FullySpecifiedType &elementType)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertPointerType(elementType); }
|
|
|
|
|
2009-11-17 14:37:45 +01:00
|
|
|
ReferenceType *Control::referenceType(const FullySpecifiedType &elementType)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertReferenceType(elementType); }
|
|
|
|
|
2009-11-23 12:42:28 +01:00
|
|
|
ArrayType *Control::arrayType(const FullySpecifiedType &elementType, unsigned size)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertArrayType(elementType, size); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
NamedType *Control::namedType(const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->findOrInsertNamedType(name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Argument *Control::newArgument(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newArgument(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Function *Control::newFunction(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newFunction(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Namespace *Control::newNamespace(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newNamespace(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
BaseClass *Control::newBaseClass(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newBaseClass(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Class *Control::newClass(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newClass(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Enum *Control::newEnum(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newEnum(sourceLocation, name); }
|
|
|
|
|
|
|
|
Block *Control::newBlock(unsigned sourceLocation)
|
|
|
|
{ return d->newBlock(sourceLocation); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
Declaration *Control::newDeclaration(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newDeclaration(sourceLocation, name); }
|
|
|
|
|
|
|
|
UsingNamespaceDirective *Control::newUsingNamespaceDirective(unsigned sourceLocation,
|
2009-12-01 12:46:15 +01:00
|
|
|
const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newUsingNamespaceDirective(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
UsingDeclaration *Control::newUsingDeclaration(unsigned sourceLocation, const Name *name)
|
2008-12-02 12:01:29 +01:00
|
|
|
{ return d->newUsingDeclaration(sourceLocation, name); }
|
|
|
|
|
2009-02-16 15:43:24 +01:00
|
|
|
ForwardClassDeclaration *Control::newForwardClassDeclaration(unsigned sourceLocation,
|
2009-12-01 12:46:15 +01:00
|
|
|
const Name *name)
|
2009-02-16 15:43:24 +01:00
|
|
|
{ return d->newForwardClassDeclaration(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCBaseClass *Control::newObjCBaseClass(unsigned sourceLocation, const Name *name)
|
2009-10-05 18:02:01 +02:00
|
|
|
{ return d->newObjCBaseClass(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCBaseProtocol *Control::newObjCBaseProtocol(unsigned sourceLocation, const Name *name)
|
2009-10-05 18:02:01 +02:00
|
|
|
{ return d->newObjCBaseProtocol(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCClass *Control::newObjCClass(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{ return d->newObjCClass(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCForwardClassDeclaration *Control::newObjCForwardClassDeclaration(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{ return d->newObjCForwardClassDeclaration(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCProtocol *Control::newObjCProtocol(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{ return d->newObjCProtocol(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCForwardProtocolDeclaration *Control::newObjCForwardProtocolDeclaration(unsigned sourceLocation, const Name *name)
|
2009-07-28 16:34:15 +02:00
|
|
|
{ return d->newObjCForwardProtocolDeclaration(sourceLocation, name); }
|
2009-02-16 15:43:24 +01:00
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCMethod *Control::newObjCMethod(unsigned sourceLocation, const Name *name)
|
2009-08-05 18:30:18 +02:00
|
|
|
{ return d->newObjCMethod(sourceLocation, name); }
|
|
|
|
|
2009-12-01 12:46:15 +01:00
|
|
|
ObjCPropertyDeclaration *Control::newObjCPropertyDeclaration(unsigned sourceLocation, const Name *name)
|
2009-11-11 09:32:05 +01:00
|
|
|
{ return d->newObjCPropertyDeclaration(sourceLocation, name); }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcGetterId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcGetterId; }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcSetterId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcSetterId; }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcReadwriteId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcReadwriteId; }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcReadonlyId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcReadonlyId; }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcAssignId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcAssignId; }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcRetainId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcRetainId; }
|
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcCopyId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcCopyId; }
|
2009-10-20 11:21:25 +02:00
|
|
|
|
2009-12-01 11:33:13 +01:00
|
|
|
const Identifier *Control::objcNonatomicId() const
|
2009-10-20 12:47:54 +02:00
|
|
|
{ return d->objcNonatomicId; }
|