forked from qt-creator/qt-creator
C++: remove reserved names.
See [global.names] (17.6.4.3.2 in the C++11 spec.) Change-Id: I8434496dbe392b52d339d5f17cfaeee8dbd88995 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
12642cc49a
commit
703f36a4b8
22
src/libs/3rdparty/cplusplus/AST.h
vendored
22
src/libs/3rdparty/cplusplus/AST.h
vendored
@@ -27,7 +27,7 @@
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
template <typename _Tp>
|
||||
template <typename Tptr>
|
||||
class CPLUSPLUS_EXPORT List: public Managed
|
||||
{
|
||||
List(const List &other);
|
||||
@@ -35,10 +35,10 @@ class CPLUSPLUS_EXPORT List: public Managed
|
||||
|
||||
public:
|
||||
List()
|
||||
: value(_Tp()), next(0)
|
||||
: value(Tptr()), next(0)
|
||||
{ }
|
||||
|
||||
List(const _Tp &value)
|
||||
List(const Tptr &value)
|
||||
: value(value), next(0)
|
||||
{ }
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
unsigned lastToken() const
|
||||
{
|
||||
_Tp lv = lastValue();
|
||||
Tptr lv = lastValue();
|
||||
|
||||
if (lv)
|
||||
return lv->lastToken();
|
||||
@@ -62,9 +62,9 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
_Tp lastValue() const
|
||||
Tptr lastValue() const
|
||||
{
|
||||
_Tp lastValue = 0;
|
||||
Tptr lastValue = 0;
|
||||
|
||||
for (const List *it = this; it; it = it->next) {
|
||||
if (it->value)
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
return lastValue;
|
||||
}
|
||||
|
||||
_Tp value;
|
||||
Tptr value;
|
||||
List *next;
|
||||
};
|
||||
|
||||
@@ -92,8 +92,8 @@ public:
|
||||
static void accept(AST *ast, ASTVisitor *visitor)
|
||||
{ if (ast) ast->accept(visitor); }
|
||||
|
||||
template <typename _Tp>
|
||||
static void accept(List<_Tp> *it, ASTVisitor *visitor)
|
||||
template <typename Tptr>
|
||||
static void accept(List<Tptr> *it, ASTVisitor *visitor)
|
||||
{
|
||||
for (; it; it = it->next)
|
||||
accept(it->value, visitor);
|
||||
@@ -102,8 +102,8 @@ public:
|
||||
static bool match(AST *ast, AST *pattern, ASTMatcher *matcher);
|
||||
bool match(AST *pattern, ASTMatcher *matcher);
|
||||
|
||||
template <typename _Tp>
|
||||
static bool match(List<_Tp> *it, List<_Tp> *patternIt, ASTMatcher *matcher)
|
||||
template <typename Tptr>
|
||||
static bool match(List<Tptr> *it, List<Tptr> *patternIt, ASTMatcher *matcher)
|
||||
{
|
||||
while (it && patternIt) {
|
||||
if (! match(it->value, patternIt->value, matcher))
|
||||
|
||||
4
src/libs/3rdparty/cplusplus/ASTVisitor.h
vendored
4
src/libs/3rdparty/cplusplus/ASTVisitor.h
vendored
@@ -63,8 +63,8 @@ public:
|
||||
|
||||
void accept(AST *ast);
|
||||
|
||||
template <typename _Tp>
|
||||
void accept(List<_Tp> *it)
|
||||
template <typename Tptr>
|
||||
void accept(List<Tptr> *it)
|
||||
{
|
||||
for (; it; it = it->next)
|
||||
accept(it->value);
|
||||
|
||||
2
src/libs/3rdparty/cplusplus/ASTfwd.h
vendored
2
src/libs/3rdparty/cplusplus/ASTfwd.h
vendored
@@ -25,7 +25,7 @@
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
template <typename _Tp> class List;
|
||||
template <typename Tptr> class List;
|
||||
|
||||
class AST;
|
||||
class ASTVisitor;
|
||||
|
||||
28
src/libs/3rdparty/cplusplus/Control.cpp
vendored
28
src/libs/3rdparty/cplusplus/Control.cpp
vendored
@@ -33,7 +33,7 @@ using namespace CPlusPlus;
|
||||
|
||||
namespace {
|
||||
|
||||
template <typename _Tp>
|
||||
template <typename T>
|
||||
struct Compare;
|
||||
|
||||
template <> struct Compare<IntegerType>
|
||||
@@ -178,26 +178,26 @@ template <> struct Compare<SelectorNameId>
|
||||
};
|
||||
|
||||
|
||||
template <typename _Tp>
|
||||
class Table: public std::set<_Tp, Compare<_Tp> >
|
||||
template <typename T>
|
||||
class Table: public std::set<T, Compare<T> >
|
||||
{
|
||||
typedef std::set<_Tp, Compare<_Tp> > _Base;
|
||||
typedef std::set<T, Compare<T> > _Base;
|
||||
public:
|
||||
_Tp *intern(const _Tp &element)
|
||||
{ return const_cast<_Tp *>(&*_Base::insert(element).first); }
|
||||
T *intern(const T &element)
|
||||
{ return const_cast<T *>(&*_Base::insert(element).first); }
|
||||
};
|
||||
|
||||
} // end of anonymous namespace
|
||||
|
||||
template <typename _Iterator>
|
||||
static void delete_array_entries(_Iterator first, _Iterator last)
|
||||
template <typename Iterator>
|
||||
static void delete_array_entries(Iterator first, Iterator last)
|
||||
{
|
||||
for (; first != last; ++first)
|
||||
delete *first;
|
||||
}
|
||||
|
||||
template <typename _Array>
|
||||
static void delete_array_entries(const _Array &a)
|
||||
template <typename Array>
|
||||
static void delete_array_entries(const Array &a)
|
||||
{ delete_array_entries(a.begin(), a.end()); }
|
||||
|
||||
class Control::Data
|
||||
@@ -233,9 +233,9 @@ public:
|
||||
return anonymousNameIds.intern(AnonymousNameId(classTokenIndex));
|
||||
}
|
||||
|
||||
template <typename _Iterator>
|
||||
template <typename Iterator>
|
||||
const TemplateNameId *findOrInsertTemplateNameId(const Identifier *id, bool isSpecialization,
|
||||
_Iterator first, _Iterator last)
|
||||
Iterator first, Iterator last)
|
||||
{
|
||||
return templateNameIds.intern(TemplateNameId(id, isSpecialization, first, last));
|
||||
}
|
||||
@@ -260,8 +260,8 @@ public:
|
||||
return qualifiedNameIds.intern(QualifiedNameId(base, name));
|
||||
}
|
||||
|
||||
template <typename _Iterator>
|
||||
const SelectorNameId *findOrInsertSelectorNameId(_Iterator first, _Iterator last, bool hasArguments)
|
||||
template <typename Iterator>
|
||||
const SelectorNameId *findOrInsertSelectorNameId(Iterator first, Iterator last, bool hasArguments)
|
||||
{
|
||||
return selectorNameIds.intern(SelectorNameId(first, last, hasArguments));
|
||||
}
|
||||
|
||||
14
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
14
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -137,7 +137,7 @@ void Lexer::scan(Token *tok)
|
||||
|
||||
void Lexer::scan_helper(Token *tok)
|
||||
{
|
||||
_Lagain:
|
||||
again:
|
||||
while (_yychar && std::isspace(_yychar)) {
|
||||
if (_yychar == '\n') {
|
||||
tok->f.joined = s._newlineExpected;
|
||||
@@ -198,7 +198,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
}
|
||||
|
||||
if (! f._scanCommentTokens)
|
||||
goto _Lagain;
|
||||
goto again;
|
||||
|
||||
tok->f.kind = originalKind;
|
||||
return; // done
|
||||
@@ -232,7 +232,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
switch (ch) {
|
||||
case '\\':
|
||||
s._newlineExpected = true;
|
||||
goto _Lagain;
|
||||
goto again;
|
||||
|
||||
case '"':
|
||||
scanStringLiteral(tok);
|
||||
@@ -404,7 +404,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
scanCppComment(commentType);
|
||||
|
||||
if (! f._scanCommentTokens)
|
||||
goto _Lagain;
|
||||
goto again;
|
||||
|
||||
tok->f.kind = commentType;
|
||||
|
||||
@@ -419,7 +419,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
yyinp();
|
||||
|
||||
if (ch == '*' && _yychar == '/')
|
||||
goto _Ldone;
|
||||
goto done;
|
||||
|
||||
if (_yychar == '<')
|
||||
yyinp();
|
||||
@@ -438,14 +438,14 @@ void Lexer::scan_helper(Token *tok)
|
||||
}
|
||||
}
|
||||
|
||||
_Ldone:
|
||||
done:
|
||||
if (_yychar)
|
||||
yyinp();
|
||||
else
|
||||
s._tokenKind = commentKind;
|
||||
|
||||
if (! f._scanCommentTokens)
|
||||
goto _Lagain;
|
||||
goto again;
|
||||
|
||||
tok->f.kind = commentKind;
|
||||
|
||||
|
||||
42
src/libs/3rdparty/cplusplus/LiteralTable.h
vendored
42
src/libs/3rdparty/cplusplus/LiteralTable.h
vendored
@@ -26,14 +26,14 @@
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
template <typename _Literal>
|
||||
template <typename Literal>
|
||||
class LiteralTable
|
||||
{
|
||||
LiteralTable(const LiteralTable &other);
|
||||
void operator =(const LiteralTable &other);
|
||||
|
||||
public:
|
||||
typedef _Literal *const *iterator;
|
||||
typedef Literal *const *iterator;
|
||||
|
||||
public:
|
||||
LiteralTable()
|
||||
@@ -52,8 +52,8 @@ public:
|
||||
void reset()
|
||||
{
|
||||
if (_literals) {
|
||||
_Literal **lastLiteral = _literals + _literalCount + 1;
|
||||
for (_Literal **it = _literals; it != lastLiteral; ++it)
|
||||
Literal **lastLiteral = _literals + _literalCount + 1;
|
||||
for (Literal **it = _literals; it != lastLiteral; ++it)
|
||||
delete *it;
|
||||
std::free(_literals);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
unsigned size() const
|
||||
{ return _literalCount + 1; }
|
||||
|
||||
const _Literal *at(unsigned index) const
|
||||
const Literal *at(unsigned index) const
|
||||
{ return _literals[index]; }
|
||||
|
||||
iterator begin() const
|
||||
@@ -82,12 +82,12 @@ public:
|
||||
iterator end() const
|
||||
{ return _literals + _literalCount + 1; }
|
||||
|
||||
const _Literal *findLiteral(const char *chars, unsigned size) const
|
||||
const Literal *findLiteral(const char *chars, unsigned size) const
|
||||
{
|
||||
if (_buckets) {
|
||||
unsigned h = _Literal::hashCode(chars, size);
|
||||
_Literal *literal = _buckets[h % _allocatedBuckets];
|
||||
for (; literal; literal = static_cast<_Literal *>(literal->_next)) {
|
||||
unsigned h = Literal::hashCode(chars, size);
|
||||
Literal *literal = _buckets[h % _allocatedBuckets];
|
||||
for (; literal; literal = static_cast<Literal *>(literal->_next)) {
|
||||
if (literal->size() == size && ! std::strncmp(literal->chars(), chars, size))
|
||||
return literal;
|
||||
}
|
||||
@@ -96,18 +96,18 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
const _Literal *findOrInsertLiteral(const char *chars, unsigned size)
|
||||
const Literal *findOrInsertLiteral(const char *chars, unsigned size)
|
||||
{
|
||||
if (_buckets) {
|
||||
unsigned h = _Literal::hashCode(chars, size);
|
||||
_Literal *literal = _buckets[h % _allocatedBuckets];
|
||||
for (; literal; literal = static_cast<_Literal *>(literal->_next)) {
|
||||
unsigned h = Literal::hashCode(chars, size);
|
||||
Literal *literal = _buckets[h % _allocatedBuckets];
|
||||
for (; literal; literal = static_cast<Literal *>(literal->_next)) {
|
||||
if (literal->size() == size && ! std::strncmp(literal->chars(), chars, size))
|
||||
return literal;
|
||||
}
|
||||
}
|
||||
|
||||
_Literal *literal = new _Literal(chars, size);
|
||||
Literal *literal = new Literal(chars, size);
|
||||
|
||||
if (++_literalCount == _allocatedLiterals) {
|
||||
if (! _allocatedLiterals)
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
else
|
||||
_allocatedLiterals <<= 1;
|
||||
|
||||
_literals = (_Literal **) std::realloc(_literals, sizeof(_Literal *) * _allocatedLiterals);
|
||||
_literals = (Literal **) std::realloc(_literals, sizeof(Literal *) * _allocatedLiterals);
|
||||
}
|
||||
|
||||
_literals[_literalCount] = literal;
|
||||
@@ -142,12 +142,12 @@ protected:
|
||||
else
|
||||
_allocatedBuckets <<= 1;
|
||||
|
||||
_buckets = (_Literal **) std::calloc(_allocatedBuckets, sizeof(_Literal *));
|
||||
_buckets = (Literal **) std::calloc(_allocatedBuckets, sizeof(Literal *));
|
||||
|
||||
_Literal **lastLiteral = _literals + (_literalCount + 1);
|
||||
Literal **lastLiteral = _literals + (_literalCount + 1);
|
||||
|
||||
for (_Literal **it = _literals; it != lastLiteral; ++it) {
|
||||
_Literal *literal = *it;
|
||||
for (Literal **it = _literals; it != lastLiteral; ++it) {
|
||||
Literal *literal = *it;
|
||||
unsigned h = literal->hashCode() % _allocatedBuckets;
|
||||
|
||||
literal->_next = _buckets[h];
|
||||
@@ -156,8 +156,8 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
_Literal **_literals;
|
||||
_Literal **_buckets;
|
||||
Literal **_literals;
|
||||
Literal **_buckets;
|
||||
int _allocatedLiterals;
|
||||
int _literalCount;
|
||||
int _allocatedBuckets;
|
||||
|
||||
10
src/libs/3rdparty/cplusplus/Names.h
vendored
10
src/libs/3rdparty/cplusplus/Names.h
vendored
@@ -77,9 +77,9 @@ private:
|
||||
class CPLUSPLUS_EXPORT TemplateNameId: public Name
|
||||
{
|
||||
public:
|
||||
template <typename _Iterator>
|
||||
TemplateNameId(const Identifier *identifier, bool isSpecialization, _Iterator first,
|
||||
_Iterator last)
|
||||
template <typename Iterator>
|
||||
TemplateNameId(const Identifier *identifier, bool isSpecialization, Iterator first,
|
||||
Iterator last)
|
||||
: _identifier(identifier)
|
||||
, _templateArguments(first, last)
|
||||
, _isSpecialization(isSpecialization) {}
|
||||
@@ -220,8 +220,8 @@ private:
|
||||
class CPLUSPLUS_EXPORT SelectorNameId: public Name
|
||||
{
|
||||
public:
|
||||
template <typename _Iterator>
|
||||
SelectorNameId(_Iterator first, _Iterator last, bool hasArguments)
|
||||
template <typename Iterator>
|
||||
SelectorNameId(Iterator first, Iterator last, bool hasArguments)
|
||||
: _names(first, last), _hasArguments(hasArguments) {}
|
||||
|
||||
virtual ~SelectorNameId();
|
||||
|
||||
@@ -162,7 +162,7 @@ void TranslationUnit::tokenize()
|
||||
do {
|
||||
lex(&tk);
|
||||
|
||||
_Lrecognize:
|
||||
recognize:
|
||||
if (tk.is(T_POUND) && tk.newline()) {
|
||||
const unsigned utf16CharOffset = tk.utf16charOffset;
|
||||
lex(&tk);
|
||||
@@ -244,7 +244,7 @@ void TranslationUnit::tokenize()
|
||||
while (tk.isNot(T_EOF_SYMBOL) && ! tk.newline())
|
||||
lex(&tk);
|
||||
}
|
||||
goto _Lrecognize;
|
||||
goto recognize;
|
||||
} else if (tk.kind() == T_LBRACE) {
|
||||
braces.push(unsigned(_tokens->size()));
|
||||
} else if (tk.kind() == T_RBRACE && ! braces.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user