Skip to content

Commit

Permalink
Add support for AArch64 C++ ABI.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Feb 1, 2024
1 parent 9071cd2 commit de614b0
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/AST/ASTContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum CppAbi
Itanium,
Microsoft,
ARM,
AArch64,
iOS,
iOS64,
WebAssembly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6401,9 +6401,10 @@ public enum CppAbi
Itanium = 0,
Microsoft = 1,
ARM = 2,
iOS = 3,
iOS64 = 4,
WebAssembly = 5
AArch64 = 3,
iOS = 4,
iOS64 = 5,
WebAssembly = 6
}

public enum RecordArgABI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6401,9 +6401,10 @@ public enum CppAbi
Itanium = 0,
Microsoft = 1,
ARM = 2,
iOS = 3,
iOS64 = 4,
WebAssembly = 5
AArch64 = 3,
iOS = 4,
iOS64 = 5,
WebAssembly = 6
}

public enum RecordArgABI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6401,9 +6401,10 @@ public enum CppAbi
Itanium = 0,
Microsoft = 1,
ARM = 2,
iOS = 3,
iOS64 = 4,
WebAssembly = 5
AArch64 = 3,
iOS = 4,
iOS64 = 5,
WebAssembly = 6
}

public enum RecordArgABI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6401,9 +6401,10 @@ public enum CppAbi
Itanium = 0,
Microsoft = 1,
ARM = 2,
iOS = 3,
iOS64 = 4,
WebAssembly = 5
AArch64 = 3,
iOS = 4,
iOS64 = 5,
WebAssembly = 6
}

public enum RecordArgABI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6401,9 +6401,10 @@ public enum CppAbi
Itanium = 0,
Microsoft = 1,
ARM = 2,
iOS = 3,
iOS64 = 4,
WebAssembly = 5
AArch64 = 3,
iOS = 4,
iOS64 = 5,
WebAssembly = 6
}

public enum RecordArgABI
Expand Down
1 change: 1 addition & 0 deletions src/CppParser/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ namespace CppSharp
Itanium,
Microsoft,
ARM,
AArch64,
iOS,
iOS64,
WebAssembly
Expand Down
4 changes: 4 additions & 0 deletions src/CppParser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ static CppAbi GetClassLayoutAbi(clang::TargetCXXABI::Kind abi)
return CppAbi::Itanium;
case clang::TargetCXXABI::GenericARM:
return CppAbi::ARM;
case clang::TargetCXXABI::GenericAArch64:
return CppAbi::AArch64;
case clang::TargetCXXABI::iOS:
return CppAbi::iOS;
case clang::TargetCXXABI::AppleARM64:
Expand Down Expand Up @@ -231,6 +233,8 @@ ConvertToClangTargetCXXABI(CppSharp::CppParser::AST::CppAbi abi)
return TargetCXXABI::Microsoft;
case CppSharp::CppParser::AST::CppAbi::ARM:
return TargetCXXABI::GenericARM;
case CppSharp::CppParser::AST::CppAbi::AArch64:
return TargetCXXABI::GenericARM;
case CppSharp::CppParser::AST::CppAbi::iOS:
return TargetCXXABI::iOS;
case CppSharp::CppParser::AST::CppAbi::iOS64:
Expand Down
1 change: 1 addition & 0 deletions src/Generator/AST/VTables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static List<VTableComponent> GatherVTableMethodEntries(Class @class)
case CppAbi.Microsoft:
return GatherVTableMethodsMS(@class);
case CppAbi.Itanium:
default:
return GatherVTableMethodsItanium(@class);
}

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ASTConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,8 @@ AST.CppAbi VisitCppAbi(CppAbi abi)
return AST.CppAbi.Microsoft;
case CppAbi.ARM:
return AST.CppAbi.ARM;
case CppAbi.AArch64:
return AST.CppAbi.AArch64;
case CppAbi.iOS:
return AST.CppAbi.iOS;
case CppAbi.iOS64:
Expand Down

0 comments on commit de614b0

Please sign in to comment.