[PATCH] [VER 2] replace llvm_unreachable call with emitError in SIInstrInfo::copyPhysReg

David Blaikie dblaikie at gmail.com
Fri Apr 11 15:16:10 PDT 2014


On Fri, Apr 11, 2014 at 2:09 PM, Tom Stellard <thomas.stellard at amd.com> wrote:
> From: Darren <darren.powell at amd.com>
>
> ---
>  lib/Target/R600/SIInstrInfo.cpp | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/lib/Target/R600/SIInstrInfo.cpp b/lib/Target/R600/SIInstrInfo.cpp
> index b19ff98..6d22c1b 100644
> --- a/lib/Target/R600/SIInstrInfo.cpp
> +++ b/lib/Target/R600/SIInstrInfo.cpp
> @@ -19,6 +19,8 @@
>  #include "SIMachineFunctionInfo.h"
>  #include "llvm/CodeGen/MachineInstrBuilder.h"
>  #include "llvm/CodeGen/MachineRegisterInfo.h"
> +#include "llvm/IR/Function.h"
> +#include "llvm/IR/LLVMContext.h"
>  #include "llvm/MC/MCInstrDesc.h"
>
>  using namespace llvm;
> @@ -153,7 +155,10 @@ SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
>      SubIndices = Sub0_15;
>
>    } else {
> -    llvm_unreachable("Can't copy register!");
> +    const MachineFunction *MF = MBB.getParent();
> +    LLVMContext &Ctx = MF->getFunction()->getContext();
> +
> +    Ctx.emitError(Twine("SIInstrInfo::copyPhysReg - Can't copy register!"));

I wouldn't've thought the explicit "Twine(...)" would be necessary
here. Unless there's an extra user defined conversion here, that would
be surprising.

>    }
>
>    while (unsigned SubIdx = *SubIndices++) {
> --
> 1.8.3.2
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list