15 #ifndef LLVM_TRANSFORMS_UTILS_VALUEMAPPER_H 16 #define LLVM_TRANSFORMS_UTILS_VALUEMAPPER_H 39 virtual void anchor();
52 virtual void anchor();
103 return RemapFlags(
unsigned(LHS) |
unsigned(RHS));
179 unsigned MappingContextID = 0);
183 unsigned MappingContextID = 0);
185 unsigned MappingContextID = 0);
186 void scheduleRemapFunction(
Function &F,
unsigned MappingContextID = 0);
281 #endif // LLVM_TRANSFORMS_UTILS_VALUEMAPPER_H
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
This class represents lattice values for constants.
void RemapFunction(Function &F, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Remap the operands, metadata, arguments, and instructions of a function.
Any global values not in value map are mapped to null instead of mapping to self. ...
virtual ~ValueMapTypeRemapper()=default
Context for (re-)mapping values (and metadata).
Metadata * MapMetadata(const Metadata *MD, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Lookup or compute a mapping for a piece of metadata.
void remapInstruction(Instruction &I)
Constant * mapConstant(const Constant &C)
Metadata * mapMetadata(const Metadata &MD)
Instruct the remapper to move distinct metadata instead of duplicating it when there are module-level...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
If this flag is set, the remapper knows that only local values within a function (such as an instruct...
void remapInstruction(Instruction *I, ValueToValueMapTy &VMap)
Convert the instruction operands from referencing the current values into those specified by VMap...
This is a class that can be implemented by clients to materialize Values on demand.
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
RemapFlags
These are flags that the value mapping APIs allow.
Value * MapValue(const Value *V, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Look up or compute a value in the value map.
void remapFunction(Function &F)
void RemapInstruction(Instruction *I, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Convert the instruction operands from referencing the current values into those specified by VM...
This is a class that can be implemented by clients to remap types when cloning constants and instruct...
If this flag is set, the remapper ignores missing function-local entries (Argument, Instruction, BasicBlock) that are not in the value map.
Value * mapValue(const Value &V)
LLVM Value Representation.
virtual Type * remapType(Type *SrcTy)=0
The client should implement this method if they want to remap types while mapping values...
APInt operator|(APInt a, const APInt &b)
std::vector< uint32_t > Metadata
PAL metadata represented as a vector.
MDNode * mapMDNode(const MDNode &N)