LLVM 23.0.0git
llvm::AsmParserContext Class Reference

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

#include "llvm/AsmParser/AsmParserContext.h"

Public Member Functions

LLVM_ABI std::optional< FileLocRangegetFunctionLocation (const Function *) const
LLVM_ABI std::optional< FileLocRangegetBlockLocation (const BasicBlock *) const
LLVM_ABI std::optional< FileLocRangegetInstructionOrArgumentLocation (const Value *) const
LLVM_ABI FunctiongetFunctionAtLocation (const FileLocRange &) const
 Get the function at the requested location range.
LLVM_ABI FunctiongetFunctionAtLocation (const FileLoc &) const
 Get the function at the requested location.
LLVM_ABI BasicBlockgetBlockAtLocation (const FileLocRange &) const
 Get the block at the requested location range.
LLVM_ABI BasicBlockgetBlockAtLocation (const FileLoc &) const
 Get the block at the requested location.
LLVM_ABI ValuegetInstructionOrArgumentAtLocation (const FileLocRange &) const
 Get the instruction or function argument at the requested location range.
LLVM_ABI ValuegetInstructionOrArgumentAtLocation (const FileLoc &) const
 Get the instruction or function argument at the requested location.
LLVM_ABI ValuegetValueReferencedAtLocation (const FileLoc &) const
 Get value referenced at the requested location.
LLVM_ABI ValuegetValueReferencedAtLocation (const FileLocRange &) const
 Get value referenced at the requested location range.
LLVM_ABI bool addFunctionLocation (Function *, const FileLocRange &)
LLVM_ABI bool addBlockLocation (BasicBlock *, const FileLocRange &)
LLVM_ABI bool addInstructionOrArgumentLocation (Value *, const FileLocRange &)
LLVM_ABI bool addValueReferenceAtLocation (Value *, 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 33 of file AsmParserContext.h.

Member Function Documentation

◆ addBlockLocation()

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

Definition at line 94 of file AsmParserContext.cpp.

◆ addFunctionLocation()

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

Definition at line 86 of file AsmParserContext.cpp.

References F.

◆ addInstructionOrArgumentLocation()

bool llvm::AsmParserContext::addInstructionOrArgumentLocation ( Value * IA,
const FileLocRange & Loc )

Definition at line 102 of file AsmParserContext.cpp.

References assert(), and llvm::isa().

◆ addValueReferenceAtLocation()

bool llvm::AsmParserContext::addValueReferenceAtLocation ( Value * V,
const FileLocRange & Loc )

Definition at line 111 of file AsmParserContext.cpp.

◆ 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.

◆ 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 49 of file AsmParserContext.cpp.

References llvm::FileLocRange::End, and llvm::FileLocRange::Start.

◆ 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 44 of file AsmParserContext.cpp.

◆ 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 37 of file AsmParserContext.cpp.

References llvm::FileLocRange::End, and llvm::FileLocRange::Start.

◆ getFunctionLocation()

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

Definition at line 14 of file AsmParserContext.cpp.

References F.

◆ getInstructionOrArgumentAtLocation() [1/2]

Value * llvm::AsmParserContext::getInstructionOrArgumentAtLocation ( const FileLoc & Query) const

Get the instruction or function argument at the requested location.

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

Definition at line 68 of file AsmParserContext.cpp.

◆ getInstructionOrArgumentAtLocation() [2/2]

Value * llvm::AsmParserContext::getInstructionOrArgumentAtLocation ( const FileLocRange & Query) const

Get the instruction or function argument 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 60 of file AsmParserContext.cpp.

References llvm::FileLocRange::End, and llvm::FileLocRange::Start.

◆ getInstructionOrArgumentLocation()

std::optional< FileLocRange > llvm::AsmParserContext::getInstructionOrArgumentLocation ( const Value * IA) const

Definition at line 28 of file AsmParserContext.cpp.

References assert(), and llvm::isa().

◆ getValueReferencedAtLocation() [1/2]

Value * llvm::AsmParserContext::getValueReferencedAtLocation ( const FileLoc & Query) const

Get value referenced at the requested location.

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

Definition at line 82 of file AsmParserContext.cpp.

◆ getValueReferencedAtLocation() [2/2]

Value * llvm::AsmParserContext::getValueReferencedAtLocation ( const FileLocRange & Query) const

Get value referenced at the requested location range.

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

Definition at line 73 of file AsmParserContext.cpp.

References llvm::FileLocRange::End, and llvm::FileLocRange::Start.


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