Some tweaks suggested by Argiris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59661 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Douglas Gregor 2008-11-19 19:09:45 +00:00
Родитель bd1f63a1ac
Коммит 487a75ab30
4 изменённых файлов: 39 добавлений и 40 удалений

Просмотреть файл

@ -469,24 +469,24 @@ public:
/// similar to ActOnIdentifierExpr, except that instead of providing
/// an identifier the parser provides the kind of overloaded
/// operator that was parsed.
virtual ExprResult ActOnOperatorFunctionIdExpr(Scope *S,
SourceLocation OperatorLoc,
OverloadedOperatorKind Op,
bool HasTrailingLParen,
const CXXScopeSpec *SS = 0) {
virtual ExprResult ActOnCXXOperatorFunctionIdExpr(Scope *S,
SourceLocation OperatorLoc,
OverloadedOperatorKind Op,
bool HasTrailingLParen,
const CXXScopeSpec &SS) {
return 0;
}
/// ActOnConversionFunctionExpr - Parse a C++ conversion function
/// ActOnCXXConversionFunctionExpr - Parse a C++ conversion function
/// name (e.g., @c operator void const *) as an expression. This is
/// very similar to ActOnIdentifierExpr, except that instead of
/// providing an identifier the parser provides the type of the
/// conversion function.
virtual ExprResult ActOnConversionFunctionExpr(Scope *S,
SourceLocation OperatorLoc,
TypeTy *Type,
bool HasTrailingLParen,
const CXXScopeSpec *SS = 0) {
virtual ExprResult ActOnCXXConversionFunctionExpr(Scope *S,
SourceLocation OperatorLoc,
TypeTy *Type,
bool HasTrailingLParen,
const CXXScopeSpec &SS) {
return 0;
}

Просмотреть файл

@ -150,12 +150,12 @@ Parser::ExprResult Parser::ParseCXXIdExpression() {
case tok::kw_operator: {
SourceLocation OperatorLoc = Tok.getLocation();
if (OverloadedOperatorKind Op = TryParseOperatorFunctionId()) {
return Actions.ActOnOperatorFunctionIdExpr(CurScope, OperatorLoc, Op,
Tok.is(tok::l_paren), &SS);
return Actions.ActOnCXXOperatorFunctionIdExpr(CurScope, OperatorLoc, Op,
Tok.is(tok::l_paren), SS);
} else if (TypeTy *Type = ParseConversionFunctionId()) {
return Actions.ActOnConversionFunctionExpr(CurScope, OperatorLoc,
Type, Tok.is(tok::l_paren),
&SS);
return Actions.ActOnCXXConversionFunctionExpr(CurScope, OperatorLoc,
Type, Tok.is(tok::l_paren),
SS);
}
// We already complained about a bad conversion-function-id,

Просмотреть файл

@ -612,16 +612,16 @@ public:
IdentifierInfo &II,
bool HasTrailingLParen,
const CXXScopeSpec *SS = 0);
virtual ExprResult ActOnOperatorFunctionIdExpr(Scope *S,
SourceLocation OperatorLoc,
OverloadedOperatorKind Op,
bool HasTrailingLParen,
const CXXScopeSpec *SS = 0);
virtual ExprResult ActOnConversionFunctionExpr(Scope *S,
SourceLocation OperatorLoc,
TypeTy *Ty,
bool HasTrailingLParen,
const CXXScopeSpec *SS);
virtual ExprResult ActOnCXXOperatorFunctionIdExpr(Scope *S,
SourceLocation OperatorLoc,
OverloadedOperatorKind Op,
bool HasTrailingLParen,
const CXXScopeSpec &SS);
virtual ExprResult ActOnCXXConversionFunctionExpr(Scope *S,
SourceLocation OperatorLoc,
TypeTy *Ty,
bool HasTrailingLParen,
const CXXScopeSpec &SS);
ExprResult ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
DeclarationName Name,
bool HasTrailingLParen,

Просмотреть файл

@ -19,36 +19,35 @@
#include "clang/Basic/Diagnostic.h"
using namespace clang;
/// ActOnConversionFunctionExpr - Parse a C++ conversion function
/// ActOnCXXConversionFunctionExpr - Parse a C++ conversion function
/// name (e.g., operator void const *) as an expression. This is
/// very similar to ActOnIdentifierExpr, except that instead of
/// providing an identifier the parser provides the type of the
/// conversion function.
Sema::ExprResult Sema::ActOnConversionFunctionExpr(Scope *S,
SourceLocation OperatorLoc,
TypeTy *Ty,
bool HasTrailingLParen,
const CXXScopeSpec *SS) {
Sema::ExprResult
Sema::ActOnCXXConversionFunctionExpr(Scope *S, SourceLocation OperatorLoc,
TypeTy *Ty, bool HasTrailingLParen,
const CXXScopeSpec &SS) {
QualType ConvType = QualType::getFromOpaquePtr(Ty);
QualType ConvTypeCanon = Context.getCanonicalType(ConvType);
DeclarationName ConvName
= Context.DeclarationNames.getCXXConversionFunctionName(ConvTypeCanon);
return ActOnDeclarationNameExpr(S, OperatorLoc, ConvName, HasTrailingLParen,
SS);
&SS);
}
/// ActOnOperatorFunctionIdExpr - Parse a C++ overloaded operator
/// ActOnCXXOperatorFunctionIdExpr - Parse a C++ overloaded operator
/// name (e.g., @c operator+ ) as an expression. This is very
/// similar to ActOnIdentifierExpr, except that instead of providing
/// an identifier the parser provides the kind of overloaded
/// operator that was parsed.
Sema::ExprResult Sema::ActOnOperatorFunctionIdExpr(Scope *S,
SourceLocation OperatorLoc,
OverloadedOperatorKind Op,
bool HasTrailingLParen,
const CXXScopeSpec *SS) {
Sema::ExprResult
Sema::ActOnCXXOperatorFunctionIdExpr(Scope *S, SourceLocation OperatorLoc,
OverloadedOperatorKind Op,
bool HasTrailingLParen,
const CXXScopeSpec &SS) {
DeclarationName Name = Context.DeclarationNames.getCXXOperatorName(Op);
return ActOnDeclarationNameExpr(S, OperatorLoc, Name, HasTrailingLParen, SS);
return ActOnDeclarationNameExpr(S, OperatorLoc, Name, HasTrailingLParen, &SS);
}
/// ActOnCXXTypeidOfType - Parse typeid( type-id ).