|
|
|
@ -10,14 +10,13 @@
@@ -10,14 +10,13 @@
|
|
|
|
|
#include "Helpers.h" |
|
|
|
|
#include "Sources.h" |
|
|
|
|
#include "Types.h" |
|
|
|
|
|
|
|
|
|
#include <algorithm> |
|
|
|
|
|
|
|
|
|
namespace CppSharp { |
|
|
|
|
namespace CppParser { |
|
|
|
|
namespace AST { |
|
|
|
|
namespace CppSharp::CppParser::AST { |
|
|
|
|
|
|
|
|
|
enum class DeclarationKind |
|
|
|
|
{ |
|
|
|
|
enum class DeclarationKind |
|
|
|
|
{ |
|
|
|
|
DeclarationContext, |
|
|
|
|
Typedef, |
|
|
|
|
TypeAlias, |
|
|
|
@ -49,26 +48,26 @@ namespace AST {
@@ -49,26 +48,26 @@ namespace AST {
|
|
|
|
|
VarTemplateSpecialization, |
|
|
|
|
VarTemplatePartialSpecialization, |
|
|
|
|
UnresolvedUsingTypename, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#define DECLARE_DECL_KIND(klass, kind) \ |
|
|
|
|
klass(); |
|
|
|
|
|
|
|
|
|
enum class AccessSpecifier |
|
|
|
|
{ |
|
|
|
|
enum class AccessSpecifier |
|
|
|
|
{ |
|
|
|
|
Private, |
|
|
|
|
Protected, |
|
|
|
|
Public |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class DeclarationContext; |
|
|
|
|
class RawComment; |
|
|
|
|
class PreprocessedEntity; |
|
|
|
|
class DeclarationContext; |
|
|
|
|
class RawComment; |
|
|
|
|
class PreprocessedEntity; |
|
|
|
|
|
|
|
|
|
class ExpressionObsolete; |
|
|
|
|
class CS_API Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class ExpressionObsolete; |
|
|
|
|
class CS_API Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
Declaration(DeclarationKind kind); |
|
|
|
|
Declaration(const Declaration&); |
|
|
|
|
~Declaration(); |
|
|
|
@ -95,24 +94,24 @@ namespace AST {
@@ -95,24 +94,24 @@ namespace AST {
|
|
|
|
|
VECTOR(Declaration*, Redeclarations) |
|
|
|
|
void* originalPtr; |
|
|
|
|
RawComment* comment; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Class; |
|
|
|
|
class Enumeration; |
|
|
|
|
class Function; |
|
|
|
|
class TypedefDecl; |
|
|
|
|
class TypeAlias; |
|
|
|
|
class Namespace; |
|
|
|
|
class Template; |
|
|
|
|
class TypeAliasTemplate; |
|
|
|
|
class ClassTemplate; |
|
|
|
|
class FunctionTemplate; |
|
|
|
|
class Variable; |
|
|
|
|
class Friend; |
|
|
|
|
|
|
|
|
|
class CS_API DeclarationContext : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Class; |
|
|
|
|
class Enumeration; |
|
|
|
|
class Function; |
|
|
|
|
class TypedefDecl; |
|
|
|
|
class TypeAlias; |
|
|
|
|
class Namespace; |
|
|
|
|
class Template; |
|
|
|
|
class TypeAliasTemplate; |
|
|
|
|
class ClassTemplate; |
|
|
|
|
class FunctionTemplate; |
|
|
|
|
class Variable; |
|
|
|
|
class Friend; |
|
|
|
|
|
|
|
|
|
class CS_API DeclarationContext : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
DeclarationContext(DeclarationKind kind); |
|
|
|
|
|
|
|
|
|
CS_IGNORE Declaration* FindAnonymous(const std::string& USR); |
|
|
|
@ -155,41 +154,41 @@ namespace AST {
@@ -155,41 +154,41 @@ namespace AST {
|
|
|
|
|
std::map<std::string, Declaration*> anonymous; |
|
|
|
|
|
|
|
|
|
bool isAnonymous; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API TypedefNameDecl : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TypedefNameDecl : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
TypedefNameDecl(DeclarationKind kind); |
|
|
|
|
~TypedefNameDecl(); |
|
|
|
|
QualifiedType qualifiedType; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API TypedefDecl : public TypedefNameDecl |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TypedefDecl : public TypedefNameDecl |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
DECLARE_DECL_KIND(TypedefDecl, Typedef) |
|
|
|
|
~TypedefDecl(); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API TypeAlias : public TypedefNameDecl |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TypeAlias : public TypedefNameDecl |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
TypeAlias(); |
|
|
|
|
~TypeAlias(); |
|
|
|
|
TypeAliasTemplate* describedAliasTemplate; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Friend : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Friend : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
DECLARE_DECL_KIND(Friend, Friend) |
|
|
|
|
~Friend(); |
|
|
|
|
Declaration* declaration; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class StatementClassObsolete |
|
|
|
|
{ |
|
|
|
|
enum class StatementClassObsolete |
|
|
|
|
{ |
|
|
|
|
Any, |
|
|
|
|
BinaryOperator, |
|
|
|
|
CallExprClass, |
|
|
|
@ -198,54 +197,54 @@ namespace AST {
@@ -198,54 +197,54 @@ namespace AST {
|
|
|
|
|
CXXOperatorCallExpr, |
|
|
|
|
ImplicitCastExpr, |
|
|
|
|
ExplicitCastExpr, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API StatementObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API StatementObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
StatementObsolete(const std::string& str, StatementClassObsolete Class = StatementClassObsolete::Any, Declaration* decl = 0); |
|
|
|
|
StatementClassObsolete _class; |
|
|
|
|
Declaration* decl; |
|
|
|
|
std::string string; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API ExpressionObsolete : public StatementObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API ExpressionObsolete : public StatementObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
ExpressionObsolete(const std::string& str, StatementClassObsolete Class = StatementClassObsolete::Any, Declaration* decl = 0); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Expr; |
|
|
|
|
class Expr; |
|
|
|
|
|
|
|
|
|
class CS_API BinaryOperatorObsolete : public ExpressionObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API BinaryOperatorObsolete : public ExpressionObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
BinaryOperatorObsolete(const std::string& str, ExpressionObsolete* lhs, ExpressionObsolete* rhs, const std::string& opcodeStr); |
|
|
|
|
~BinaryOperatorObsolete(); |
|
|
|
|
ExpressionObsolete* LHS; |
|
|
|
|
ExpressionObsolete* RHS; |
|
|
|
|
std::string opcodeStr; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API CallExprObsolete : public ExpressionObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API CallExprObsolete : public ExpressionObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
CallExprObsolete(const std::string& str, Declaration* decl); |
|
|
|
|
~CallExprObsolete(); |
|
|
|
|
VECTOR(ExpressionObsolete*, Arguments) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API CXXConstructExprObsolete : public ExpressionObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API CXXConstructExprObsolete : public ExpressionObsolete |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
CXXConstructExprObsolete(const std::string& str, Declaration* decl = 0); |
|
|
|
|
~CXXConstructExprObsolete(); |
|
|
|
|
VECTOR(ExpressionObsolete*, Arguments) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Parameter : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Parameter : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
Parameter(); |
|
|
|
|
~Parameter(); |
|
|
|
|
|
|
|
|
@ -255,20 +254,20 @@ namespace AST {
@@ -255,20 +254,20 @@ namespace AST {
|
|
|
|
|
unsigned int index; |
|
|
|
|
ExpressionObsolete* defaultArgument; |
|
|
|
|
Expr* defaultValue; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class CXXMethodKind |
|
|
|
|
{ |
|
|
|
|
enum class CXXMethodKind |
|
|
|
|
{ |
|
|
|
|
Normal, |
|
|
|
|
Constructor, |
|
|
|
|
Destructor, |
|
|
|
|
Conversion, |
|
|
|
|
Operator, |
|
|
|
|
UsingDirective |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class CXXOperatorKind |
|
|
|
|
{ |
|
|
|
|
enum class CXXOperatorKind |
|
|
|
|
{ |
|
|
|
|
None, |
|
|
|
|
New, |
|
|
|
|
Delete, |
|
|
|
@ -315,22 +314,22 @@ namespace AST {
@@ -315,22 +314,22 @@ namespace AST {
|
|
|
|
|
Subscript, |
|
|
|
|
Conditional, |
|
|
|
|
Coawait |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class FunctionTemplateSpecialization; |
|
|
|
|
class FunctionTemplateSpecialization; |
|
|
|
|
|
|
|
|
|
enum class FriendKind |
|
|
|
|
{ |
|
|
|
|
enum class FriendKind |
|
|
|
|
{ |
|
|
|
|
None, |
|
|
|
|
Declared, |
|
|
|
|
Undeclared |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Stmt; |
|
|
|
|
class Stmt; |
|
|
|
|
|
|
|
|
|
class CS_API Function : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Function : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
Function(); |
|
|
|
|
~Function(); |
|
|
|
|
|
|
|
|
@ -355,20 +354,20 @@ namespace AST {
@@ -355,20 +354,20 @@ namespace AST {
|
|
|
|
|
FunctionTemplateSpecialization* specializationInfo; |
|
|
|
|
Function* instantiatedFrom; |
|
|
|
|
QualifiedType qualifiedType; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class AccessSpecifierDecl; |
|
|
|
|
class AccessSpecifierDecl; |
|
|
|
|
|
|
|
|
|
enum class RefQualifierKind |
|
|
|
|
{ |
|
|
|
|
enum class RefQualifierKind |
|
|
|
|
{ |
|
|
|
|
None, |
|
|
|
|
LValue, |
|
|
|
|
RValue |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Method : public Function |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Method : public Function |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
Method(); |
|
|
|
|
~Method(); |
|
|
|
|
|
|
|
|
@ -387,11 +386,11 @@ namespace AST {
@@ -387,11 +386,11 @@ namespace AST {
|
|
|
|
|
QualifiedType conversionType; |
|
|
|
|
RefQualifierKind refQualifier; |
|
|
|
|
VECTOR(Method*, OverriddenMethods) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Enumeration : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Enumeration : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
DECLARE_DECL_KIND(Enumeration, Enumeration) |
|
|
|
|
~Enumeration(); |
|
|
|
|
|
|
|
|
@ -418,52 +417,52 @@ namespace AST {
@@ -418,52 +417,52 @@ namespace AST {
|
|
|
|
|
VECTOR(Item*, Items) |
|
|
|
|
|
|
|
|
|
Item* FindItemByName(const std::string& Name); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Variable : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Variable : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
DECLARE_DECL_KIND(Variable, Variable) |
|
|
|
|
~Variable(); |
|
|
|
|
bool isConstExpr; |
|
|
|
|
std::string mangled; |
|
|
|
|
QualifiedType qualifiedType; |
|
|
|
|
ExpressionObsolete* initializer; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class PreprocessedEntity; |
|
|
|
|
class PreprocessedEntity; |
|
|
|
|
|
|
|
|
|
struct CS_API BaseClassSpecifier |
|
|
|
|
{ |
|
|
|
|
struct CS_API BaseClassSpecifier |
|
|
|
|
{ |
|
|
|
|
BaseClassSpecifier(); |
|
|
|
|
AccessSpecifier access; |
|
|
|
|
bool isVirtual; |
|
|
|
|
Type* type; |
|
|
|
|
int offset; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Class; |
|
|
|
|
class Class; |
|
|
|
|
|
|
|
|
|
class CS_API Field : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Field : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
DECLARE_DECL_KIND(Field, Field) |
|
|
|
|
~Field(); |
|
|
|
|
QualifiedType qualifiedType; |
|
|
|
|
Class* _class; |
|
|
|
|
bool isBitField; |
|
|
|
|
unsigned bitWidth; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API AccessSpecifierDecl : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API AccessSpecifierDecl : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
DECLARE_DECL_KIND(AccessSpecifierDecl, AccessSpecifier) |
|
|
|
|
~AccessSpecifierDecl(); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class CppAbi |
|
|
|
|
{ |
|
|
|
|
enum class CppAbi |
|
|
|
|
{ |
|
|
|
|
Itanium, |
|
|
|
|
Microsoft, |
|
|
|
|
ARM, |
|
|
|
@ -471,10 +470,10 @@ namespace AST {
@@ -471,10 +470,10 @@ namespace AST {
|
|
|
|
|
iOS, |
|
|
|
|
AppleARM64, |
|
|
|
|
WebAssembly |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class VTableComponentKind |
|
|
|
|
{ |
|
|
|
|
enum class VTableComponentKind |
|
|
|
|
{ |
|
|
|
|
VCallOffset, |
|
|
|
|
VBaseOffset, |
|
|
|
|
OffsetToTop, |
|
|
|
@ -483,37 +482,37 @@ namespace AST {
@@ -483,37 +482,37 @@ namespace AST {
|
|
|
|
|
CompleteDtorPointer, |
|
|
|
|
DeletingDtorPointer, |
|
|
|
|
UnusedFunctionPointer, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct CS_API VTableComponent |
|
|
|
|
{ |
|
|
|
|
struct CS_API VTableComponent |
|
|
|
|
{ |
|
|
|
|
VTableComponent(); |
|
|
|
|
VTableComponentKind kind; |
|
|
|
|
unsigned offset; |
|
|
|
|
Declaration* declaration; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct CS_API VTableLayout |
|
|
|
|
{ |
|
|
|
|
struct CS_API VTableLayout |
|
|
|
|
{ |
|
|
|
|
VTableLayout(); |
|
|
|
|
VTableLayout(const VTableLayout&); |
|
|
|
|
~VTableLayout(); |
|
|
|
|
VECTOR(VTableComponent, Components) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct CS_API VFTableInfo |
|
|
|
|
{ |
|
|
|
|
struct CS_API VFTableInfo |
|
|
|
|
{ |
|
|
|
|
VFTableInfo(); |
|
|
|
|
VFTableInfo(const VFTableInfo&); |
|
|
|
|
uint64_t VBTableIndex; |
|
|
|
|
uint32_t VFPtrOffset; |
|
|
|
|
uint32_t VFPtrFullOffset; |
|
|
|
|
VTableLayout layout; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API LayoutField |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API LayoutField |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
LayoutField(); |
|
|
|
|
LayoutField(const LayoutField& other); |
|
|
|
|
~LayoutField(); |
|
|
|
@ -521,22 +520,22 @@ namespace AST {
@@ -521,22 +520,22 @@ namespace AST {
|
|
|
|
|
std::string name; |
|
|
|
|
QualifiedType qualifiedType; |
|
|
|
|
void* fieldPtr; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Class; |
|
|
|
|
class Class; |
|
|
|
|
|
|
|
|
|
class CS_API LayoutBase |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API LayoutBase |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
LayoutBase(); |
|
|
|
|
LayoutBase(const LayoutBase& other); |
|
|
|
|
~LayoutBase(); |
|
|
|
|
unsigned offset; |
|
|
|
|
Class* _class; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class RecordArgABI |
|
|
|
|
{ |
|
|
|
|
enum class RecordArgABI |
|
|
|
|
{ |
|
|
|
|
/// Pass it using the normal C aggregate rules for the ABI,
|
|
|
|
|
/// potentially introducing extra copies and passing some
|
|
|
|
|
/// or all of it in registers.
|
|
|
|
@ -548,10 +547,10 @@ namespace AST {
@@ -548,10 +547,10 @@ namespace AST {
|
|
|
|
|
DirectInMemory, |
|
|
|
|
/// Pass it as a pointer to temporary memory.
|
|
|
|
|
Indirect |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct CS_API ClassLayout |
|
|
|
|
{ |
|
|
|
|
struct CS_API ClassLayout |
|
|
|
|
{ |
|
|
|
|
ClassLayout(); |
|
|
|
|
CppAbi ABI; |
|
|
|
|
RecordArgABI argABI; |
|
|
|
@ -564,11 +563,11 @@ namespace AST {
@@ -564,11 +563,11 @@ namespace AST {
|
|
|
|
|
int dataSize; |
|
|
|
|
VECTOR(LayoutField, Fields) |
|
|
|
|
VECTOR(LayoutBase, Bases) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Class : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Class : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
Class(); |
|
|
|
|
~Class(); |
|
|
|
|
|
|
|
|
@ -590,20 +589,20 @@ namespace AST {
@@ -590,20 +589,20 @@ namespace AST {
|
|
|
|
|
TagKind tagKind; |
|
|
|
|
|
|
|
|
|
ClassLayout* layout; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Template : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Template : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
Template(DeclarationKind kind); |
|
|
|
|
DECLARE_DECL_KIND(Template, Template) |
|
|
|
|
Declaration* TemplatedDecl; |
|
|
|
|
VECTOR(Declaration*, Parameters) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template <typename T> |
|
|
|
|
T* DeclarationContext::FindTemplate(const std::string& USR) |
|
|
|
|
{ |
|
|
|
|
template <typename T> |
|
|
|
|
T* DeclarationContext::FindTemplate(const std::string& USR) |
|
|
|
|
{ |
|
|
|
|
auto foundTemplate = std::find_if(Templates.begin(), Templates.end(), |
|
|
|
|
[&](Template* t) |
|
|
|
|
{ |
|
|
|
@ -614,51 +613,51 @@ namespace AST {
@@ -614,51 +613,51 @@ namespace AST {
|
|
|
|
|
return static_cast<T*>(*foundTemplate); |
|
|
|
|
|
|
|
|
|
return nullptr; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class CS_API TypeAliasTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TypeAliasTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
TypeAliasTemplate(); |
|
|
|
|
~TypeAliasTemplate(); |
|
|
|
|
|
|
|
|
|
Declaration* CanonicalDecl = nullptr; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API TemplateParameter : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TemplateParameter : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
TemplateParameter(DeclarationKind kind); |
|
|
|
|
~TemplateParameter(); |
|
|
|
|
unsigned int depth; |
|
|
|
|
unsigned int index; |
|
|
|
|
bool isParameterPack; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API TemplateTemplateParameter : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TemplateTemplateParameter : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
TemplateTemplateParameter(); |
|
|
|
|
~TemplateTemplateParameter(); |
|
|
|
|
|
|
|
|
|
bool isParameterPack; |
|
|
|
|
bool isPackExpansion; |
|
|
|
|
bool isExpandedParameterPack; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API TypeTemplateParameter : public TemplateParameter |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TypeTemplateParameter : public TemplateParameter |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
TypeTemplateParameter(); |
|
|
|
|
TypeTemplateParameter(const TypeTemplateParameter&); |
|
|
|
|
~TypeTemplateParameter(); |
|
|
|
|
|
|
|
|
|
QualifiedType defaultArgument; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API NonTypeTemplateParameter : public TemplateParameter |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API NonTypeTemplateParameter : public TemplateParameter |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
NonTypeTemplateParameter(); |
|
|
|
|
NonTypeTemplateParameter(const NonTypeTemplateParameter&); |
|
|
|
|
~NonTypeTemplateParameter(); |
|
|
|
@ -668,172 +667,169 @@ namespace AST {
@@ -668,172 +667,169 @@ namespace AST {
|
|
|
|
|
bool isPackExpansion; |
|
|
|
|
bool isExpandedParameterPack; |
|
|
|
|
QualifiedType type; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class ClassTemplateSpecialization; |
|
|
|
|
class ClassTemplatePartialSpecialization; |
|
|
|
|
class ClassTemplateSpecialization; |
|
|
|
|
class ClassTemplatePartialSpecialization; |
|
|
|
|
|
|
|
|
|
class CS_API ClassTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API ClassTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
ClassTemplate(); |
|
|
|
|
~ClassTemplate(); |
|
|
|
|
VECTOR(ClassTemplateSpecialization*, Specializations) |
|
|
|
|
ClassTemplateSpecialization* FindSpecialization(const std::string& usr); |
|
|
|
|
ClassTemplatePartialSpecialization* FindPartialSpecialization(const std::string& usr); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class TemplateSpecializationKind |
|
|
|
|
{ |
|
|
|
|
enum class TemplateSpecializationKind |
|
|
|
|
{ |
|
|
|
|
Undeclared, |
|
|
|
|
ImplicitInstantiation, |
|
|
|
|
ExplicitSpecialization, |
|
|
|
|
ExplicitInstantiationDeclaration, |
|
|
|
|
ExplicitInstantiationDefinition |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API ClassTemplateSpecialization : public Class |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API ClassTemplateSpecialization : public Class |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
ClassTemplateSpecialization(); |
|
|
|
|
~ClassTemplateSpecialization(); |
|
|
|
|
ClassTemplate* templatedDecl; |
|
|
|
|
VECTOR(TemplateArgument, Arguments) |
|
|
|
|
TemplateSpecializationKind specializationKind; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API ClassTemplatePartialSpecialization : public ClassTemplateSpecialization |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API ClassTemplatePartialSpecialization : public ClassTemplateSpecialization |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
ClassTemplatePartialSpecialization(); |
|
|
|
|
~ClassTemplatePartialSpecialization(); |
|
|
|
|
VECTOR(Declaration*, Parameters) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API FunctionTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API FunctionTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
FunctionTemplate(); |
|
|
|
|
~FunctionTemplate(); |
|
|
|
|
VECTOR(FunctionTemplateSpecialization*, Specializations) |
|
|
|
|
FunctionTemplateSpecialization* FindSpecialization(const std::string& usr); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API FunctionTemplateSpecialization |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API FunctionTemplateSpecialization |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
FunctionTemplateSpecialization(); |
|
|
|
|
~FunctionTemplateSpecialization(); |
|
|
|
|
FunctionTemplate* _template; |
|
|
|
|
VECTOR(TemplateArgument, Arguments) |
|
|
|
|
Function* specializedFunction; |
|
|
|
|
TemplateSpecializationKind specializationKind; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class VarTemplateSpecialization; |
|
|
|
|
class VarTemplatePartialSpecialization; |
|
|
|
|
class VarTemplateSpecialization; |
|
|
|
|
class VarTemplatePartialSpecialization; |
|
|
|
|
|
|
|
|
|
class CS_API VarTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API VarTemplate : public Template |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
VarTemplate(); |
|
|
|
|
~VarTemplate(); |
|
|
|
|
VECTOR(VarTemplateSpecialization*, Specializations) |
|
|
|
|
VarTemplateSpecialization* FindSpecialization(const std::string& usr); |
|
|
|
|
VarTemplatePartialSpecialization* FindPartialSpecialization(const std::string& usr); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API VarTemplateSpecialization : public Variable |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API VarTemplateSpecialization : public Variable |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
VarTemplateSpecialization(); |
|
|
|
|
~VarTemplateSpecialization(); |
|
|
|
|
VarTemplate* templatedDecl; |
|
|
|
|
VECTOR(TemplateArgument, Arguments) |
|
|
|
|
TemplateSpecializationKind specializationKind; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API VarTemplatePartialSpecialization : public VarTemplateSpecialization |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API VarTemplatePartialSpecialization : public VarTemplateSpecialization |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
VarTemplatePartialSpecialization(); |
|
|
|
|
~VarTemplatePartialSpecialization(); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API UnresolvedUsingTypename : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API UnresolvedUsingTypename : public Declaration |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
UnresolvedUsingTypename(); |
|
|
|
|
~UnresolvedUsingTypename(); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API Namespace : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API Namespace : public DeclarationContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
Namespace(); |
|
|
|
|
~Namespace(); |
|
|
|
|
bool isInline; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum class MacroLocation |
|
|
|
|
{ |
|
|
|
|
enum class MacroLocation |
|
|
|
|
{ |
|
|
|
|
Unknown, |
|
|
|
|
ClassHead, |
|
|
|
|
ClassBody, |
|
|
|
|
FunctionHead, |
|
|
|
|
FunctionParameters, |
|
|
|
|
FunctionBody, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API PreprocessedEntity |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API PreprocessedEntity |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
PreprocessedEntity(); |
|
|
|
|
MacroLocation macroLocation; |
|
|
|
|
void* originalPtr; |
|
|
|
|
DeclarationKind kind; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API MacroDefinition : public PreprocessedEntity |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API MacroDefinition : public PreprocessedEntity |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
MacroDefinition(); |
|
|
|
|
~MacroDefinition(); |
|
|
|
|
std::string name; |
|
|
|
|
std::string expression; |
|
|
|
|
int lineNumberStart; |
|
|
|
|
int lineNumberEnd; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API MacroExpansion : public PreprocessedEntity |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API MacroExpansion : public PreprocessedEntity |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
MacroExpansion(); |
|
|
|
|
~MacroExpansion(); |
|
|
|
|
std::string name; |
|
|
|
|
std::string text; |
|
|
|
|
MacroDefinition* definition; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API TranslationUnit : public Namespace |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API TranslationUnit : public Namespace |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
TranslationUnit(); |
|
|
|
|
~TranslationUnit(); |
|
|
|
|
|
|
|
|
|
std::string fileName; |
|
|
|
|
bool isSystemHeader; |
|
|
|
|
VECTOR(MacroDefinition*, Macros) |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class CS_API ASTContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
class CS_API ASTContext |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
ASTContext(); |
|
|
|
|
~ASTContext(); |
|
|
|
|
TranslationUnit* FindOrCreateModule(const std::string& File); |
|
|
|
|
VECTOR(TranslationUnit*, TranslationUnits) |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} // namespace CppSharp::CppParser::AST
|