[pkg-d-commits] [ldc] 95/211: Merge pull request #1824 from kinke/inplaceIR
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:36:13 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.1.0
in repository ldc.
commit 10b85feba42e0d71ce75e4f5f13ef039f258c931
Merge: bb2b648 7a0bba0
Author: Johan Engelen <jbc.engelen at gmail.com>
Date: Sun Oct 16 12:40:49 2016 +0200
Merge pull request #1824 from kinke/inplaceIR
Fix in-place construction of structs returned by inline assembly
gen/inlineir.cpp | 15 ++++++++++-----
gen/inlineir.h | 4 +++-
gen/llvmhelpers.h | 3 ++-
gen/naked.cpp | 19 ++++++++++++-------
gen/toir.cpp | 4 ++--
tests/codegen/in_place_construct_asm.d | 14 ++++++++++++++
6 files changed, 43 insertions(+), 16 deletions(-)
diff --cc gen/naked.cpp
index 6fcf98c,887d9dd..6049f27
--- a/gen/naked.cpp
+++ b/gen/naked.cpp
@@@ -431,16 -431,10 +431,16 @@@ DValue *DtoInlineAsmExpr(Loc &loc, Func
}
// build asm function type
- Type *type = fd->type->nextOf()->toBasetype();
- LLType *ret_type = DtoType(type);
+ Type *type = fd->type->nextOf();
+ LLType *ret_type = DtoType(type->toBasetype());
llvm::FunctionType *FT = llvm::FunctionType::get(ret_type, argtypes, false);
+ // make sure the constraints are valid
+ if (!llvm::InlineAsm::Verify(FT, constraints)) {
+ e->error("__asm constraint argument is invalid");
+ fatal();
+ }
+
// build asm call
bool sideeffect = true;
llvm::InlineAsm *ia = llvm::InlineAsm::get(FT, code, constraints, sideeffect);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git
More information about the pkg-d-commits
mailing list