Skip to content

Commit fa9993c

Browse files
bongjunjKihongHeo
authored andcommitted
[Clang] add full_expr_get_sub_expr
1 parent cb3286b commit fa9993c

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/clang.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,15 @@ and StmtExpr : (Sig.STMT_EXPR with type t = Stmt.t) = struct
542542
let pp fmt s = F.fprintf fmt "(%a)" Stmt.pp (get_sub_stmt s)
543543
end
544544

545+
(** https://clang.llvm.org/doxygen/classclang_1_1FullExpr.html *)
546+
and FullExpr : (Sig.FULL_EXPR with type t = Stmt.t) = struct
547+
include Expr
548+
549+
external get_sub_expr : t -> t = "clang_full_expr_get_sub_expr"
550+
551+
let pp fmt s = F.fprintf fmt "(%a)" Stmt.pp (get_sub_expr s)
552+
end
553+
545554
and StringLiteral : (Sig.STRING_LITERAL with type t = Stmt.t) = struct
546555
include Expr
547556

src/clang_ocaml.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ WRAPPER_PTR(clang_constant_expr_get_sub_expr, Stmt, ConstantExpr, Expr,
470470
WRAPPER_PTR(clang_stmt_expr_get_sub_stmt, Stmt, StmtExpr, CompoundStmt,
471471
getSubStmt)
472472

473+
WRAPPER_PTR(clang_full_expr_get_sub_expr, Expr, FullExpr, Expr, getSubExpr)
474+
473475
WRAPPER_INT(clang_cast_expr_get_kind, CastExpr, getCastKind)
474476

475477
WRAPPER_INT(clang_cast_expr_get_kind_enum, CastExpr, getCastKind)

src/sig.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ module type STMT_EXPR = sig
267267
val get_sub_stmt : t -> t
268268
end
269269

270+
module type FULL_EXPR = sig
271+
include EXPR
272+
273+
val get_sub_expr : t -> t
274+
end
275+
270276
module type STRING_LITERAL = sig
271277
include EXPR
272278

0 commit comments

Comments
 (0)