Files
TheRock/rocm-systems/projects/rocprofiler-systems/external/dyninst/instructionAPI/doc/API/Dereference.tex
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

49 lines
2.7 KiB
TeX

\subsection{Dereference Class}
\label{sec:dereference}
A \code{Dereference} object is an \code{Expression} that dereferences another \code{ValueComputation}.
A \code{Dereference} contains an \code{Expression} representing an effective address computation. Its use set is the same as the use set of the \code{Expression} being dereferenced.
It is not possible, given the information in a single instruction, to evaluate the result of a dereference. \code{eval} may still be called on an \code{Expression} that includes dereferences, but the expected use case is as follows:
\begin{itemize}
\item Determine the address being used in a dereference via the \code{eval} mechanism
\item Perform analysis to determine the contents of that address
\item If necessary, fill in the \code{Dereference} node with the contents of that addresss, using \code{setValue}
\end{itemize}
The type associated with a \code{Dereference} node will be the type of the value {\itshape read\/} {\itshape from\/} {\itshape memory\/}, not the type used for the address computation. Two \code{Dereference}s that access the same address but interpret the contents of that memory as different types will produce different values. The children of a \code{Dereference} at a given address are identical, regardless of the type of dereference being performed at that address. For example, the \code{Expression} shown in Figure 6 could have its root \code{Dereference}, which interprets the memory being dereferenced as a unsigned 16-\/bit integer, replaced with a \code{Dereference} that interprets the memory being dereferenced as any other type. The remainder of the \code{Expression} tree would, however, remain unchanged.
\begin{apient}
Dereference (Expression::Ptr addr, Result_Type result_type)
\end{apient}
\apidesc{
A \code{Dereference} is constructed from an \code{Expression} pointer (raw or shared) representing the address
to be dereferenced and a type indicating how the memory at the address in question is to be interpreted.
}
\begin{apient}
virtual void getChildren (vector< InstructionAST::Ptr > & children) const
\end{apient}
\apidesc{
A \code{Dereference} has one child, which represents the address being dereferenced.
Appends the child of this \code{Dereference} to \code{children}.
}
\begin{apient}
virtual void getUses (set< InstructionAST::Ptr > & uses)
\end{apient}
\apidesc{
The use set of a \code{Dereference} is the same as the use set of its children.
The use set of this \code{Dereference} is inserted into \code{uses}.
}
\begin{apient}
virtual bool isUsed (InstructionAST::Ptr findMe) const
\end{apient}
\apidesc{
An \code{InstructionAST} is used by a \code{Dereference} if it is equivalent to the \code{Dereference} or it is used by
the lone child of the \code{Dereference}
}