LLVM 22.0.0git
llvm::AsmParserContext Class Reference

Registry of file location information for LLVM IR constructs. More...

#include "llvm/AsmParser/AsmParserContext.h"

Public Member Functions

std::optional< FileLocRangegetFunctionLocation (const Function *) const
std::optional< FileLocRangegetBlockLocation (const BasicBlock *) const
std::optional< FileLocRangegetInstructionLocation (const Instruction *) const
FunctiongetFunctionAtLocation (const FileLocRange &) const
 Get the function at the requested location range.
FunctiongetFunctionAtLocation (const FileLoc &) const
 Get the function at the requested location.
BasicBlockgetBlockAtLocation (const FileLocRange &) const
 Get the block at the requested location range.
BasicBlockgetBlockAtLocation (const FileLoc &) const
 Get the block at the requested location.
InstructiongetInstructionAtLocation (const FileLocRange &) const
 Get the instruction at the requested location range.
InstructiongetInstructionAtLocation (const FileLoc &) const
 Get the instruction at the requested location.
bool addFunctionLocation (Function *, const FileLocRange &)
bool addBlockLocation (BasicBlock *, const FileLocRange &)
bool addInstructionLocation (Instruction *, const FileLocRange &)

Detailed Description

Registry of file location information for LLVM IR constructs.

This class provides access to the file location information for various LLVM IR constructs. Currently, it supports Function, BasicBlock and Instruction locations.

When available, it can answer queries about what is at a given file location, as well as where in a file a given IR construct is.

This information is optionally emitted by the LLParser while it reads LLVM textual IR.

Definition at line 31 of file AsmParserContext.h.

Member Function Documentation

◆ addBlockLocation()

bool llvm::AsmParserContext::addBlockLocation ( BasicBlock * BB,
const FileLocRange & Loc )

Definition at line 79 of file AsmParserContext.cpp.

◆ addFunctionLocation()

bool llvm::AsmParserContext::addFunctionLocation ( Function * F,
const FileLocRange & Loc )

Definition at line 74 of file AsmParserContext.cpp.

References F.

◆ addInstructionLocation()

bool llvm::AsmParserContext::addInstructionLocation ( Instruction * I,
const FileLocRange & Loc )

Definition at line 84 of file AsmParserContext.cpp.

References I.

◆ getBlockAtLocation() [1/2]

BasicBlock * llvm::AsmParserContext::getBlockAtLocation ( const FileLoc & Query) const

Get the block at the requested location.

If no block occupies the queried location, or the record is missing, a nullptr is returned.

Definition at line 56 of file AsmParserContext.cpp.

References getBlockAtLocation().

◆ getBlockAtLocation() [2/2]

BasicBlock * llvm::AsmParserContext::getBlockAtLocation ( const FileLocRange & Query) const

Get the block at the requested location range.

If no single block occupies the queried range, or the record is missing, a nullptr is returned.

Definition at line 48 of file AsmParserContext.cpp.

Referenced by getBlockAtLocation().

◆ getBlockLocation()

std::optional< FileLocRange > llvm::AsmParserContext::getBlockLocation ( const BasicBlock * BB) const

Definition at line 21 of file AsmParserContext.cpp.

◆ getFunctionAtLocation() [1/2]

Function * llvm::AsmParserContext::getFunctionAtLocation ( const FileLoc & Query) const

Get the function at the requested location.

If no function occupies the queried location, or the record is missing, a nullptr is returned.

Definition at line 43 of file AsmParserContext.cpp.

References getFunctionAtLocation().

◆ getFunctionAtLocation() [2/2]

Function * llvm::AsmParserContext::getFunctionAtLocation ( const FileLocRange & Query) const

Get the function at the requested location range.

If no single function occupies the queried range, or the record is missing, a nullptr is returned.

Definition at line 35 of file AsmParserContext.cpp.

References F.

Referenced by getFunctionAtLocation().

◆ getFunctionLocation()

std::optional< FileLocRange > llvm::AsmParserContext::getFunctionLocation ( const Function * F) const

Definition at line 14 of file AsmParserContext.cpp.

References F.

◆ getInstructionAtLocation() [1/2]

Instruction * llvm::AsmParserContext::getInstructionAtLocation ( const FileLoc & Query) const

Get the instruction at the requested location.

If no instruction occupies the queried location, or the record is missing, a nullptr is returned.

Definition at line 70 of file AsmParserContext.cpp.

References getInstructionAtLocation().

◆ getInstructionAtLocation() [2/2]

Instruction * llvm::AsmParserContext::getInstructionAtLocation ( const FileLocRange & Query) const

Get the instruction at the requested location range.

If no single instruction occupies the queried range, or the record is missing, a nullptr is returned.

Definition at line 61 of file AsmParserContext.cpp.

References I.

Referenced by getInstructionAtLocation().

◆ getInstructionLocation()

std::optional< FileLocRange > llvm::AsmParserContext::getInstructionLocation ( const Instruction * I) const

Definition at line 28 of file AsmParserContext.cpp.

References I.


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