15 #ifndef LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
16 #define LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
27 template <
typename T>
class ArrayRef;
28 template <
typename T>
class MutableArrayRef;
32 namespace wholeprogramdevirt {
42 std::pair<uint8_t *, uint8_t *>
getPtrToData(uint64_t Pos, uint8_t Size) {
43 if (
Bytes.size() < Pos + Size) {
44 Bytes.resize(Pos + Size);
52 void setLE(uint64_t Pos, uint64_t Val, uint8_t Size) {
55 for (
unsigned I = 0;
I != Size; ++
I) {
56 DataUsed.first[
I] = Val >> (
I * 8);
58 DataUsed.second[
I] = 0xff;
64 void setBE(uint64_t Pos, uint64_t Val, uint8_t Size) {
67 for (
unsigned I = 0;
I != Size; ++
I) {
68 DataUsed.first[Size -
I - 1] = Val >> (
I * 8);
69 assert(!DataUsed.second[Size -
I - 1]);
70 DataUsed.second[Size -
I - 1] = 0xff;
78 *DataUsed.first |= 1 << (Pos % 8);
79 assert(!(*DataUsed.second & (1 << Pos % 8)));
80 *DataUsed.second |= 1 << (Pos % 8);
121 : Fn(nullptr), TM(TM), IsBigEndian(IsBigEndian),
WasDevirt(
false) {}
208 uint64_t AllocBefore,
unsigned BitWidth,
209 int64_t &OffsetByte, uint64_t &OffsetBit);
215 uint64_t AllocAfter,
unsigned BitWidth,
216 int64_t &OffsetByte, uint64_t &OffsetBit);
226 #endif // LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
void setBit(uint64_t Pos, bool b)
std::vector< uint8_t > BytesUsed
A Module instance is used to store all the information related to an LLVM module. ...
VirtualCallTarget(Function *Fn, const TypeMemberInfo *TM)
uint64_t minBeforeBytes() const
uint64_t minAfterBytes() const
void setAfterReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocAfter, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
void setBeforeReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocBefore, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
A CRTP mix-in to automatically provide informational APIs needed for passes.
uint64_t allocatedAfterBytes() const
void setAfterBytes(uint64_t Pos, uint8_t Size)
Function Alias Analysis false
bool operator<(const TypeMemberInfo &other) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
VirtualCallTarget(const TypeMemberInfo *TM, bool IsBigEndian)
void setBeforeBytes(uint64_t Pos, uint8_t Size)
A set of analyses that are preserved following a run of a transformation pass.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
uint64_t allocatedBeforeBytes() const
Module.h This file contains the declarations for the Module class.
void setBeforeBit(uint64_t Pos)
void setBE(uint64_t Pos, uint64_t Val, uint8_t Size)
std::vector< uint8_t > Bytes
uint64_t findLowestOffset(ArrayRef< VirtualCallTarget > Targets, bool IsAfter, uint64_t Size)
void setAfterBit(uint64_t Pos)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::pair< uint8_t *, uint8_t * > getPtrToData(uint64_t Pos, uint8_t Size)
const TypeMemberInfo * TM
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
void setLE(uint64_t Pos, uint64_t Val, uint8_t Size)