trailofbits / vast

VAST is an experimental compiler pipeline designed for program analysis of C and C++. It provides a tower of IRs as MLIR dialects to choose the best fit representations for a program analysis or further program abstraction.
https://trailofbits.github.io/vast/
Apache License 2.0
368 stars 23 forks source link

abi: Support array types. #611

Closed lkorenc closed 2 weeks ago

lkorenc commented 1 month ago

Adds support for array types and includes various fixes that were implemented along the way.

github-actions[bot] commented 2 weeks ago

Cpp-Linter Report :warning:

Some files did not pass the configured checks!

clang-format reports: 4 file(s) not formatted - include/vast/ABI/Classify.hpp - include/vast/ABI/MLIRTypeInfo.hpp - include/vast/Conversion/ABI/AggregateTypes.hpp - lib/vast/Conversion/ToLLVM/IRsToLLVM.cpp
clang-tidy reports: 20 concern(s) - **include/vast/Conversion/ABI/AggregateTypes.hpp:44:45:** error: [clang-diagnostic-error] > unknown type name 'mlir_type' ```hpp 44 | std::size_t align_paddding_size(mlir_type type) { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:53:16:** error: [clang-diagnostic-error] > unknown type name 'mlir_type' ```hpp 53 | static mlir_type mk_int_type(mcontext_t &mctx, auto size) { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:53:38:** error: [clang-diagnostic-error] > unknown type name 'mcontext_t' ```hpp 53 | static mlir_type mk_int_type(mcontext_t &mctx, auto size) { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:62:28:** error: [clang-diagnostic-error] > unknown type name 'mlir_type' ```hpp 62 | bool needs_nesting(mlir_type type) const { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:67:9:** error: [clang-diagnostic-error] > use of undeclared identifier 'gap' ```hpp 67 | gap::generator< mlir_value > field_ptrs( | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:67:25:** error: [clang-diagnostic-error] > use of undeclared identifier 'mlir_value' ```hpp 67 | gap::generator< mlir_value > field_ptrs( | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:68:13:** error: [clang-diagnostic-error] > use of undeclared identifier 'hl' ```hpp 68 | hl::ArrayType array_type, mlir_value value, | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:68:39:** error: [clang-diagnostic-error] > unknown type name 'mlir_value' ```hpp 68 | hl::ArrayType array_type, mlir_value value, | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:83:9:** error: [clang-diagnostic-error] > use of undeclared identifier 'gap' ```hpp 83 | gap::generator< mlir_value > field_ptrs( | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:83:25:** error: [clang-diagnostic-error] > use of undeclared identifier 'mlir_value' ```hpp 83 | gap::generator< mlir_value > field_ptrs( | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:84:13:** error: [clang-diagnostic-error] > use of undeclared identifier 'hl' ```hpp 84 | hl::RecordType record_type, mlir_value value, | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:84:41:** error: [clang-diagnostic-error] > unknown type name 'mlir_value' ```hpp 84 | hl::RecordType record_type, mlir_value value, | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:103:9:** error: [clang-diagnostic-error] > use of undeclared identifier 'gap' ```hpp 103 | gap::generator< mlir_value > field_ptrs(operation root, auto loc, auto &bld) const { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:103:25:** error: [clang-diagnostic-error] > use of undeclared identifier 'mlir_value' ```hpp 103 | gap::generator< mlir_value > field_ptrs(operation root, auto loc, auto &bld) const { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:103:49:** error: [clang-diagnostic-error] > unknown type name 'operation' ```hpp 103 | gap::generator< mlir_value > field_ptrs(operation root, auto loc, auto &bld) const { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:122:9:** error: [clang-diagnostic-error] > use of undeclared identifier 'gap' ```hpp 122 | gap::generator< mlir_type > fields(hl::ArrayType array_type) const { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:122:25:** error: [clang-diagnostic-error] > use of undeclared identifier 'mlir_type' ```hpp 122 | gap::generator< mlir_type > fields(hl::ArrayType array_type) const { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:122:44:** error: [clang-diagnostic-error] > use of undeclared identifier 'hl' ```hpp 122 | gap::generator< mlir_type > fields(hl::ArrayType array_type) const { | ^ ``` - **include/vast/Conversion/ABI/AggregateTypes.hpp:131:21:** error: [clang-diagnostic-error] > unknown type name 'mlir_type' ```hpp 131 | auto fields(mlir_type t, vast_module mod) const { | ^ ``` - **include/vast/Conversion/ABI/Common.hpp:6:25:** error: [clang-diagnostic-error] > use of undeclared identifier 'std' ```hpp 6 | static inline const std::string abi_func_name_prefix = "vast.abi."; | ^ ```

Have any feedback or feature suggestions? Share it here.