mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 06:30:39 +03:00
Avoid deprecations with LLVM 18 wrt. renamed llvm::StringRef::{starts,ends}with()
This commit is contained in:
parent
e728075594
commit
3beb68904f
9 changed files with 70 additions and 0 deletions
|
@ -901,6 +901,10 @@ bool eraseDummyAfterReturnBB(llvm::BasicBlock *bb) {
|
|||
* to be found.
|
||||
*/
|
||||
void emulateWeakAnyLinkageForMSVC(IrFunction *irFunc, LINK linkage) {
|
||||
#if LDC_LLVM_VER >= 1800
|
||||
#define startswith starts_with
|
||||
#endif
|
||||
|
||||
LLFunction *func = irFunc->getLLVMFunc();
|
||||
|
||||
const bool isWin32 = global.params.targetTriple->isArch32Bit();
|
||||
|
@ -952,6 +956,10 @@ void emulateWeakAnyLinkageForMSVC(IrFunction *irFunc, LINK linkage) {
|
|||
// declaration
|
||||
irFunc->setLLVMFunc(newFunc);
|
||||
func->replaceNonMetadataUsesWith(newFunc);
|
||||
|
||||
#if LDC_LLVM_VER >= 1800
|
||||
#undef startswith
|
||||
#endif
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue