summaryrefslogtreecommitdiffstats
path: root/clang/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
commit05500ba6ecc477b596c64279d7f5f1a353485b16 (patch)
tree1d2eed3798fb81a7e080aa07a651fe0f8936eab9 /clang/lib/CodeGen/CGStmt.cpp
parent3bc84ca376a29e883d09c03b25127c3993cdf55a (diff)
downloadbcm5719-llvm-05500ba6ecc477b596c64279d7f5f1a353485b16.tar.gz
bcm5719-llvm-05500ba6ecc477b596c64279d7f5f1a353485b16.zip
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. llvm-svn: 136438
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index 60db07d388a..9987fd900b9 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/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 =
OpenPOWER on IntegriCloud