Browse Source

Moved operators parsing from methods to functions since functions can also be operators.

pull/47/merge
triton 13 years ago
parent
commit
d7541960c4
  1. 3
      src/AST/Function.cs
  2. 6
      src/AST/Method.cs
  3. 3
      src/Parser/Parser.cpp

3
src/AST/Function.cs

@ -75,6 +75,9 @@ namespace CppSharp.AST @@ -75,6 +75,9 @@ namespace CppSharp.AST
public bool IsInline { get; set; }
public bool IsPure { get; set; }
public CXXOperatorKind OperatorKind { get; set; }
public bool IsOperator { get { return OperatorKind != CXXOperatorKind.None; } }
public CallingConvention CallingConvention { get; set; }
public bool IsThisCall

6
src/AST/Method.cs

@ -80,7 +80,6 @@ namespace CppSharp.AST @@ -80,7 +80,6 @@ namespace CppSharp.AST
public bool IsProxy { get; set; }
public CXXMethodKind Kind;
public CXXOperatorKind OperatorKind;
public bool IsConstructor
{
@ -92,11 +91,6 @@ namespace CppSharp.AST @@ -92,11 +91,6 @@ namespace CppSharp.AST
get { return Kind == CXXMethodKind.Destructor; }
}
public bool IsOperator
{
get { return Kind == CXXMethodKind.Operator; }
}
public bool IsDefaultConstructor;
public bool IsCopyConstructor;
public bool IsMoveConstructor;

3
src/Parser/Parser.cpp

@ -788,7 +788,6 @@ CppSharp::AST::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD) @@ -788,7 +788,6 @@ CppSharp::AST::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD)
CppSharp::AST::Method^ Method = gcnew CppSharp::AST::Method();
Method->Access = ConvertToAccess(MD->getAccess());
Method->Kind = GetMethodKindFromDecl(Name);
Method->OperatorKind = GetOperatorKindFromDecl(Name);
Method->IsStatic = MD->isStatic();
Method->IsVirtual = MD->isVirtual();
Method->IsOverride = MD->size_overridden_methods() > 0;
@ -1517,6 +1516,8 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, CppSharp::AST::Function^ F, @@ -1517,6 +1516,8 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, CppSharp::AST::Function^ F,
auto AbiCC = GetAbiCallConv(CC, FD->isCXXInstanceMember(), FD->isVariadic());
F->CallingConvention = ConvertCallConv(AbiCC);
F->OperatorKind = GetOperatorKindFromDecl(FD->getDeclName());
TypeLoc RTL;
if (auto TSI = FD->getTypeSourceInfo())
{

Loading…
Cancel
Save