Browse Source

Explicitly define some copy constructors to work around missing symbols.

We should not need to do this, but Clang ignores the GCC flag "-fkeep-inline-functions" which we need to actually get these to be properly exported in a library...
pull/226/merge
triton 12 years ago
parent
commit
aa3e8dd5bd
  1. 14
      src/CppParser/AST.cpp
  2. 9
      src/CppParser/AST.h
  3. 15
      src/CppParser/CppParser.cpp
  4. 3
      src/CppParser/CppParser.h

14
src/CppParser/AST.cpp

@ -34,6 +34,8 @@ static std::vector<T> split(const T & str, const T & delimiters) { @@ -34,6 +34,8 @@ static std::vector<T> split(const T & str, const T & delimiters) {
namespace CppSharp { namespace CppParser { namespace AST {
Type::Type(TypeKind kind) : Kind(kind) {}
Type::Type(const Type& rhs) : Kind(rhs.Kind), IsDependent(rhs.IsDependent) {}
QualifiedType::QualifiedType() : Type(0) {}
TagType::TagType() : Type(TypeKind::Tag) {}
@ -57,9 +59,16 @@ TemplateArgument::TemplateArgument() : Declaration(0) {} @@ -57,9 +59,16 @@ TemplateArgument::TemplateArgument() : Declaration(0) {}
TemplateSpecializationType::TemplateSpecializationType()
: Type(TypeKind::TemplateSpecialization), Template(0), Desugared(0) {}
TemplateSpecializationType::TemplateSpecializationType(
const TemplateSpecializationType& rhs) : Type(rhs),
Arguments(rhs.Arguments), Template(rhs.Template), Desugared(rhs.Desugared) {}
DEF_VECTOR(TemplateSpecializationType, TemplateArgument, Arguments)
// TemplateParameter
TemplateParameter::TemplateParameter() {}
TemplateParameter::TemplateParameter(const TemplateParameter& rhs) : Name(rhs.Name) {}
DEF_STRING(TemplateParameter, Name)
TemplateParameterType::TemplateParameterType() : Type(TypeKind::TemplateParameter) {}
@ -80,9 +89,14 @@ VTableComponent::VTableComponent() : Offset(0), Declaration(0) {} @@ -80,9 +89,14 @@ VTableComponent::VTableComponent() : Offset(0), Declaration(0) {}
// VTableLayout
VTableLayout::VTableLayout() {}
VTableLayout::VTableLayout(const VTableLayout& rhs) : Components(rhs.Components) {}
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) {}
ClassLayout::ClassLayout() : ABI(CppAbi::Itanium), HasOwnVFPtr(false),
VBPtrOffset(0), Alignment(0), Size(0), DataSize(0) {}

9
src/CppParser/AST.h

@ -38,6 +38,8 @@ enum struct TypeKind @@ -38,6 +38,8 @@ enum struct TypeKind
struct CS_API Type
{
Type(TypeKind kind);
Type(const Type&);
TypeKind Kind;
bool IsDependent;
};
@ -171,6 +173,8 @@ struct Template; @@ -171,6 +173,8 @@ struct Template;
struct CS_API TemplateSpecializationType : public Type
{
TemplateSpecializationType();
TemplateSpecializationType(const TemplateSpecializationType&);
VECTOR(TemplateArgument, Arguments)
CppSharp::CppParser::AST::Template* Template;
Type* Desugared;
@ -178,6 +182,9 @@ struct CS_API TemplateSpecializationType : public Type @@ -178,6 +182,9 @@ struct CS_API TemplateSpecializationType : public Type
struct CS_API TemplateParameter
{
TemplateParameter();
TemplateParameter(const TemplateParameter&);
bool operator==(const TemplateParameter& param) const
{
return Name == param.Name;
@ -278,12 +285,14 @@ struct CS_API VTableComponent @@ -278,12 +285,14 @@ struct CS_API VTableComponent
struct CS_API VTableLayout
{
VTableLayout();
VTableLayout(const VTableLayout&);
VECTOR(VTableComponent, Components)
};
struct CS_API VFTableInfo
{
VFTableInfo();
VFTableInfo(const VFTableInfo&);
uint64_t VBTableIndex;
uint32_t VFPtrOffset;
uint32_t VFPtrFullOffset;

15
src/CppParser/CppParser.cpp

@ -35,8 +35,23 @@ ParserResult::ParserResult() @@ -35,8 +35,23 @@ ParserResult::ParserResult()
{
}
ParserResult::ParserResult(const ParserResult& rhs)
: Kind(rhs.Kind)
, Diagnostics(rhs.Diagnostics)
, ASTContext(rhs.ASTContext)
, Library(rhs.Library)
{}
ParserDiagnostic::ParserDiagnostic() {}
ParserDiagnostic::ParserDiagnostic(const ParserDiagnostic& rhs)
: FileName(rhs.FileName)
, Message(rhs.Message)
, Level(rhs.Level)
, LineNumber(rhs.LineNumber)
, ColumnNumber(rhs.ColumnNumber)
{}
DEF_STRING(ParserDiagnostic, FileName)
DEF_STRING(ParserDiagnostic, Message)

3
src/CppParser/CppParser.h

@ -54,6 +54,8 @@ enum struct ParserDiagnosticLevel @@ -54,6 +54,8 @@ enum struct ParserDiagnosticLevel
struct CS_API ParserDiagnostic
{
ParserDiagnostic();
ParserDiagnostic(const ParserDiagnostic&);
STRING(FileName)
STRING(Message)
ParserDiagnosticLevel Level;
@ -71,6 +73,7 @@ enum struct ParserResultKind @@ -71,6 +73,7 @@ enum struct ParserResultKind
struct CS_API ParserResult
{
ParserResult();
ParserResult(const ParserResult&);
ParserResultKind Kind;
VECTOR(ParserDiagnostic, Diagnostics)

Loading…
Cancel
Save