@ -12,12 +12,14 @@
@@ -12,12 +12,14 @@
# include <llvm/Support/Path.h>
// copy from widenPath ('llvm/lib/Support/Windows/Path.inc')
static std : : string normalizePath ( const std : : string & File ) {
static std : : string normalizePath ( const std : : string & File )
{
llvm : : SmallString < 2 * 128 > Result ;
for ( llvm : : sys : : path : : const_iterator I = llvm : : sys : : path : : begin ( File ) ,
E = llvm : : sys : : path : : end ( File ) ;
I ! = E ; + + I ) {
I ! = E ; + + I )
{
if ( I - > size ( ) = = 1 & & * I = = " . " )
continue ;
if ( I - > size ( ) = = 2 & & * I = = " .. " )
@ -35,15 +37,18 @@ static std::string normalizePath(const std::string & File) {
@@ -35,15 +37,18 @@ static std::string normalizePath(const std::string & File) {
}
template < typename T >
static std : : vector < T > split ( const T & str , const T & delimiters ) {
static std : : vector < T > split ( const T & str , const T & delimiters )
{
std : : vector < T > v ;
if ( str . length ( ) = = 0 ) {
if ( str . length ( ) = = 0 )
{
v . push_back ( str ) ;
return v ;
}
typename T : : size_type start = 0 ;
auto pos = str . find_first_of ( delimiters , start ) ;
while ( pos ! = T : : npos ) {
while ( pos ! = T : : npos )
{
if ( pos ! = start ) // ignore empty tokens
v . emplace_back ( str , start , pos - start ) ;
start = pos + 1 ;
@ -80,14 +85,32 @@ static void deleteExpression(ExpressionObsolete* expression)
@@ -80,14 +85,32 @@ static void deleteExpression(ExpressionObsolete* expression)
}
}
Type : : Type ( TypeKind kind ) : kind ( kind ) { }
Type : : Type ( const Type & rhs ) : kind ( rhs . kind ) , isDependent ( rhs . isDependent ) { }
Type : : Type ( TypeKind kind )
: kind ( kind )
{
}
Type : : Type ( const Type & rhs )
: kind ( rhs . kind )
, isDependent ( rhs . isDependent )
{
}
QualifiedType : : QualifiedType ( ) : type ( 0 ) { }
QualifiedType : : QualifiedType ( )
: type ( 0 )
{
}
TagType : : TagType ( ) : Type ( TypeKind : : Tag ) { }
TagType : : TagType ( )
: Type ( TypeKind : : Tag )
{
}
ArrayType : : ArrayType ( ) : Type ( TypeKind : : Array ) , size ( 0 ) , elementSize ( 0 ) { }
ArrayType : : ArrayType ( )
: Type ( TypeKind : : Array )
, size ( 0 )
, elementSize ( 0 )
{
}
FunctionType : : FunctionType ( )
: Type ( TypeKind : : Function )
@ -100,15 +123,31 @@ FunctionType::~FunctionType() {}
@@ -100,15 +123,31 @@ FunctionType::~FunctionType() {}
DEF_VECTOR ( FunctionType , Parameter * , Parameters )
PointerType : : PointerType ( ) : Type ( TypeKind : : Pointer ) { }
PointerType : : PointerType ( )
: Type ( TypeKind : : Pointer )
{
}
MemberPointerType : : MemberPointerType ( ) : Type ( TypeKind : : MemberPointer ) { }
MemberPointerType : : MemberPointerType ( )
: Type ( TypeKind : : MemberPointer )
{
}
TypedefType : : TypedefType ( ) : Type ( TypeKind : : Typedef ) , declaration ( 0 ) { }
TypedefType : : TypedefType ( )
: Type ( TypeKind : : Typedef )
, declaration ( 0 )
{
}
AttributedType : : AttributedType ( ) : Type ( TypeKind : : Attributed ) { }
AttributedType : : AttributedType ( )
: Type ( TypeKind : : Attributed )
{
}
DecayedType : : DecayedType ( ) : Type ( TypeKind : : Decayed ) { }
DecayedType : : DecayedType ( )
: Type ( TypeKind : : Decayed )
{
}
// Template
TemplateParameter : : TemplateParameter ( DeclarationKind kind )
@ -173,36 +212,61 @@ NonTypeTemplateParameter::~NonTypeTemplateParameter()
@@ -173,36 +212,61 @@ NonTypeTemplateParameter::~NonTypeTemplateParameter()
deleteExpression ( defaultArgument ) ;
}
TemplateArgument : : TemplateArgument ( ) : declaration ( 0 ) , integral ( 0 ) { }
TemplateArgument : : TemplateArgument ( )
: declaration ( 0 )
, integral ( 0 )
{
}
TemplateSpecializationType : : TemplateSpecializationType ( )
: Type ( TypeKind : : TemplateSpecialization ) , _template ( 0 ) { }
: Type ( TypeKind : : TemplateSpecialization )
, _template ( 0 )
{
}
TemplateSpecializationType : : TemplateSpecializationType (
const TemplateSpecializationType & rhs ) : Type ( rhs ) ,
Arguments ( rhs . Arguments ) , _template ( rhs . _template ) , desugared ( rhs . desugared ) { }
const TemplateSpecializationType & rhs )
: Type ( rhs )
, Arguments ( rhs . Arguments )
, _template ( rhs . _template )
, desugared ( rhs . desugared )
{
}
TemplateSpecializationType : : ~ TemplateSpecializationType ( ) { }
DEF_VECTOR ( TemplateSpecializationType , TemplateArgument , Arguments )
DependentTemplateSpecializationType : : DependentTemplateSpecializationType ( )
: Type ( TypeKind : : DependentTemplateSpecialization ) { }
: Type ( TypeKind : : DependentTemplateSpecialization )
{
}
DependentTemplateSpecializationType : : DependentTemplateSpecializationType (
const DependentTemplateSpecializationType & rhs ) : Type ( rhs ) ,
Arguments ( rhs . Arguments ) , desugared ( rhs . desugared ) { }
const DependentTemplateSpecializationType & rhs )
: Type ( rhs )
, Arguments ( rhs . Arguments )
, desugared ( rhs . desugared )
{
}
DependentTemplateSpecializationType : : ~ DependentTemplateSpecializationType ( ) { }
DEF_VECTOR ( DependentTemplateSpecializationType , TemplateArgument , Arguments )
TemplateParameterType : : TemplateParameterType ( ) : Type ( TypeKind : : TemplateParameter ) , parameter ( 0 ) { }
TemplateParameterType : : TemplateParameterType ( )
: Type ( TypeKind : : TemplateParameter )
, parameter ( 0 )
{
}
TemplateParameterType : : ~ TemplateParameterType ( ) { }
TemplateParameterSubstitutionType : : TemplateParameterSubstitutionType ( )
: Type ( TypeKind : : TemplateParameterSubstitution ) , replacedParameter ( 0 ) { }
: Type ( TypeKind : : TemplateParameterSubstitution )
, replacedParameter ( 0 )
{
}
InjectedClassNameType : : InjectedClassNameType ( )
: Type ( TypeKind : : InjectedClassName )
@ -210,35 +274,74 @@ InjectedClassNameType::InjectedClassNameType()
@@ -210,35 +274,74 @@ InjectedClassNameType::InjectedClassNameType()
{
}
DependentNameType : : DependentNameType ( ) : Type ( TypeKind : : DependentName ) { }
DependentNameType : : DependentNameType ( )
: Type ( TypeKind : : DependentName )
{
}
DependentNameType : : ~ DependentNameType ( ) { }
PackExpansionType : : PackExpansionType ( ) : Type ( TypeKind : : PackExpansion ) { }
PackExpansionType : : PackExpansionType ( )
: Type ( TypeKind : : PackExpansion )
{
}
UnaryTransformType : : UnaryTransformType ( ) : Type ( TypeKind : : UnaryTransform ) { }
UnaryTransformType : : UnaryTransformType ( )
: Type ( TypeKind : : UnaryTransform )
{
}
UnresolvedUsingType : : UnresolvedUsingType ( ) : Type ( TypeKind : : UnresolvedUsing ) { }
UnresolvedUsingType : : UnresolvedUsingType ( )
: Type ( TypeKind : : UnresolvedUsing )
{
}
VectorType : : VectorType ( ) : Type ( TypeKind : : Vector ) , numElements ( 0 ) { }
VectorType : : VectorType ( )
: Type ( TypeKind : : Vector )
, numElements ( 0 )
{
}
BuiltinType : : BuiltinType ( ) : CppSharp : : CppParser : : AST : : Type ( TypeKind : : Builtin ) { }
BuiltinType : : BuiltinType ( )
: CppSharp : : CppParser : : AST : : Type ( TypeKind : : Builtin )
{
}
VTableComponent : : VTableComponent ( ) : offset ( 0 ) , declaration ( 0 ) { }
VTableComponent : : VTableComponent ( )
: offset ( 0 )
, declaration ( 0 )
{
}
// VTableLayout
VTableLayout : : VTableLayout ( ) { }
VTableLayout : : VTableLayout ( const VTableLayout & rhs ) : Components ( rhs . Components ) { }
VTableLayout : : VTableLayout ( const VTableLayout & rhs )
: Components ( rhs . Components )
{
}
VTableLayout : : ~ VTableLayout ( ) { }
DEF_VECTOR ( VTableLayout , VTableComponent , Components )
VFTableInfo : : VFTableInfo ( ) : VBTableIndex ( 0 ) , VFPtrOffset ( 0 ) , VFPtrFullOffset ( 0 ) { }
VFTableInfo : : VFTableInfo ( const VFTableInfo & rhs ) : VBTableIndex ( rhs . VBTableIndex ) ,
VFPtrOffset ( rhs . VFPtrOffset ) , VFPtrFullOffset ( rhs . VFPtrFullOffset ) ,
layout ( rhs . layout ) { }
VFTableInfo : : VFTableInfo ( )
: VBTableIndex ( 0 )
, VFPtrOffset ( 0 )
, VFPtrFullOffset ( 0 )
{
}
VFTableInfo : : VFTableInfo ( const VFTableInfo & rhs )
: VBTableIndex ( rhs . VBTableIndex )
, VFPtrOffset ( rhs . VFPtrOffset )
, VFPtrFullOffset ( rhs . VFPtrFullOffset )
, layout ( rhs . layout )
{
}
LayoutField : : LayoutField ( ) : offset ( 0 ) , fieldPtr ( 0 ) { }
LayoutField : : LayoutField ( )
: offset ( 0 )
, fieldPtr ( 0 )
{
}
LayoutField : : LayoutField ( const LayoutField & other )
: offset ( other . offset )
@ -250,14 +353,30 @@ LayoutField::LayoutField(const LayoutField & other)
@@ -250,14 +353,30 @@ LayoutField::LayoutField(const LayoutField & other)
LayoutField : : ~ LayoutField ( ) { }
LayoutBase : : LayoutBase ( ) : offset ( 0 ) , _class ( 0 ) { }
LayoutBase : : LayoutBase ( )
: offset ( 0 )
, _class ( 0 )
{
}
LayoutBase : : LayoutBase ( const LayoutBase & other ) : offset ( other . offset ) , _class ( other . _class ) { }
LayoutBase : : LayoutBase ( const LayoutBase & other )
: offset ( other . offset )
, _class ( other . _class )
{
}
LayoutBase : : ~ LayoutBase ( ) { }
ClassLayout : : ClassLayout ( ) : ABI ( CppAbi : : Itanium ) , argABI ( RecordArgABI : : Default ) ,
hasOwnVFPtr ( false ) , VBPtrOffset ( 0 ) , alignment ( 0 ) , size ( 0 ) , dataSize ( 0 ) { }
ClassLayout : : ClassLayout ( )
: ABI ( CppAbi : : Itanium )
, argABI ( RecordArgABI : : Default )
, hasOwnVFPtr ( false )
, VBPtrOffset ( 0 )
, alignment ( 0 )
, size ( 0 )
, dataSize ( 0 )
{
}
DEF_VECTOR ( ClassLayout , VFTableInfo , VFTables )
@ -318,7 +437,8 @@ DEF_VECTOR(Declaration, Declaration*, Redeclarations)
@@ -318,7 +437,8 @@ DEF_VECTOR(Declaration, Declaration*, Redeclarations)
DeclarationContext : : DeclarationContext ( DeclarationKind kind )
: Declaration ( kind )
, isAnonymous ( false )
{ }
{
}
DEF_VECTOR ( DeclarationContext , Namespace * , Namespaces )
DEF_VECTOR ( DeclarationContext , Enumeration * , Enums )
@ -352,7 +472,8 @@ DeclarationContext::FindNamespace(const std::vector<std::string>& Namespaces)
@@ -352,7 +472,8 @@ DeclarationContext::FindNamespace(const std::vector<std::string>& Namespaces)
auto childNamespace = std : : find_if ( currentNamespace - > Namespaces . begin ( ) ,
currentNamespace - > Namespaces . end ( ) ,
[ & ] ( CppSharp : : CppParser : : AST : : Namespace * ns ) {
[ & ] ( CppSharp : : CppParser : : AST : : Namespace * ns )
{
return ns - > name = = _namespace ;
} ) ;
@ -382,18 +503,22 @@ Namespace* DeclarationContext::FindCreateNamespace(const std::string& Name)
@@ -382,18 +503,22 @@ Namespace* DeclarationContext::FindCreateNamespace(const std::string& Name)
}
Class * DeclarationContext : : FindClass ( const void * OriginalPtr ,
const std : : string & Name , bool IsComplete )
const std : : string & Name ,
bool IsComplete )
{
if ( Name . empty ( ) ) return nullptr ;
if ( Name . empty ( ) )
return nullptr ;
auto entries = split < std : : string > ( Name , " :: " ) ;
if ( entries . size ( ) = = 1 )
{
auto _class = std : : find_if ( Classes . begin ( ) , Classes . end ( ) ,
[ OriginalPtr , Name , IsComplete ] ( Class * klass ) {
[ OriginalPtr , Name , IsComplete ] ( Class * klass )
{
return ( OriginalPtr & & klass - > originalPtr = = OriginalPtr ) | |
( klass - > name = = Name & & klass - > isIncomplete = = ! IsComplete ) ; } ) ;
( klass - > name = = Name & & klass - > isIncomplete = = ! IsComplete ) ;
} ) ;
return _class ! = Classes . end ( ) ? * _class : nullptr ;
}
@ -421,7 +546,9 @@ Class* DeclarationContext::CreateClass(const std::string& Name, bool IsComplete)
@@ -421,7 +546,9 @@ Class* DeclarationContext::CreateClass(const std::string& Name, bool IsComplete)
}
Class * DeclarationContext : : FindClass ( const void * OriginalPtr ,
const std : : string & Name , bool IsComplete , bool Create )
const std : : string & Name ,
bool IsComplete ,
bool Create )
{
auto _class = FindClass ( OriginalPtr , Name , IsComplete ) ;
@ -442,7 +569,10 @@ Class* DeclarationContext::FindClass(const void* OriginalPtr,
@@ -442,7 +569,10 @@ Class* DeclarationContext::FindClass(const void* OriginalPtr,
Enumeration * DeclarationContext : : FindEnum ( const void * OriginalPtr )
{
auto foundEnum = std : : find_if ( Enums . begin ( ) , Enums . end ( ) ,
[ & ] ( Enumeration * enumeration ) { return enumeration - > originalPtr = = OriginalPtr ; } ) ;
[ & ] ( Enumeration * enumeration )
{
return enumeration - > originalPtr = = OriginalPtr ;
} ) ;
if ( foundEnum ! = Enums . end ( ) )
return * foundEnum ;
@ -457,7 +587,10 @@ Enumeration* DeclarationContext::FindEnum(const std::string& Name, bool Create)
@@ -457,7 +587,10 @@ Enumeration* DeclarationContext::FindEnum(const std::string& Name, bool Create)
if ( entries . size ( ) = = 1 )
{
auto foundEnum = std : : find_if ( Enums . begin ( ) , Enums . end ( ) ,
[ & ] ( Enumeration * _enum ) { return _enum - > name = = Name ; } ) ;
[ & ] ( Enumeration * _enum )
{
return _enum - > name = = Name ;
} ) ;
if ( foundEnum ! = Enums . end ( ) )
return * foundEnum ;
@ -487,7 +620,10 @@ Enumeration* DeclarationContext::FindEnum(const std::string& Name, bool Create)
@@ -487,7 +620,10 @@ Enumeration* DeclarationContext::FindEnum(const std::string& Name, bool Create)
Enumeration * DeclarationContext : : FindEnumWithItem ( const std : : string & Name )
{
auto foundEnumIt = std : : find_if ( Enums . begin ( ) , Enums . end ( ) ,
[ & ] ( Enumeration * _enum ) { return _enum - > FindItemByName ( Name ) ! = nullptr ; } ) ;
[ & ] ( Enumeration * _enum )
{
return _enum - > FindItemByName ( Name ) ! = nullptr ;
} ) ;
if ( foundEnumIt ! = Enums . end ( ) )
return * foundEnumIt ;
for ( auto it = Namespaces . begin ( ) ; it ! = Namespaces . end ( ) ; + + it )
@ -508,13 +644,19 @@ Enumeration* DeclarationContext::FindEnumWithItem(const std::string& Name)
@@ -508,13 +644,19 @@ Enumeration* DeclarationContext::FindEnumWithItem(const std::string& Name)
Function * DeclarationContext : : FindFunction ( const std : : string & USR )
{
auto foundFunction = std : : find_if ( Functions . begin ( ) , Functions . end ( ) ,
[ & ] ( Function * func ) { return func - > USR = = USR ; } ) ;
[ & ] ( Function * func )
{
return func - > USR = = USR ;
} ) ;
if ( foundFunction ! = Functions . end ( ) )
return * foundFunction ;
auto foundTemplate = std : : find_if ( Templates . begin ( ) , Templates . end ( ) ,
[ & ] ( Template * t ) { return t - > TemplatedDecl & & t - > TemplatedDecl - > USR = = USR ; } ) ;
[ & ] ( Template * t )
{
return t - > TemplatedDecl & & t - > TemplatedDecl - > USR = = USR ;
} ) ;
if ( foundTemplate ! = Templates . end ( ) )
return static_cast < Function * > ( ( * foundTemplate ) - > TemplatedDecl ) ;
@ -525,7 +667,10 @@ Function* DeclarationContext::FindFunction(const std::string& USR)
@@ -525,7 +667,10 @@ Function* DeclarationContext::FindFunction(const std::string& USR)
TypedefDecl * DeclarationContext : : FindTypedef ( const std : : string & Name , bool Create )
{
auto foundTypedef = std : : find_if ( Typedefs . begin ( ) , Typedefs . end ( ) ,
[ & ] ( TypedefDecl * tdef ) { return tdef - > name = = Name ; } ) ;
[ & ] ( TypedefDecl * tdef )
{
return tdef - > name = = Name ;
} ) ;
if ( foundTypedef ! = Typedefs . end ( ) )
return * foundTypedef ;
@ -543,7 +688,10 @@ TypedefDecl* DeclarationContext::FindTypedef(const std::string& Name, bool Creat
@@ -543,7 +688,10 @@ TypedefDecl* DeclarationContext::FindTypedef(const std::string& Name, bool Creat
TypeAlias * DeclarationContext : : FindTypeAlias ( const std : : string & Name , bool Create )
{
auto foundTypeAlias = std : : find_if ( TypeAliases . begin ( ) , TypeAliases . end ( ) ,
[ & ] ( TypeAlias * talias ) { return talias - > name = = Name ; } ) ;
[ & ] ( TypeAlias * talias )
{
return talias - > name = = Name ;
} ) ;
if ( foundTypeAlias ! = TypeAliases . end ( ) )
return * foundTypeAlias ;
@ -561,7 +709,10 @@ TypeAlias* DeclarationContext::FindTypeAlias(const std::string& Name, bool Creat
@@ -561,7 +709,10 @@ TypeAlias* DeclarationContext::FindTypeAlias(const std::string& Name, bool Creat
Variable * DeclarationContext : : FindVariable ( const std : : string & USR )
{
auto found = std : : find_if ( Variables . begin ( ) , Variables . end ( ) ,
[ & ] ( Variable * var ) { return var - > USR = = USR ; } ) ;
[ & ] ( Variable * var )
{
return var - > USR = = USR ;
} ) ;
if ( found ! = Variables . end ( ) )
return * found ;
@ -572,7 +723,10 @@ Variable* DeclarationContext::FindVariable(const std::string& USR)
@@ -572,7 +723,10 @@ Variable* DeclarationContext::FindVariable(const std::string& USR)
Friend * DeclarationContext : : FindFriend ( const std : : string & USR )
{
auto found = std : : find_if ( Friends . begin ( ) , Friends . end ( ) ,
[ & ] ( Friend * var ) { return var - > USR = = USR ; } ) ;
[ & ] ( Friend * var )
{
return var - > USR = = USR ;
} ) ;
if ( found ! = Friends . end ( ) )
return * found ;
@ -580,29 +734,55 @@ Friend* DeclarationContext::FindFriend(const std::string& USR)
@@ -580,29 +734,55 @@ Friend* DeclarationContext::FindFriend(const std::string& USR)
return nullptr ;
}
TypedefNameDecl : : TypedefNameDecl ( DeclarationKind Kind ) : Declaration ( Kind ) { }
TypedefNameDecl : : TypedefNameDecl ( DeclarationKind Kind )
: Declaration ( Kind )
{
}
TypedefNameDecl : : ~ TypedefNameDecl ( ) { }
TypedefDecl : : TypedefDecl ( ) : TypedefNameDecl ( DeclarationKind : : Typedef ) { }
TypedefDecl : : TypedefDecl ( )
: TypedefNameDecl ( DeclarationKind : : Typedef )
{
}
TypedefDecl : : ~ TypedefDecl ( ) { }
TypeAlias : : TypeAlias ( ) : TypedefNameDecl ( DeclarationKind : : TypeAlias ) , describedAliasTemplate ( 0 ) { }
TypeAlias : : TypeAlias ( )
: TypedefNameDecl ( DeclarationKind : : TypeAlias )
, describedAliasTemplate ( 0 )
{
}
TypeAlias : : ~ TypeAlias ( ) { }
Friend : : Friend ( ) : CppSharp : : CppParser : : AST : : Declaration ( DeclarationKind : : Friend ) , declaration ( 0 ) { }
Friend : : Friend ( )
: CppSharp : : CppParser : : AST : : Declaration ( DeclarationKind : : Friend )
, declaration ( 0 )
{
}
Friend : : ~ Friend ( ) { }
StatementObsolete : : StatementObsolete ( const std : : string & str , StatementClassObsolete stmtClass , Declaration * decl ) : string ( str ) , _class ( stmtClass ) , decl ( decl ) { }
StatementObsolete : : StatementObsolete ( const std : : string & str , StatementClassObsolete stmtClass , Declaration * decl )
: string ( str )
, _class ( stmtClass )
, decl ( decl )
{
}
ExpressionObsolete : : ExpressionObsolete ( const std : : string & str , StatementClassObsolete stmtClass , Declaration * decl )
: StatementObsolete ( str , stmtClass , decl ) { }
: StatementObsolete ( str , stmtClass , decl )
{
}
BinaryOperatorObsolete : : BinaryOperatorObsolete ( const std : : string & str , ExpressionObsolete * lhs , ExpressionObsolete * rhs , const std : : string & opcodeStr )
: ExpressionObsolete ( str , StatementClassObsolete : : BinaryOperator ) , LHS ( lhs ) , RHS ( rhs ) , opcodeStr ( opcodeStr ) { }
: ExpressionObsolete ( str , StatementClassObsolete : : BinaryOperator )
, LHS ( lhs )
, RHS ( rhs )
, opcodeStr ( opcodeStr )
{
}
BinaryOperatorObsolete : : ~ BinaryOperatorObsolete ( )
{
@ -612,7 +792,9 @@ BinaryOperatorObsolete::~BinaryOperatorObsolete()
@@ -612,7 +792,9 @@ BinaryOperatorObsolete::~BinaryOperatorObsolete()
CallExprObsolete : : CallExprObsolete ( const std : : string & str , Declaration * decl )
: ExpressionObsolete ( str , StatementClassObsolete : : CallExprClass , decl ) { }
: ExpressionObsolete ( str , StatementClassObsolete : : CallExprClass , decl )
{
}
CallExprObsolete : : ~ CallExprObsolete ( )
{
@ -623,7 +805,9 @@ CallExprObsolete::~CallExprObsolete()
@@ -623,7 +805,9 @@ CallExprObsolete::~CallExprObsolete()
DEF_VECTOR ( CallExprObsolete , ExpressionObsolete * , Arguments )
CXXConstructExprObsolete : : CXXConstructExprObsolete ( const std : : string & str , Declaration * decl )
: ExpressionObsolete ( str , StatementClassObsolete : : CXXConstructExprClass , decl ) { }
: ExpressionObsolete ( str , StatementClassObsolete : : CXXConstructExprClass , decl )
{
}
CXXConstructExprObsolete : : ~ CXXConstructExprObsolete ( )
{
@ -689,43 +873,73 @@ DEF_VECTOR(Method, Method*, OverriddenMethods)
@@ -689,43 +873,73 @@ DEF_VECTOR(Method, Method*, OverriddenMethods)
// Enumeration
Enumeration : : Enumeration ( ) : DeclarationContext ( DeclarationKind : : Enumeration ) ,
modifiers ( ( EnumModifiers ) 0 ) , type ( 0 ) , builtinType ( 0 ) { }
Enumeration : : Enumeration ( )
: DeclarationContext ( DeclarationKind : : Enumeration )
, modifiers ( ( EnumModifiers ) 0 )
, type ( 0 )
, builtinType ( 0 )
{
}
Enumeration : : ~ Enumeration ( ) { }
DEF_VECTOR ( Enumeration , Enumeration : : Item * , Items )
Enumeration : : Item : : Item ( ) : Declaration ( DeclarationKind : : EnumerationItem ) { }
Enumeration : : Item : : Item ( )
: Declaration ( DeclarationKind : : EnumerationItem )
{
}
Enumeration : : Item : : Item ( const Item & rhs ) : Declaration ( rhs ) ,
expression ( rhs . expression ) , value ( rhs . value ) { }
Enumeration : : Item : : Item ( const Item & rhs )
: Declaration ( rhs )
, expression ( rhs . expression )
, value ( rhs . value )
{
}
Enumeration : : Item : : ~ Item ( ) { }
Enumeration : : Item * Enumeration : : FindItemByName ( const std : : string & Name )
{
auto foundEnumItem = std : : find_if ( Items . begin ( ) , Items . end ( ) ,
[ & ] ( Item * _item ) { return _item - > name = = Name ; } ) ;
[ & ] ( Item * _item )
{
return _item - > name = = Name ;
} ) ;
if ( foundEnumItem ! = Items . end ( ) )
return * foundEnumItem ;
return nullptr ;
}
Variable : : Variable ( ) : Declaration ( DeclarationKind : : Variable ) ,
isConstExpr ( false ) , initializer ( 0 ) { }
Variable : : Variable ( )
: Declaration ( DeclarationKind : : Variable )
, isConstExpr ( false )
, initializer ( 0 )
{
}
Variable : : ~ Variable ( ) { }
BaseClassSpecifier : : BaseClassSpecifier ( ) : type ( 0 ) , offset ( 0 ) { }
BaseClassSpecifier : : BaseClassSpecifier ( )
: type ( 0 )
, offset ( 0 )
{
}
Field : : Field ( ) : Declaration ( DeclarationKind : : Field ) , _class ( 0 ) ,
isBitField ( false ) , bitWidth ( 0 ) { }
Field : : Field ( )
: Declaration ( DeclarationKind : : Field )
, _class ( 0 )
, isBitField ( false )
, bitWidth ( 0 )
{
}
Field : : ~ Field ( ) { }
AccessSpecifierDecl : : AccessSpecifierDecl ( )
: Declaration ( DeclarationKind : : AccessSpecifier ) { }
: Declaration ( DeclarationKind : : AccessSpecifier )
{
}
AccessSpecifierDecl : : ~ AccessSpecifierDecl ( ) { }
@ -757,18 +971,31 @@ DEF_VECTOR(Class, Field*, Fields)
@@ -757,18 +971,31 @@ DEF_VECTOR(Class, Field*, Fields)
DEF_VECTOR ( Class , Method * , Methods )
DEF_VECTOR ( Class , AccessSpecifierDecl * , Specifiers )
Template : : Template ( ) : Declaration ( DeclarationKind : : Template ) ,
TemplatedDecl ( 0 ) { }
Template : : Template ( )
: Declaration ( DeclarationKind : : Template )
, TemplatedDecl ( 0 )
{
}
Template : : Template ( DeclarationKind kind ) : Declaration ( kind ) , TemplatedDecl ( 0 ) { }
Template : : Template ( DeclarationKind kind )
: Declaration ( kind )
, TemplatedDecl ( 0 )
{
}
DEF_VECTOR ( Template , Declaration * , Parameters )
TypeAliasTemplate : : TypeAliasTemplate ( ) : Template ( DeclarationKind : : TypeAliasTemplate ) { }
TypeAliasTemplate : : TypeAliasTemplate ( )
: Template ( DeclarationKind : : TypeAliasTemplate )
{
}
TypeAliasTemplate : : ~ TypeAliasTemplate ( ) { }
ClassTemplate : : ClassTemplate ( ) : Template ( DeclarationKind : : ClassTemplate ) { }
ClassTemplate : : ClassTemplate ( )
: Template ( DeclarationKind : : ClassTemplate )
{
}
ClassTemplate : : ~ ClassTemplate ( ) { }
@ -795,7 +1022,10 @@ ClassTemplatePartialSpecialization::~ClassTemplatePartialSpecialization() {}
@@ -795,7 +1022,10 @@ ClassTemplatePartialSpecialization::~ClassTemplatePartialSpecialization() {}
DEF_VECTOR ( ClassTemplatePartialSpecialization , Declaration * , Parameters )
FunctionTemplate : : FunctionTemplate ( ) : Template ( DeclarationKind : : FunctionTemplate ) { }
FunctionTemplate : : FunctionTemplate ( )
: Template ( DeclarationKind : : FunctionTemplate )
{
}
FunctionTemplate : : ~ FunctionTemplate ( ) { }
@ -804,7 +1034,10 @@ DEF_VECTOR(FunctionTemplate, FunctionTemplateSpecialization*, Specializations)
@@ -804,7 +1034,10 @@ DEF_VECTOR(FunctionTemplate, FunctionTemplateSpecialization*, Specializations)
FunctionTemplateSpecialization * FunctionTemplate : : FindSpecialization ( const std : : string & usr )
{
auto foundSpec = std : : find_if ( Specializations . begin ( ) , Specializations . end ( ) ,
[ & ] ( FunctionTemplateSpecialization * cts ) { return cts - > specializedFunction - > USR = = usr ; } ) ;
[ & ] ( FunctionTemplateSpecialization * cts )
{
return cts - > specializedFunction - > USR = = usr ;
} ) ;
if ( foundSpec ! = Specializations . end ( ) )
return static_cast < FunctionTemplateSpecialization * > ( * foundSpec ) ;
@ -824,7 +1057,10 @@ FunctionTemplateSpecialization::~FunctionTemplateSpecialization()
@@ -824,7 +1057,10 @@ FunctionTemplateSpecialization::~FunctionTemplateSpecialization()
DEF_VECTOR ( FunctionTemplateSpecialization , TemplateArgument , Arguments )
VarTemplate : : VarTemplate ( ) : Template ( DeclarationKind : : VarTemplate ) { }
VarTemplate : : VarTemplate ( )
: Template ( DeclarationKind : : VarTemplate )
{
}
VarTemplate : : ~ VarTemplate ( ) { }
@ -833,7 +1069,10 @@ DEF_VECTOR(VarTemplate, VarTemplateSpecialization*, Specializations)
@@ -833,7 +1069,10 @@ DEF_VECTOR(VarTemplate, VarTemplateSpecialization*, Specializations)
VarTemplateSpecialization * VarTemplate : : FindSpecialization ( const std : : string & usr )
{
auto foundSpec = std : : find_if ( Specializations . begin ( ) , Specializations . end ( ) ,
[ & ] ( VarTemplateSpecialization * cts ) { return cts - > USR = = usr ; } ) ;
[ & ] ( VarTemplateSpecialization * cts )
{
return cts - > USR = = usr ;
} ) ;
if ( foundSpec ! = Specializations . end ( ) )
return static_cast < VarTemplateSpecialization * > ( * foundSpec ) ;
@ -870,7 +1109,10 @@ VarTemplatePartialSpecialization::~VarTemplatePartialSpecialization()
@@ -870,7 +1109,10 @@ VarTemplatePartialSpecialization::~VarTemplatePartialSpecialization()
{
}
UnresolvedUsingTypename : : UnresolvedUsingTypename ( ) : Declaration ( DeclarationKind : : UnresolvedUsingTypename ) { }
UnresolvedUsingTypename : : UnresolvedUsingTypename ( )
: Declaration ( DeclarationKind : : UnresolvedUsingTypename )
{
}
UnresolvedUsingTypename : : ~ UnresolvedUsingTypename ( ) { }
@ -883,25 +1125,41 @@ Namespace::Namespace()
@@ -883,25 +1125,41 @@ Namespace::Namespace()
Namespace : : ~ Namespace ( ) { }
PreprocessedEntity : : PreprocessedEntity ( )
: macroLocation ( AST : : MacroLocation : : Unknown ) ,
originalPtr ( 0 ) , kind ( DeclarationKind : : PreprocessedEntity ) { }
: macroLocation ( AST : : MacroLocation : : Unknown )
, originalPtr ( 0 )
, kind ( DeclarationKind : : PreprocessedEntity )
{
}
MacroDefinition : : MacroDefinition ( )
: lineNumberStart ( 0 ) , lineNumberEnd ( 0 ) { kind = DeclarationKind : : MacroDefinition ; }
: lineNumberStart ( 0 )
, lineNumberEnd ( 0 )
{
kind = DeclarationKind : : MacroDefinition ;
}
MacroDefinition : : ~ MacroDefinition ( ) { }
MacroExpansion : : MacroExpansion ( ) : definition ( 0 ) { kind = DeclarationKind : : MacroExpansion ; }
MacroExpansion : : MacroExpansion ( )
: definition ( 0 )
{
kind = DeclarationKind : : MacroExpansion ;
}
MacroExpansion : : ~ MacroExpansion ( ) { }
TranslationUnit : : TranslationUnit ( ) { kind = DeclarationKind : : TranslationUnit ; }
TranslationUnit : : TranslationUnit ( )
{
kind = DeclarationKind : : TranslationUnit ;
}
TranslationUnit : : ~ TranslationUnit ( ) { }
DEF_VECTOR ( TranslationUnit , MacroDefinition * , Macros )
NativeLibrary : : NativeLibrary ( )
: archType ( AST : : ArchType : : UnknownArch ) { }
: archType ( AST : : ArchType : : UnknownArch )
{
}
NativeLibrary : : ~ NativeLibrary ( ) { }
@ -915,7 +1173,10 @@ DEF_VECTOR(ASTContext, TranslationUnit*, TranslationUnits)
@@ -915,7 +1173,10 @@ DEF_VECTOR(ASTContext, TranslationUnit*, TranslationUnits)
ClassTemplateSpecialization * ClassTemplate : : FindSpecialization ( const std : : string & usr )
{
auto foundSpec = std : : find_if ( Specializations . begin ( ) , Specializations . end ( ) ,
[ & ] ( ClassTemplateSpecialization * cts ) { return cts - > USR = = usr ; } ) ;
[ & ] ( ClassTemplateSpecialization * cts )
{
return cts - > USR = = usr ;
} ) ;
if ( foundSpec ! = Specializations . end ( ) )
return static_cast < ClassTemplateSpecialization * > ( * foundSpec ) ;
@ -940,7 +1201,8 @@ TranslationUnit* ASTContext::FindOrCreateModule(const std::string& File)
@@ -940,7 +1201,8 @@ TranslationUnit* ASTContext::FindOrCreateModule(const std::string& File)
auto normalizedFile = normalizePath ( File ) ;
auto existingUnit = std : : find_if ( TranslationUnits . begin ( ) ,
TranslationUnits . end ( ) , [ & ] ( TranslationUnit * unit ) {
TranslationUnits . end ( ) , [ & ] ( TranslationUnit * unit )
{
return unit & & unit - > fileName = = normalizedFile ;
} ) ;
@ -955,9 +1217,15 @@ TranslationUnit* ASTContext::FindOrCreateModule(const std::string& File)
@@ -955,9 +1217,15 @@ TranslationUnit* ASTContext::FindOrCreateModule(const std::string& File)
}
// Comments
Comment : : Comment ( CommentKind kind ) : kind ( kind ) { }
Comment : : Comment ( CommentKind kind )
: kind ( kind )
{
}
RawComment : : RawComment ( ) : fullCommentBlock ( 0 ) { }
RawComment : : RawComment ( )
: fullCommentBlock ( 0 )
{
}
RawComment : : ~ RawComment ( )
{
@ -965,7 +1233,10 @@ RawComment::~RawComment()
@@ -965,7 +1233,10 @@ RawComment::~RawComment()
delete fullCommentBlock ;
}
FullComment : : FullComment ( ) : Comment ( CommentKind : : FullComment ) { }
FullComment : : FullComment ( )
: Comment ( CommentKind : : FullComment )
{
}
FullComment : : ~ FullComment ( )
{
@ -1001,19 +1272,38 @@ FullComment::~FullComment()
@@ -1001,19 +1272,38 @@ FullComment::~FullComment()
DEF_VECTOR ( FullComment , BlockContentComment * , Blocks )
BlockContentComment : : BlockContentComment ( ) : Comment ( CommentKind : : BlockContentComment ) { }
BlockContentComment : : BlockContentComment ( )
: Comment ( CommentKind : : BlockContentComment )
{
}
BlockContentComment : : BlockContentComment ( CommentKind Kind ) : Comment ( Kind ) { }
BlockContentComment : : BlockContentComment ( CommentKind Kind )
: Comment ( Kind )
{
}
BlockCommandComment : : Argument : : Argument ( ) { }
BlockCommandComment : : Argument : : Argument ( const Argument & rhs ) : text ( rhs . text ) { }
BlockCommandComment : : Argument : : Argument ( const Argument & rhs )
: text ( rhs . text )
{
}
BlockCommandComment : : Argument : : ~ Argument ( ) { }
BlockCommandComment : : BlockCommandComment ( ) : BlockContentComment ( CommentKind : : BlockCommandComment ) , commandId ( 0 ) , paragraphComment ( 0 ) { }
BlockCommandComment : : BlockCommandComment ( )
: BlockContentComment ( CommentKind : : BlockCommandComment )
, commandId ( 0 )
, paragraphComment ( 0 )
{
}
BlockCommandComment : : BlockCommandComment ( CommentKind Kind ) : BlockContentComment ( Kind ) , commandId ( 0 ) , paragraphComment ( 0 ) { }
BlockCommandComment : : BlockCommandComment ( CommentKind Kind )
: BlockContentComment ( Kind )
, commandId ( 0 )
, paragraphComment ( 0 )
{
}
BlockCommandComment : : ~ BlockCommandComment ( )
{
@ -1022,13 +1312,24 @@ BlockCommandComment::~BlockCommandComment()
@@ -1022,13 +1312,24 @@ BlockCommandComment::~BlockCommandComment()
DEF_VECTOR ( BlockCommandComment , BlockCommandComment : : Argument , Arguments )
ParamCommandComment : : ParamCommandComment ( ) : BlockCommandComment ( CommentKind : : ParamCommandComment ) , direction ( PassDirection : : In ) , paramIndex ( 0 ) { }
ParamCommandComment : : ParamCommandComment ( )
: BlockCommandComment ( CommentKind : : ParamCommandComment )
, direction ( PassDirection : : In )
, paramIndex ( 0 )
{
}
TParamCommandComment : : TParamCommandComment ( ) : BlockCommandComment ( CommentKind : : TParamCommandComment ) { }
TParamCommandComment : : TParamCommandComment ( )
: BlockCommandComment ( CommentKind : : TParamCommandComment )
{
}
DEF_VECTOR ( TParamCommandComment , unsigned , Position )
VerbatimBlockComment : : VerbatimBlockComment ( ) : BlockCommandComment ( CommentKind : : VerbatimBlockComment ) { }
VerbatimBlockComment : : VerbatimBlockComment ( )
: BlockCommandComment ( CommentKind : : VerbatimBlockComment )
{
}
VerbatimBlockComment : : ~ VerbatimBlockComment ( )
{
@ -1038,9 +1339,16 @@ VerbatimBlockComment::~VerbatimBlockComment()
@@ -1038,9 +1339,16 @@ VerbatimBlockComment::~VerbatimBlockComment()
DEF_VECTOR ( VerbatimBlockComment , VerbatimBlockLineComment * , Lines )
VerbatimLineComment : : VerbatimLineComment ( ) : BlockCommandComment ( CommentKind : : VerbatimLineComment ) { }
VerbatimLineComment : : VerbatimLineComment ( )
: BlockCommandComment ( CommentKind : : VerbatimLineComment )
{
}
ParagraphComment : : ParagraphComment ( ) : BlockContentComment ( CommentKind : : ParagraphComment ) , isWhitespace ( false ) { }
ParagraphComment : : ParagraphComment ( )
: BlockContentComment ( CommentKind : : ParagraphComment )
, isWhitespace ( false )
{
}
ParagraphComment : : ~ ParagraphComment ( )
{
@ -1073,39 +1381,76 @@ ParagraphComment::~ParagraphComment()
@@ -1073,39 +1381,76 @@ ParagraphComment::~ParagraphComment()
DEF_VECTOR ( ParagraphComment , InlineContentComment * , Content )
HTMLTagComment : : HTMLTagComment ( ) : InlineContentComment ( CommentKind : : HTMLTagComment ) { }
HTMLTagComment : : HTMLTagComment ( )
: InlineContentComment ( CommentKind : : HTMLTagComment )
{
}
HTMLTagComment : : HTMLTagComment ( CommentKind Kind ) : InlineContentComment ( Kind ) { }
HTMLTagComment : : HTMLTagComment ( CommentKind Kind )
: InlineContentComment ( Kind )
{
}
HTMLStartTagComment : : Attribute : : Attribute ( ) { }
HTMLStartTagComment : : Attribute : : Attribute ( const Attribute & rhs ) : name ( rhs . name ) , value ( rhs . value ) { }
HTMLStartTagComment : : Attribute : : Attribute ( const Attribute & rhs )
: name ( rhs . name )
, value ( rhs . value )
{
}
HTMLStartTagComment : : Attribute : : ~ Attribute ( ) { }
HTMLStartTagComment : : HTMLStartTagComment ( ) : HTMLTagComment ( CommentKind : : HTMLStartTagComment ) { }
HTMLStartTagComment : : HTMLStartTagComment ( )
: HTMLTagComment ( CommentKind : : HTMLStartTagComment )
{
}
DEF_VECTOR ( HTMLStartTagComment , HTMLStartTagComment : : Attribute , Attributes )
HTMLEndTagComment : : HTMLEndTagComment ( ) : HTMLTagComment ( CommentKind : : HTMLEndTagComment ) { }
HTMLEndTagComment : : HTMLEndTagComment ( )
: HTMLTagComment ( CommentKind : : HTMLEndTagComment )
{
}
InlineContentComment : : InlineContentComment ( ) : Comment ( CommentKind : : InlineContentComment ) , hasTrailingNewline ( false ) { }
InlineContentComment : : InlineContentComment ( )
: Comment ( CommentKind : : InlineContentComment )
, hasTrailingNewline ( false )
{
}
InlineContentComment : : InlineContentComment ( CommentKind Kind ) : Comment ( Kind ) , hasTrailingNewline ( false ) { }
InlineContentComment : : InlineContentComment ( CommentKind Kind )
: Comment ( Kind )
, hasTrailingNewline ( false )
{
}
TextComment : : TextComment ( ) : InlineContentComment ( CommentKind : : TextComment ) { }
TextComment : : TextComment ( )
: InlineContentComment ( CommentKind : : TextComment )
{
}
InlineCommandComment : : Argument : : Argument ( ) { }
InlineCommandComment : : Argument : : Argument ( const Argument & rhs ) : text ( rhs . text ) { }
InlineCommandComment : : Argument : : Argument ( const Argument & rhs )
: text ( rhs . text )
{
}
InlineCommandComment : : Argument : : ~ Argument ( ) { }
InlineCommandComment : : InlineCommandComment ( )
: InlineContentComment ( CommentKind : : InlineCommandComment ) , commandId ( 0 ) , commentRenderKind ( RenderNormal ) { }
: InlineContentComment ( CommentKind : : InlineCommandComment )
, commandId ( 0 )
, commentRenderKind ( RenderNormal )
{
}
DEF_VECTOR ( InlineCommandComment , InlineCommandComment : : Argument , Arguments )
VerbatimBlockLineComment : : VerbatimBlockLineComment ( ) : Comment ( CommentKind : : VerbatimBlockLineComment ) { }
VerbatimBlockLineComment : : VerbatimBlockLineComment ( )
: Comment ( CommentKind : : VerbatimBlockLineComment )
{
}
} } }
} } } // namespace CppSharp::CppParser::AST