Loading [MathJax]/extensions/tex2jax.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
FIRParser::LocWithInfo Class Reference

This helper class is used to handle Info records, which specify higher level symbolic source location, that may be missing from the file. More...

Collaboration diagram for FIRParser::LocWithInfo:
Collaboration graph
[legend]

Public Member Functions

 LocWithInfo (SMLoc firLoc, FIRParser *parser)
 
SMLoc getFIRLoc () const
 
Location getLoc ()
 
ParseResult parseOptionalInfo ()
 Parse an @info marker if present and update our location.
 
void setDefaultLoc (Location loc)
 If we didn't parse an info locator for the specified value, this sets a default, overriding a fall back to a location in the .fir file.
 

Private Attributes

FIRParser *const parser
 
SMLoc firLoc
 This is the designated location in the .fir file for use when there is no @ info marker.
 
std::optional< Location > infoLoc
 This is the location specified by the @ marker if present.
 

Detailed Description

This helper class is used to handle Info records, which specify higher level symbolic source location, that may be missing from the file.

If the higher level source information is missing, we fall back to the location in the .fir file.

Definition at line 378 of file FIRParser.cpp.

Constructor & Destructor Documentation

◆ LocWithInfo()

FIRParser::LocWithInfo::LocWithInfo ( SMLoc  firLoc,
FIRParser *  parser 
)
inlineexplicit

Definition at line 380 of file FIRParser.cpp.

Member Function Documentation

◆ getFIRLoc()

SMLoc FIRParser::LocWithInfo::getFIRLoc ( ) const
inline

Definition at line 383 of file FIRParser.cpp.

References firLoc.

◆ getLoc()

Location FIRParser::LocWithInfo::getLoc ( )
inline

Definition at line 385 of file FIRParser.cpp.

References firLoc, infoLoc, and parser.

◆ parseOptionalInfo()

ParseResult FIRParser::LocWithInfo::parseOptionalInfo ( )
inline

Parse an @info marker if present and update our location.

Definition at line 394 of file FIRParser.cpp.

References assert(), infoLoc, and parser.

◆ setDefaultLoc()

void FIRParser::LocWithInfo::setDefaultLoc ( Location  loc)
inline

If we didn't parse an info locator for the specified value, this sets a default, overriding a fall back to a location in the .fir file.

Definition at line 418 of file FIRParser.cpp.

References infoLoc.

Member Data Documentation

◆ firLoc

SMLoc FIRParser::LocWithInfo::firLoc
private

This is the designated location in the .fir file for use when there is no @ info marker.

Definition at line 428 of file FIRParser.cpp.

Referenced by getFIRLoc(), and getLoc().

◆ infoLoc

std::optional<Location> FIRParser::LocWithInfo::infoLoc
private

This is the location specified by the @ marker if present.

Definition at line 431 of file FIRParser.cpp.

Referenced by getLoc(), parseOptionalInfo(), and setDefaultLoc().

◆ parser

FIRParser* const FIRParser::LocWithInfo::parser
private

Definition at line 424 of file FIRParser.cpp.

Referenced by getLoc(), and parseOptionalInfo().


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