forked from OSchip/llvm-project
[LLVM-C]Add LLVMAddMetadataToInst, deprecated LLVMSetInstDebugLocation.
IRBuilder has been updated to support preserving metdata in a more general manner. This patch adds `LLVMAddMetadataToInst` and deprecates `LLVMSetInstDebugLocation` in favor of the more general function. Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D93454
This commit is contained in:
parent
eda2ebd780
commit
d465315679
|
@ -128,7 +128,8 @@ Changes to the OCaml bindings
|
||||||
Changes to the C API
|
Changes to the C API
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
* ...
|
* ``LLVMSetInstDebugLocation`` has been deprecated in favor of the more general
|
||||||
|
``LLVMAddMetadataToInst``.
|
||||||
|
|
||||||
Changes to the Go bindings
|
Changes to the Go bindings
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
|
@ -3611,10 +3611,20 @@ void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc);
|
||||||
* current debug location for the given builder. If the builder has no current
|
* current debug location for the given builder. If the builder has no current
|
||||||
* debug location, this function is a no-op.
|
* debug location, this function is a no-op.
|
||||||
*
|
*
|
||||||
|
* @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
|
||||||
|
* LLVMAddMetadataToInst.
|
||||||
|
*
|
||||||
* @see llvm::IRBuilder::SetInstDebugLocation()
|
* @see llvm::IRBuilder::SetInstDebugLocation()
|
||||||
*/
|
*/
|
||||||
void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst);
|
void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the metadata registered with the given builder to the given instruction.
|
||||||
|
*
|
||||||
|
* @see llvm::IRBuilder::AddMetadataToInst()
|
||||||
|
*/
|
||||||
|
void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the dafult floating-point math metadata for a given builder.
|
* Get the dafult floating-point math metadata for a given builder.
|
||||||
*
|
*
|
||||||
|
|
|
@ -3133,6 +3133,10 @@ void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst) {
|
||||||
unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
|
unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst) {
|
||||||
|
unwrap(Builder)->AddMetadataToInst(unwrap<Instruction>(Inst));
|
||||||
|
}
|
||||||
|
|
||||||
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,
|
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,
|
||||||
LLVMMetadataRef FPMathTag) {
|
LLVMMetadataRef FPMathTag) {
|
||||||
|
|
||||||
|
|
|
@ -856,7 +856,7 @@ struct FunCloner {
|
||||||
LLVMSetMetadata(Dst, Kind, LLVMMetadataAsValue(Ctx, MD));
|
LLVMSetMetadata(Dst, Kind, LLVMMetadataAsValue(Ctx, MD));
|
||||||
}
|
}
|
||||||
LLVMDisposeValueMetadataEntries(AllMetadata);
|
LLVMDisposeValueMetadataEntries(AllMetadata);
|
||||||
LLVMSetInstDebugLocation(Builder, Dst);
|
LLVMAddMetadataToInst(Builder, Dst);
|
||||||
|
|
||||||
check_value_kind(Dst, LLVMInstructionValueKind);
|
check_value_kind(Dst, LLVMInstructionValueKind);
|
||||||
return VMap[Src] = Dst;
|
return VMap[Src] = Dst;
|
||||||
|
|
Loading…
Reference in New Issue