emmtrix
C++ to C Compiler
(eCPP2C)
Release Notes
emmtrix LLVM Tools
Release 2022.10
emmtrix C++-to-C compiler
New language features
- Switched to C++14 language standard
- Significantly improved template compatibility
- Unions
- Anonymous unions within functions
- Enums with fixed underlying type (e.g.
enum e : int) - Scoped enums
- if/switch statements with variable and/or initializer (e.g.
if (int a = ...; int b = ...)) - User-defined literals
wchar_t,char16_tandchar32_tdata types- Lambda expressions
- Pointers to members (preliminary)
- Pointers to data members as well as the
.*and->*operators - Pointers to member functions as well as the
.*and->*operators - Derived-to-base casts of pointers to member functions is not full supported
- Variadic functions with no explicit parameters that are forbidden in C (e.g.
void func(...)) - Using-declaration in class/struct definitions
- Ref-qualified member functions (e.g.
void mf2() &) - Volatile qualified member functions (e.g.
void mf2() volatile) - Binary conditional operator (
a ?: b) sizeof...operator__underlying_typeoperator- Placement
newoperator alignofoperator- Anonymous namespaces
thread_localvariables- C++11-style attributes (e.g.
[[maybe_unused]]) - Replacing
[[noreturn]]attributes by_Noreturnkeyword - Removing
[[fallthrough]]attributes - Replacing other attributes by gcc-style attributes (e.g.
__attribute__((deprecated))) - Explicit template instantiation (e.g.
template T<int>;) - Complex list initialization of structs/classes (e.g
STRUCT s = {0, g, 1}) int{}andint{val}initialization of fundamental data types- Functional casts with braced init lists (e.g.
T{x, y}) __func__,__FUNCTION__and__PRETTY_FUNCTION__macros__builtin_FUNCTION,__builtin_FILE,__builtin_LINEand__builtin_COLUMNbuiltin functions__builtin_constant_pbuiltin function__builtin_addressofbuiltin function__builtin_operator_deleteand__builtin_operator_newbuiltin functions
Command line options
- Added command line option
-output-min-record-size-attrto enablemin_record_sizeattribute in output code - Added command line option
-output-nonnull-attr=falseto disablenonnullattribute in output code - Added command line option
-output-linkage-attrto enablelinkageattribute in output code
Misc
- Supporting attributed functions (e.g.
__stdcall) - Supporting nested decltype and auto return type expressions
- Correctly generating array size cookie for
new[]expressions with non-trivial destructors - Bugfix: Constant global variables with initializer containing comma operator
- Avoiding nested struct declarations in generated C code
- Supporting constexpr function calls as case labels
- Fixed handling of static class/struct member variables
- Supporting nested template classes
- Supporting zero length arrays and flexible array members
- Adding names for anonymous structs
- Using
nonnullattribute for function arguments that were previously references - Supporting correct generation of empty structs/classes (by using custom
min_record_sizeattribute) - Improved generation of temporaries and copy elision
- Ensuring that enum enumerators are unique (e.g. after removing namespaces)
- Supporting nested structs/classes with the same name by applying mangling to record names
emx-clang / emx-clang++
- Added
linkageattribute to explicitly specify the LLVM linkage type of global variables and functions - Added
min_record_sizeattribute to specify the minimum size of a record
Let's Get in Touch
We believe that the best solutions start with a conversation. Whether you are exploring static code analysis, performance estimation, or code optimization – we’re here to help you reach your goals faster and more efficiently.
