GCC Middle and Back End API Reference
op_location_t Class Reference

#include <tree.h>

Public Member Functions

 op_location_t (location_t combined_loc)
 
 op_location_t (location_t operator_loc, location_t combined_loc)
 
 operator location_t () const
 

Data Fields

location_t m_operator_loc
 
location_t m_combined_loc
 

Detailed Description

A struct for encapsulating location information about an operator
and the operation built from it.

m_operator_loc is the location of the operator
m_combined_loc is the location of the compound expression.

For example, given "a && b" the, operator location is:
   a && b
     ^~
and the combined location is:
   a && b
   ~~^~~~
Capturing this information allows for class binary_op_rich_location
to provide detailed information about e.g. type mismatches in binary
operations where enough location information is available:

  arg_0 op arg_1
  ~~~~~ ^~ ~~~~~
    |        |
    |        arg1 type
    arg0 type

falling back to just showing the combined location:

  arg_0 op arg_1
  ~~~~~~^~~~~~~~

where it is not.   

Constructor & Destructor Documentation

◆ op_location_t() [1/2]

op_location_t::op_location_t ( location_t combined_loc)
inline

◆ op_location_t() [2/2]

op_location_t::op_location_t ( location_t operator_loc,
location_t combined_loc )
inline

Member Function Documentation

◆ operator location_t()

op_location_t::operator location_t ( ) const
inline

Field Documentation

◆ m_combined_loc

location_t op_location_t::m_combined_loc

◆ m_operator_loc

location_t op_location_t::m_operator_loc

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