diff options
author | Timm Baeder <tbaeder@redhat.com> | 2024-04-10 12:53:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-10 12:53:54 +0200 |
commit | 1709eac58fee8f559cd70cfce9e7f09192dcb1bc (patch) | |
tree | 81545b3994841661a60facce3b008b2bfd316853 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | ec40097db28374c1226f0f7e45f18491a596778b (diff) | |
download | llvm-1709eac58fee8f559cd70cfce9e7f09192dcb1bc.zip llvm-1709eac58fee8f559cd70cfce9e7f09192dcb1bc.tar.gz llvm-1709eac58fee8f559cd70cfce9e7f09192dcb1bc.tar.bz2 |
[clang][Interp] Integral pointers (#84159)
This turns the current `Pointer` class into a discriminated union of
`BlockPointer` and `IntPointer`. The former is what `Pointer` currently
is while the latter is just an integer value and an optional
`Descriptor*`.
The `Pointer` then has type check functions like
`isBlockPointer()`/`isIntegralPointer()`/`asBlockPointer()`/`asIntPointer()`,
which can be used to access its data.
Right now, the `IntPointer` and `BlockPointer` structs do not have any
methods of their own and everything is instead implemented in Pointer
(like it was before) and the functions now just either assert for the
right type or decide what to do based on it.
This also implements bitcasts by decaying the pointer to an integral
pointer.
`test/AST/Interp/const-eval.c` is a new test testing all kinds of stuff
related to this. It still has a few tests `#ifdef`-ed out but that
mostly depends on other unimplemented things like
`__builtin_constant_p`.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions