From 157a97a6a01424551748ace05bd9c0931e98aefe Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sat, 18 Jan 2014 22:54:33 +0000 Subject: [PATCH] Support AddrSpaceCast in ConstantExpr::getAsInstruction. It's handled similarly to the other casts. CastInst::Create already knows how to handle it. llvm-svn: 199565 --- llvm/lib/IR/Constants.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index dbb3495583bc..1f6f5ac4270c 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -2783,6 +2783,7 @@ Instruction *ConstantExpr::getAsInstruction() { case Instruction::PtrToInt: case Instruction::IntToPtr: case Instruction::BitCast: + case Instruction::AddrSpaceCast: return CastInst::Create((Instruction::CastOps)getOpcode(), Ops[0], getType()); case Instruction::Select: