LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Attributes | List of all members
llvm::NamedImmMapper Struct Reference

#include <AArch64BaseInfo.h>

Inheritance diagram for llvm::NamedImmMapper:
Inheritance graph
[legend]
Collaboration diagram for llvm::NamedImmMapper:
Collaboration graph
[legend]

Classes

struct  Mapping
 

Public Member Functions

template<int N>
 NamedImmMapper (const Mapping(&Pairs)[N], uint32_t TooBigImm)
 
StringRef toString (uint32_t Value, bool &Valid) const
 
uint32_t fromString (StringRef Name, bool &Valid) const
 
bool validImm (uint32_t Value) const
 

Protected Attributes

const MappingPairs
 
size_t NumPairs
 
uint32_t TooBigImm
 

Detailed Description

Instances of this class can perform bidirectional mapping from random identifier strings to operand encodings. For example "MSR" takes a named system-register which must be encoded somehow and decoded for printing. This central location means that the information for those transformations is not duplicated and remains in sync.

FIXME: currently the algorithm is a completely unoptimised linear search. Obviously this could be improved, but we would probably want to work out just how often these instructions are emitted before working on it. It might even be optimal to just reorder the tables for the common instructions rather than changing the algorithm.

Definition at line 118 of file AArch64BaseInfo.h.

Constructor & Destructor Documentation

template<int N>
llvm::NamedImmMapper::NamedImmMapper ( const Mapping(&)  Pairs[N],
uint32_t  TooBigImm 
)
inline

Definition at line 125 of file AArch64BaseInfo.h.

Member Function Documentation

uint32_t NamedImmMapper::fromString ( StringRef  Name,
bool Valid 
) const
StringRef NamedImmMapper::toString ( uint32_t  Value,
bool Valid 
) const
bool NamedImmMapper::validImm ( uint32_t  Value) const

Many of the instructions allow an alternative assembly form consisting of a simple immediate. Currently the only valid forms are ranges [0, N) where N being 0 indicates no immediate syntax-form is allowed.

Definition at line 46 of file AArch64BaseInfo.cpp.

References TooBigImm.

Member Data Documentation

size_t llvm::NamedImmMapper::NumPairs
protected

Definition at line 137 of file AArch64BaseInfo.h.

Referenced by fromString(), and toString().

const Mapping* llvm::NamedImmMapper::Pairs
protected

Definition at line 136 of file AArch64BaseInfo.h.

Referenced by fromString(), and toString().

uint32_t llvm::NamedImmMapper::TooBigImm
protected

Definition at line 138 of file AArch64BaseInfo.h.

Referenced by validImm().


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