[IRBuilder] Deprecate CreateLoad APIs with implicit type

These APIs are not compatible with opaque pointers. Deprecate them
to avoid the introduction of further uses.
This commit is contained in:
Nikita Popov 2021-02-11 22:33:18 +01:00
parent 0dff8a9627
commit 6312c53870

View File

@ -1646,17 +1646,27 @@ public:
}
// Deprecated [opaque pointer types]
LoadInst *CreateLoad(Value *Ptr, const char *Name) {
LLVM_ATTRIBUTE_DEPRECATED(LoadInst *CreateLoad(Value *Ptr,
const char *Name),
"Use the version that explicitly specifies the "
"loaded type instead") {
return CreateLoad(Ptr->getType()->getPointerElementType(), Ptr, Name);
}
// Deprecated [opaque pointer types]
LoadInst *CreateLoad(Value *Ptr, const Twine &Name = "") {
LLVM_ATTRIBUTE_DEPRECATED(LoadInst *CreateLoad(Value *Ptr,
const Twine &Name = ""),
"Use the version that explicitly specifies the "
"loaded type instead") {
return CreateLoad(Ptr->getType()->getPointerElementType(), Ptr, Name);
}
// Deprecated [opaque pointer types]
LoadInst *CreateLoad(Value *Ptr, bool isVolatile, const Twine &Name = "") {
LLVM_ATTRIBUTE_DEPRECATED(LoadInst *CreateLoad(Value *Ptr,
bool isVolatile,
const Twine &Name = ""),
"Use the version that explicitly specifies the "
"loaded type instead") {
return CreateLoad(Ptr->getType()->getPointerElementType(), Ptr, isVolatile,
Name);
}
@ -1685,19 +1695,30 @@ public:
}
// Deprecated [opaque pointer types]
LoadInst *CreateAlignedLoad(Value *Ptr, MaybeAlign Align, const char *Name) {
LLVM_ATTRIBUTE_DEPRECATED(LoadInst *CreateAlignedLoad(Value *Ptr,
MaybeAlign Align,
const char *Name),
"Use the version that explicitly specifies the "
"loaded type instead") {
return CreateAlignedLoad(Ptr->getType()->getPointerElementType(), Ptr,
Align, Name);
}
// Deprecated [opaque pointer types]
LoadInst *CreateAlignedLoad(Value *Ptr, MaybeAlign Align,
const Twine &Name = "") {
LLVM_ATTRIBUTE_DEPRECATED(LoadInst *CreateAlignedLoad(Value *Ptr,
MaybeAlign Align,
const Twine &Name = ""),
"Use the version that explicitly specifies the "
"loaded type instead") {
return CreateAlignedLoad(Ptr->getType()->getPointerElementType(), Ptr,
Align, Name);
}
// Deprecated [opaque pointer types]
LoadInst *CreateAlignedLoad(Value *Ptr, MaybeAlign Align, bool isVolatile,
const Twine &Name = "") {
LLVM_ATTRIBUTE_DEPRECATED(LoadInst *CreateAlignedLoad(Value *Ptr,
MaybeAlign Align,
bool isVolatile,
const Twine &Name = ""),
"Use the version that explicitly specifies the "
"loaded type instead") {
return CreateAlignedLoad(Ptr->getType()->getPointerElementType(), Ptr,
Align, isVolatile, Name);
}