aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-07-29 00:24:50 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-07-29 00:24:50 +0000
commit93f1322684e928a559286ba1c7cb83af077aa658 (patch)
treeb4fa0cc965438ebfb319f8207edae00f30b39f74 /lib/CodeGen/CGStmt.cpp
parent9aab1489866a5afe1a8a3267f9ad7124034fd644 (diff)
Fix assertion failure in CodeGen where the input operand to an asm
instruction is tied to an output operand which is a pointer, and the input operand is narrower than the output operand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 60db07d388..9987fd900b 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -1533,8 +1533,12 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
llvm::Type *OutputTy = ConvertType(OutputType);
if (isa<llvm::IntegerType>(OutputTy))
Arg = Builder.CreateZExt(Arg, OutputTy);
- else
+ else if (isa<llvm::PointerType>(OutputTy))
+ Arg = Builder.CreateZExt(Arg, IntPtrTy);
+ else {
+ assert(OutputTy->isFloatingPointTy() && "Unexpected output type");
Arg = Builder.CreateFPExt(Arg, OutputTy);
+ }
}
}
if (llvm::Type* AdjTy =