Code Listener
[unstable] git snapshot
|
some generic utilities working on top of code_listener/CodeStorage More...
#include "code_listener.h"
#include <cassert>
#include <set>
#include <stack>
#include <string>
#include <vector>
Go to the source code of this file.
Data Structures | |
struct | CltStackItem |
Namespaces | |
CodeStorage | |
object model that describes the analyzed code on the input | |
Typedefs | |
typedef std::vector< int > | TFieldIdxChain |
Functions | |
bool | operator== (const struct cl_type &cltA, const struct cl_type &cltB) |
compare given two pieces of static type-info semantically More... | |
bool | operator!= (const struct cl_type &cltA, const struct cl_type &cltB) |
compare given two pieces of static type-info semantically More... | |
struct cl_type * | targetTypeOfPtr (const struct cl_type *clt) |
return type of the target object that the pointer type can point to More... | |
struct cl_type * | targetTypeOfArray (const struct cl_type *clt) |
return type of the target object that the array type can point to More... | |
bool | isComposite (const struct cl_type *clt, bool includingArray=true) |
bool | isDataPtr (const struct cl_type *clt) |
bool | isCodePtr (const struct cl_type *clt) |
bool | isLcVar (const cl_operand &op) |
return true if the given operand is a local variable More... | |
bool | seekRefAccessor (const struct cl_accessor *ac) |
return true if there is any CL_ACCESSOR_REF in the given chain of accessors More... | |
int | intCstFromOperand (const struct cl_operand *op) |
return integral value from the integral constant given as operand More... | |
int | varIdFromOperand (const struct cl_operand *op, const char **pName=0) |
return unique ID of the variable/register given as operand More... | |
bool | fncNameFromCst (const char **pName, const struct cl_operand *op) |
get name of an external function given as CL_OPERAND_CST, true on success More... | |
bool | fncUidFromOperand (int *pUid, const struct cl_operand *op) |
get uid of a function from the given operand if available, true on success More... | |
int | offsetByIdxChain (const struct cl_type *, const TFieldIdxChain &) |
template<class TVisitor > | |
bool | traverseTypeIc (const struct cl_type *clt, TVisitor &visitor, bool digOnlyComposite=false) |
std::string | varToString (const CodeStorage::Storage &stor, const int uid, const struct cl_loc **pLoc=0) |
some generic utilities working on top of code_listener/CodeStorage
Definition in file clutil.hh.
typedef std::vector<int > TFieldIdxChain |
bool fncNameFromCst | ( | const char ** | pName, |
const struct cl_operand * | op | ||
) |
get name of an external function given as CL_OPERAND_CST, true on success
bool fncUidFromOperand | ( | int * | pUid, |
const struct cl_operand * | op | ||
) |
get uid of a function from the given operand if available, true on success
int intCstFromOperand | ( | const struct cl_operand * | op) |
return integral value from the integral constant given as operand
|
inline |
Definition at line 82 of file clutil.hh.
References CL_TYPE_FNC, CL_TYPE_PTR, cl_type::code, and targetTypeOfPtr().
|
inline |
Definition at line 55 of file clutil.hh.
References CL_TYPE_ARRAY, CL_TYPE_STRUCT, CL_TYPE_UNION, and cl_type::code.
Referenced by traverseTypeIc().
|
inline |
Definition at line 73 of file clutil.hh.
References CL_TYPE_FNC, CL_TYPE_PTR, cl_type::code, and targetTypeOfPtr().
|
inline |
return true if the given operand is a local variable
Definition at line 92 of file clutil.hh.
References CL_OPERAND_VAR, CL_SCOPE_GLOBAL, CL_SCOPE_STATIC, cl_type::code, cl_operand::code, and cl_operand::scope.
int offsetByIdxChain | ( | const struct cl_type * | , |
const TFieldIdxChain & | |||
) |
compare given two pieces of static type-info semantically
bool seekRefAccessor | ( | const struct cl_accessor * | ac) |
return true if there is any CL_ACCESSOR_REF in the given chain of accessors
return type of the target object that the array type can point to
return type of the target object that the pointer type can point to
Referenced by isCodePtr(), and isDataPtr().
bool traverseTypeIc | ( | const struct cl_type * | clt, |
TVisitor & | visitor, | ||
bool | digOnlyComposite = false |
||
) |
Definition at line 141 of file clutil.hh.
References CltStackItem::clt, isComposite(), cl_type::item_cnt, cl_type_item::type, and cl_type::uid.
int varIdFromOperand | ( | const struct cl_operand * | op, |
const char ** | pName = 0 |
||
) |
return unique ID of the variable/register given as operand
std::string varToString | ( | const CodeStorage::Storage & | stor, |
const int | uid, | ||
const struct cl_loc ** | pLoc = 0 |
||
) |