-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Building M680x0-llvm with ```-DLLVM_TARGETS_TO_BUILD="X86;M680x0" fails with:
/local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86CondBrFolding.cpp: In member function ‘void {anonymous}::X86CondBrFolding::replaceBrDest(llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::MachineBasicBlock*)’:
/local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86CondBrFolding.cpp:231:51: error: call of overloaded ‘findDebugLoc(llvm::MachineInstr*&)’ is ambiguous
BuildMI(*MBB, BrMI, MBB->findDebugLoc(BrMI), TII->get(JNCC))
^
In file included from /local_scratch/glaubitz/M680x0-llvm/include/llvm/CodeGen/TargetRegisterInfo.h:23,
from /local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86RegisterInfo.h:17,
from /local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86InstrInfo.h:19,
from /local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86CondBrFolding.cpp:47:
/local_scratch/glaubitz/M680x0-llvm/include/llvm/CodeGen/MachineBasicBlock.h:729:12: note: candidate: ‘llvm::DebugLoc llvm::MachineBasicBlock::findDebugLoc(llvm::MachineBasicBlock::iterator)’
DebugLoc findDebugLoc(iterator MBBI) {
^~~~~~~~~~~~
/local_scratch/glaubitz/M680x0-llvm/include/llvm/CodeGen/MachineBasicBlock.h:733:12: note: candidate: ‘llvm::DebugLoc llvm::MachineBasicBlock::findDebugLoc(llvm::MachineBasicBlock::reverse_iterator)’
DebugLoc findDebugLoc(reverse_iterator MBBI) {
^~~~~~~~~~~~
/local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86CondBrFolding.cpp: In member function ‘void {anonymous}::X86CondBrFolding::fixupModifiedCond(llvm::MachineBasicBlock*)’:
/local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86CondBrFolding.cpp:257:71: error: call of overloaded ‘findDebugLoc(llvm::MachineInstr*&)’ is ambiguous
MachineInstrBuilder MIB = BuildMI(*MBB, BrMI, MBB->findDebugLoc(BrMI),
^
In file included from /local_scratch/glaubitz/M680x0-llvm/include/llvm/CodeGen/TargetRegisterInfo.h:23,
from /local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86RegisterInfo.h:17,
from /local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86InstrInfo.h:19,
from /local_scratch/glaubitz/M680x0-llvm/lib/Target/X86/X86CondBrFolding.cpp:47:
/local_scratch/glaubitz/M680x0-llvm/include/llvm/CodeGen/MachineBasicBlock.h:729:12: note: candidate: ‘llvm::DebugLoc llvm::MachineBasicBlock::findDebugLoc(llvm::MachineBasicBlock::iterator)’
DebugLoc findDebugLoc(iterator MBBI) {
^~~~~~~~~~~~
/local_scratch/glaubitz/M680x0-llvm/include/llvm/CodeGen/MachineBasicBlock.h:733:12: note: candidate: ‘llvm::DebugLoc llvm::MachineBasicBlock::findDebugLoc(llvm::MachineBasicBlock::reverse_iterator)’
DebugLoc findDebugLoc(reverse_iterator MBBI) {
^~~~~~~~~~~~
This is fixed by the following trivial patch:
From 755ca2a218341942720c87659830cb105c8478f3 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <[email protected]>
Date: Tue, 22 Jan 2019 01:34:58 +0100
Subject: [PATCH] [x86] Fix ambigious call to findDebugLoc()
---
lib/Target/X86/X86CondBrFolding.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Target/X86/X86CondBrFolding.cpp b/lib/Target/X86/X86CondBrFolding.cpp
index 7ce443c4656..6a3a4d7627b 100644
--- a/lib/Target/X86/X86CondBrFolding.cpp
+++ b/lib/Target/X86/X86CondBrFolding.cpp
@@ -228,7 +228,7 @@ void X86CondBrFolding::replaceBrDest(MachineBasicBlock *MBB,
BrMI = MBBInfo->BrInstr;
unsigned JNCC = GetCondBranchFromCond(MBBInfo->BranchCode);
MachineInstrBuilder MIB =
- BuildMI(*MBB, BrMI, MBB->findDebugLoc(BrMI), TII->get(JNCC))
+ BuildMI(*MBB, BrMI, MBB->findDebugLoc((llvm::MachineBasicBlock::iterator) BrMI), TII->get(JNCC))
.addMBB(NewDest);
MBBInfo->TBB = NewDest;
MBBInfo->BrInstr = MIB.getInstr();
@@ -254,7 +254,7 @@ void X86CondBrFolding::fixupModifiedCond(MachineBasicBlock *MBB) {
MachineInstr *BrMI = MBBInfo->BrInstr;
X86::CondCode CC = MBBInfo->BranchCode;
- MachineInstrBuilder MIB = BuildMI(*MBB, BrMI, MBB->findDebugLoc(BrMI),
+ MachineInstrBuilder MIB = BuildMI(*MBB, BrMI, MBB->findDebugLoc((llvm::MachineBasicBlock::iterator) BrMI),
TII->get(GetCondBranchFromCond(CC)))
.addMBB(MBBInfo->TBB);
BrMI->eraseFromParent();
--
2.20.1Metadata
Metadata
Assignees
Labels
No labels