Skip to content

Instantly share code, notes, and snippets.

@migueldeicaza
Created June 16, 2015 01:53
Show Gist options
  • Save migueldeicaza/ae2a3ebf289169d413dc to your computer and use it in GitHub Desktop.
Save migueldeicaza/ae2a3ebf289169d413dc to your computer and use it in GitHub Desktop.
Add IsAbstract property
diff --git a/Clang/Ast/CXXRecordDecl.cs b/Clang/Ast/CXXRecordDecl.cs
index 6acc7b3..16f5453 100644
--- a/Clang/Ast/CXXRecordDecl.cs
+++ b/Clang/Ast/CXXRecordDecl.cs
@@ -19,6 +19,13 @@ namespace Clang.Ast
public extern bool IsDerivedFrom (CXXRecordDecl baseDecl);
[MethodImpl (MethodImplOptions.InternalCall)]
+ extern int GetAbstract ();
+
+ public bool IsAbstract {
+ get { return GetAbstract () != 0; }
+ }
+
+ [MethodImpl (MethodImplOptions.InternalCall)]
extern void GetBases (IntPtr baseCallback);
public IEnumerable<RecordType> Bases {
diff --git a/Clang/libclang-mono/ast.cpp b/Clang/libclang-mono/ast.cpp
index 274af1b..aad2154 100644
--- a/Clang/libclang-mono/ast.cpp
+++ b/Clang/libclang-mono/ast.cpp
@@ -468,7 +468,6 @@ LCM_AST_ICALL(Decl, GetAccess)(const MonoObject *decl)
{
return $<Decl> (decl)->getAccess ();
}
-
void
LCM_AST_ICALL(Decl, Dump)(const MonoObject *decl)
{
@@ -909,6 +908,12 @@ LCM_AST_ICALL(TypedefNameDecl, GetUnderlyingType)(const MonoObject *decl)
return $<TypedefNameDecl> (decl)->getUnderlyingType ();
}
+int
+LCM_AST_ICALL(CXXRecordDecl, GetAbstract)(const MonoObject *decl)
+{
+ return $<CXXRecordDecl> (decl)->isAbstract () ? 1 : 0;
+}
+
void
LCM_AST_ICALL(CXXRecordDecl, GetBases)(const MonoObject *decl,
void (*baseCallback)(const RecordType *))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment