LLVM 24.0.0git
llvm::sandboxir::Module Class Reference

In SandboxIR the Module is mainly used to access the list of global objects. More...

#include "llvm/SandboxIR/Module.h"

Public Member Functions

Context & getContext () const
LLVM_ABI Function * getFunction (StringRef Name) const
const DataLayout & getDataLayout () const
const Triple & getTargetTriple () const
 Get the target triple which is a string describing the target host.
const std::string & getSourceFileName () const
LLVM_ABI GlobalVariable * getGlobalVariable (StringRef Name, bool AllowInternal) const
 Look up the specified global variable in the module symbol table.
GlobalVariable * getGlobalVariable (StringRef Name) const
GlobalVariable * getNamedGlobal (StringRef Name) const
 Return the global variable in the module with the specified name, of arbitrary type.
LLVM_ABI GlobalAlias * getNamedAlias (StringRef Name) const
 Return the global alias in the module with the specified name, of arbitrary type.
LLVM_ABI GlobalIFunc * getNamedIFunc (StringRef Name) const
 Return the global ifunc in the module with the specified name, of arbitrary type.
void dumpOS (raw_ostream &OS) const
LLVM_DUMP_METHOD void dump () const

Friends

class Context
class Instruction
 Iterator for Instructions in a `BasicBlock.

Detailed Description

In SandboxIR the Module is mainly used to access the list of global objects.

Definition at line 34 of file Module.h.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void llvm::sandboxir::Module::dump ( ) const

References LLVM_DUMP_METHOD.

◆ dumpOS()

void Module::dumpOS ( raw_ostream & OS) const

Definition at line 37 of file Module.cpp.

References dumpOS().

Referenced by dumpOS().

◆ getContext()

Context & llvm::sandboxir::Module::getContext ( ) const
inline

Definition at line 47 of file Module.h.

References Context.

◆ getDataLayout()

const DataLayout & llvm::sandboxir::Module::getDataLayout ( ) const
inline

Definition at line 51 of file Module.h.

◆ getFunction()

LLVM_ABI Function * llvm::sandboxir::Module::getFunction ( StringRef Name) const

References LLVM_ABI.

◆ getGlobalVariable() [1/2]

GlobalVariable * llvm::sandboxir::Module::getGlobalVariable ( StringRef Name) const
inline

Definition at line 66 of file Module.h.

References getGlobalVariable().

◆ getGlobalVariable() [2/2]

LLVM_ABI GlobalVariable * llvm::sandboxir::Module::getGlobalVariable ( StringRef Name,
bool AllowInternal ) const

Look up the specified global variable in the module symbol table.

If it does not exist, return null. If AllowInternal is set to true, this function will return types that have InternalLinkage. By default, these types are not returned.

References LLVM_ABI.

Referenced by getGlobalVariable(), and getNamedGlobal().

◆ getNamedAlias()

LLVM_ABI GlobalAlias * llvm::sandboxir::Module::getNamedAlias ( StringRef Name) const

Return the global alias in the module with the specified name, of arbitrary type.

This method returns null if a global with the specified name is not found.

References LLVM_ABI.

◆ getNamedGlobal()

GlobalVariable * llvm::sandboxir::Module::getNamedGlobal ( StringRef Name) const
inline

Return the global variable in the module with the specified name, of arbitrary type.

This method returns null if a global with the specified name is not found.

Definition at line 72 of file Module.h.

References getGlobalVariable().

◆ getNamedIFunc()

LLVM_ABI GlobalIFunc * llvm::sandboxir::Module::getNamedIFunc ( StringRef Name) const

Return the global ifunc in the module with the specified name, of arbitrary type.

This method returns null if a global with the specified name is not found.

References LLVM_ABI.

◆ getSourceFileName()

const std::string & llvm::sandboxir::Module::getSourceFileName ( ) const
inline

Definition at line 56 of file Module.h.

◆ getTargetTriple()

const Triple & llvm::sandboxir::Module::getTargetTriple ( ) const
inline

Get the target triple which is a string describing the target host.

Definition at line 54 of file Module.h.

◆ Context

friend class Context
friend

Definition at line 41 of file Module.h.

References Context.

Referenced by Context, and getContext().

◆ Instruction

friend class Instruction
friend

Iterator for Instructions in a `BasicBlock.

/ \Returns an sandboxir::Instruction & when derereferenced. class BBIterator { public: using difference_type = std::ptrdiff_t; using value_type = Instruction; using pointer = value_type *; using reference = value_type &; using iterator_category = std::bidirectional_iterator_tag;

private: llvm::BasicBlock *BB; llvm::BasicBlock::iterator It; Context *Ctx; LLVM_ABI pointer getInstr(llvm::BasicBlock::iterator It) const;

public: BBIterator() : BB(nullptr), Ctx(nullptr) {} BBIterator(llvm::BasicBlock <em>BB, llvm::BasicBlock::iterator It, Context *Ctx) : BB(BB), It(It), Ctx(Ctx) {} reference operator() const { return *getInstr(It); } LLVM_ABI BBIterator &operator++(); BBIterator operator++(int) { auto Copy = *this; ++*this; return Copy; } LLVM_ABI BBIterator &operator--(); BBIterator operator--(int) { auto Copy = *this; –*this; return Copy; } bool operator==(const BBIterator &Other) const { assert(Ctx == Other.Ctx && "BBIterators in different context!"); return It == Other.It; } bool operator!=(const BBIterator &Other) const { return !(*this == Other); } / \Returns the SBInstruction that corresponds to this iterator, or null if / the instruction is not found in the IR-to-SandboxIR tables. pointer get() const { return getInstr(It); } / \Returns the parent BB. LLVM_ABI BasicBlock *getNodeParent() const; };

/ Contains a list of sandboxir::Instruction's. class BasicBlock : public Value { / Builds a graph that contains all values in BB in their original form / i.e., no vectorization is taking place here. LLVM_ABI void buildBasicBlockFromLLVMIR(llvm::BasicBlock *LLVMBB); friend class Context; // For buildBasicBlockFromIR

Definition at line 44 of file Module.h.

References Instruction.

Referenced by Instruction.


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