package clangml
OCaml bindings for Clang API
Install
Dune Dependency
Authors
Maintainers
Sources
clangml.4.8.0.tar.gz
sha512=493f3693b445268a589c98315d918d0633bd2e76eba34067023d502b10957c1f6bbce3b0c1799c81e06eb3ec6f16158cbafb964228fdb3e303aa74cd57c125b1
doc/CHANGES.html
2022-09-05, 4.8.0
- Support for Clang/LLVM 15.0.0
Ast.character_kind
andAst.string_kind
are now distinct types (aliases forClang.clang_ext_characterkind
andClang.clang_ext_stringkind
respectively. The constructorOrdinary
replaced the former constructorAscii
forstring_kind
, to match the new convention used byclang::StringLiteral::StringKind
from Clang 15.0.0. The constructorAscii
forcharacter_kind
is left unchanged.- #1, #2:
Ast.Var
andAst.Function
constructors now have astorage
field in addition to the computedlinkage
, exposing the value previously accessible viacursor_get_storage_class
. The storage classes are now correctly printed by the printer. (reported by Ronan, rsaill/n47, https://github.com/thierry-martinez/clangml/issues/1) - #3, #4: fix
Clang.Expr.radix_of_integer_literal
when the literal comes from a macro expansion, and fix printing of unsigned/long integer literals withClang.Printer
. (reported by Ronan, rsaill/n47, https://github.com/thierry-martinez/clangml/issues/3)
2022-08-09, 4.7.0
- Support for Clang/LLVM 14.0.{1,2,3,4,5,6}
- Support for
ParenList
expressions (may appear in constructor initializers of templated classes). (reported by Arthur Charguéraud) - Support for
_Atomic
types and built-in expressions (reported by n47, https://discuss.ocaml.org/t/ann-clangml-4-2-0-ocaml-bindings-for-clang-api-for-c-and-c-parsing/6123/14) - Support for
typeof
type (GCC extension) (reported by n47, https://discuss.ocaml.org/t/ann-clangml-4-2-0-ocaml-bindings-for-clang-api-for-c-and-c-parsing/6123/25?u=thierry-martinez) - Support for statement expression (GCC extension)
- Fix lossing template specification in method definitions. (reported by Arthur Charguéraud)
- Add
Clang.Cursor.{Set, Map}
, fixClang.compare_cursors
- Add
Clang.Lazy.Printer
module
2022-03-22, 4.6.0
- Support for Clang/LLVM 14.0.0
- Fix bug with compound literals: when compound literals refer to a defined type, the AST was
UnknownExpr
. (reported by Arthur Charguéraud, https://gitlab.inria.fr/tmartine/clangml/-/issues/2)
2021-11-11, 4.5.0
- Support for Clang/LLVM 12.0.1 and 13.0.0.
- [compatibility break]
initializer_list
for constructors now contains items with a dedicated typeconstructor_initializer
. - Fields for anonymous struct/unions and indirect fields can now be represented in the AST by disabling
options.ignore_indirect_fields
andoptions.ignore_anonymous_fields
. (reported by Seungwan Kwon) - Fields for implicit constructors and methods can now be represented in the AST by disabling
options.ignore_implicit_constructors
andoptions.ignore_implicit_methods
. - Fields for injected class nameds can now be represented in the AST by disabling
options.ignore_injected_class_names
. - Fix segmentation fault issue when accessing
NULL
TypeInfoLoc*
in attributes
2021-02-21, 4.4.0
- Support for Clang/LLVM 11.0.1, 11.1.0 and 12.0.0.
- Support for OCaml 4.12.
- Fix integer overflow on 32-bit platforms.
2020-09-22, 4.3.0
- Port to ppxlib 0.16 / ocaml-migrate-parsetree 2.0.0
- Support for Clang/LLVM 11.0.0
- New module
Clang.Cursor
, exposing the signatureHashtbl.HashedType with type t = cxcursor
andClang.Cursor.Hashtbl
. - New function
Clang.Decl.annotate_access_specifier
, to enumerate class fields with their access specifiers. - Fix segmentation fault when parsing the redeclaration of a function decl without prototype when the previous declarations has some parameters. (reported by Kihong Heo)
- New field
has_written_prototype
infunction_decl
to distinguish between function declarations where the prototype is actually provided and declarations where the prototype is inherited.
2020-07-15, 4.2.0
- Support for Clang/LLVM 10.0.1
C/C++ AST features
- Support for all C/C++ Clang attributes (including
_Alignas
(C) andalignas
(C++) attributes, that have been requested by Damien Rouhling). See the auto-generatedbootstrap/attributes.ml
. - class base specifiers now expose a full
qual_type
instead of a mereident
string. ident_ref
now carries atemplate_arguments
parameter.function_decl
now exposesinline_specified
andinlined
fields.function_type
now exposesref_qualifier
field.TypeLoc
are used broaderly to computequal_type
: in particular, parameters in function types have now correct names. The typetype_loc
and the functionsClang.Decl.get_type_loc
andClang.Parameter.get_type_loc
are kept for compatibility, butqual_type
should contain all the informations.
API changes
Clang.Lazy
exposes a lazy AST, that is to say that eachdesc
field is a lazy value that is computed on demand. This is useful to explore large ASTs efficiently (note that Clang parsing itself can still be slow; the lazy part only concerns the conversion into theClang.Lazy.Ast
datatypes). ModulesClang.Ast
,Clang.Expr
,Clang.Stmt
,Clang.Type
, ..., have their lazy counter-parts:Clang.Lazy.Ast
,Clang.Lazy.Expr
,Clang.Lazy.Stmt
,Clang.Lazy.Type
, etc.- The common signature exposed by every AST node module (
Clang.Expr
,Clang.Stmt
, ...) now declares ahash
function and and aHashtbl
module. Clang.format_diagnostics
now prints presumed locations by default and the behavior can be changed through the optional?options
argument. The implementation now relies on the newClang.pp_diagnostic
which is an OCaml reimplementation ofclang_formatDiagnostic
from libclang.Clang.Expr.parse_string
parses strings as C expressions. (suggested by Damien Rouhling)Clangml_printer
has now moved toClang.Printer
. The packageclangml.printer
still exists for compatibility and reexposes theClang.Printer
interface.
2020-05-15, 4.1.0
- Compatible with LLVM from 3.4.2 to 10.0.0, OCaml from 4.03.0 to 4.11.0
- Typeloc structures which contains non-transformed type informations can be obtained with
Clang.Decl.get_type_loc
andClang.Parameter.get_type_loc
. In particular, typeloc structures can be obtained to get the original size expression from constant arrays. (suggested by Damien Rouhling) Clang.Expr.get_definition
andClang.Decl.get_canonical
to retrieve the cursors to the declaration site of identifiers, andClang.compare_cursors
for comparing cursors. (suggested by Arthur Charguéraud)- Fix: Constant array sizes are no longer reported as default values for parameters.
- Fix: Correct representation of integer literal from 32 to 64 bits (reported by Hyunsoo Shin)
- Relies on
metapp
,metaquot
andrefl
. All AST types arereflexive
in the sense of therefl
package.ppxlib
andoverride
are not dependencies anymore. clangml.show
andclangml.compare
packages don't exist anymore. Every AST node module (Clang.Expr
,Clang.Stmt
, ...) exposes a common signature (Clang.S) withcompare
,equal
,pp
andshow
functions, andSet
andMap
modules.- Access to semantic form for initialization lists (suggested by Hyunsoo Shin)
- Representation for designated initialization expressions (C99) (suggested by Hyunsoo Shin)
- Fix: Some distributions such as ArchLinux now gather clang libraries in
-lclang-cpp
. (reported by Armaël Guéneau) - libclang's tokenize and related functions are now accessible, new utility function
Clang.Expr.radix_of_integer_literal
. - Fix: C stub generation used to declare CAMLlocal inside for loops, causing infinite loops in the GC in some occasions. (reported by Armaël Guéneau)
2019-09-30, 4.0.1
- Support for Clang/LLVM 9.0
- Compatible with OCaml 4.09
- Better representation for input and outputs in assembler statements
- u'c' syntax is now correctly supported with Clang 3.6 and 3.7
- Support for C++ exception specification, function try block
- Better support for Gentoo
- Bug fixes
2019-07-11, 4.0.0
- C++ support: all the code examples from C++14 and C++17 norms are covered by the AST.
- AST pretty-printers, comparators and lifters are now defined in sub-libraries (clangml.show, clangml.ord, clangml.lift). Visitors are no longer derived by default (
override
PPX library can be used to derive visitors from the AST if needed.) - A very limited C/C++ pretty-printer is provided in the sub-library clangml.printer. It should be extended in next releases.
- Compatible with OCaml 4.08
- Bug fixes
- Flag dune as a build dependency (suggested by @kit-ty-kate in https://github.com/ocaml/opam-repository/pull/13434)
2019-02-11, 4.0.0beta1
- First public release
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page