clang-metatool
A framework for reusing code in clang tools
Public Attributes | List of all members
clangmetatool::collectors::VariableRefsData Struct Reference

#include <clangmetatool/collectors/variable_refs_data.h>

Collaboration diagram for clangmetatool::collectors::VariableRefsData:
Collaboration graph
[legend]

Public Attributes

std::multimap< const clang::VarDecl *, const clang::DeclRefExpr * > refs
 
std::set< const clang::DeclRefExpr * > rvalue_refs
 
std::map< const clang::DeclRefExpr *, const clang::Expr * > clear_assignment_refs
 

Detailed Description

The data collected by the VariableRefs collector

Definition at line 28 of file variable_refs_data.h.

Member Data Documentation

◆ clear_assignment_refs

std::map<const clang::DeclRefExpr *, const clang::Expr *> clangmetatool::collectors::VariableRefsData::clear_assignment_refs

List usages of that variable that are plain variable assignment. The idea is that if the variable is never initialized, and the only non-rvalue usage is a clear assignment, then its value is deterministic.

More elaborate execution-path analysis would be able to tell this better, but there are situations where this will be sufficient.

Definition at line 53 of file variable_refs_data.h.

◆ refs

std::multimap<const clang::VarDecl *, const clang::DeclRefExpr *> clangmetatool::collectors::VariableRefsData::refs

List all the references for that valuedecl.

Definition at line 33 of file variable_refs_data.h.

◆ rvalue_refs

std::set<const clang::DeclRefExpr *> clangmetatool::collectors::VariableRefsData::rvalue_refs

List usages of that variable as rvalue. You may actually be interested in the usages that are not rvalues, but the way the collector works requires us to do this indirection.

Definition at line 40 of file variable_refs_data.h.


The documentation for this struct was generated from the following file: