ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
clang_c_convert.cpp File Reference
#include <util/base/compiler_defs.h>
#include <cctype>
#include <clang/AST/Attr.h>
#include <clang/AST/Mangle.h>
#include <clang/AST/Expr.h>
#include <clang/AST/ExprCXX.h>
#include <clang/AST/ParentMapContext.h>
#include <clang/AST/RecordLayout.h>
#include <clang/AST/RecursiveASTVisitor.h>
#include <clang/AST/QualTypeNames.h>
#include <clang/AST/Type.h>
#include <clang/Basic/Version.inc>
#include <clang/Basic/Builtins.h>
#include <clang/Index/USRGeneration.h>
#include <clang/Frontend/ASTUnit.h>
#include <llvm/Support/raw_os_ostream.h>
#include <clang-c-frontend/clang_ast_dump.h>
#include <ac_config.h>
#include <clang-c-frontend/clang_c_convert.h>
#include <clang-c-frontend/builtin_names.h>
#include <clang-c-frontend/typecast.h>
#include <irep2/irep2_utils.h>
#include <util/arith/arith_tools.h>
#include <util/arith/bitvector.h>
#include <util/lang/c_types.h>
#include <util/expr/expr_util.h>
#include <util/base/i2string.h>
#include <util/message/message.h>
#include <util/arith/mp_arith.h>
#include <util/irep/std_code.h>
#include <util/irep/std_expr.h>
#include <util/expr/symbolic_types.h>
#include <util/symtab/base_subobject.h>
#include <boost/algorithm/string/replace.hpp>
Include dependency graph for clang_c_convert.cpp:

Macros

#define BITINT_TAG   clang::Type::ExtInt
#define BITINT_TYPE   clang::ExtIntType
#define SVE_VEC(elem, n_elems)

Functions

static const clang::RecordDecl & defining_decl (const clang::RecordDecl &rd)
static bool holds_incomplete_record (const typet &t)
static exprt label_address (std::size_t index)
 The value standing for the address of the index-th address-taken label.
static void make_bitcast (exprt &expr, const typet &type)
 Reinterpret expr's object representation as type, where a typecast would convert its value.
static bool is_vector_bit_cast (const typet &from, const typet &to)
 Whether clang's CK_BitCast from from to to reinterprets the bits of a vector as another vector or scalar of its size (#7905), rather than converting a pointer.
static void convert_bit_cast (const namespacet &ns, exprt &expr, const typet &type)
static bool atomic_has_value_operand (clang::AtomicExpr::AtomicOp op)
std::string getFullyQualifiedName (const clang::QualType &t, const clang::ASTContext &c)
static void collect_local_decls (llvm::ArrayRef< clang::TemplateArgument > args, std::vector< const clang::NamedDecl * > &out)
static void collect_local_decls (clang::QualType t, std::vector< const clang::NamedDecl * > &out)
static std::string identifier_suffix (const std::string &text)

Macro Definition Documentation

◆ BITINT_TAG

#define BITINT_TAG   clang::Type::ExtInt

◆ BITINT_TYPE

#define BITINT_TYPE   clang::ExtIntType

◆ SVE_VEC

#define SVE_VEC ( elem,
n_elems )
Value:
elem, \
integer2string(n_elems), \
unsigned bv_width(const typet &type)
Definition bitvector.cpp:4
typet int_type()
Definition c_types.cpp:65
Definition std_expr.h:1082
This type maps the vectors.
Definition std_types.h:695
const std::string integer2binary(const BigInt &n, std::size_t width)
Definition mp_arith.cpp:49
const std::string integer2string(const BigInt &n, unsigned base)
Definition mp_arith.cpp:86

Function Documentation

◆ atomic_has_value_operand()

bool atomic_has_value_operand ( clang::AtomicExpr::AtomicOp op)
static

◆ collect_local_decls() [1/2]

void collect_local_decls ( clang::QualType t,
std::vector< const clang::NamedDecl * > & out )
static

◆ collect_local_decls() [2/2]

void collect_local_decls ( llvm::ArrayRef< clang::TemplateArgument > args,
std::vector< const clang::NamedDecl * > & out )
static

◆ convert_bit_cast()

void convert_bit_cast ( const namespacet & ns,
exprt & expr,
const typet & type )
static

◆ defining_decl()

const clang::RecordDecl & defining_decl ( const clang::RecordDecl & rd)
static

◆ getFullyQualifiedName()

std::string getFullyQualifiedName ( const clang::QualType & t,
const clang::ASTContext & c )

◆ holds_incomplete_record()

bool holds_incomplete_record ( const typet & t)
static

◆ identifier_suffix()

std::string identifier_suffix ( const std::string & text)
static

◆ is_vector_bit_cast()

bool is_vector_bit_cast ( const typet & from,
const typet & to )
static

Whether clang's CK_BitCast from from to to reinterprets the bits of a vector as another vector or scalar of its size (#7905), rather than converting a pointer.

An operand ESBMC does not model – a header's call to a builtin it lacks – keeps the typecast path.

◆ label_address()

exprt label_address ( std::size_t index)
static

The value standing for the address of the index-th address-taken label.

◆ make_bitcast()

void make_bitcast ( exprt & expr,
const typet & type )
static

Reinterpret expr's object representation as type, where a typecast would convert its value.