From 551bce6d18a5cfab164fa089f7804dc7684b8b33 Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Fri, 3 Jan 2014 12:57:53 +0100 Subject: [PATCH 1/2] Change location of assign to irFty. If the comment about this function is still right (can be called recursively) then the assignment to irFty should be done after all functions are called. Takes advantage of move assignment, too. --- gen/functions.cpp | 8 ++++---- gen/llvmcompat.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index cccb84e6..6c9ecd7a 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -256,15 +256,15 @@ llvm::FunctionType* DtoFunctionType(Type* type, IrFuncTy &irFty, Type* thistype, lidx++; } - // Now we can modify irFty safely. - irFty = newIrFty; - // let the abi rewrite the types as necesary - abi->rewriteFunctionType(f, irFty); + abi->rewriteFunctionType(f, newIrFty); // Tell the ABI we're done with this function type abi->doneWithFunctionType(); + // Now we can modify irFty safely. + irFty = llvm_move(newIrFty); + // build the function type std::vector argtypes; argtypes.reserve(lidx); diff --git a/gen/llvmcompat.h b/gen/llvmcompat.h index 6435153b..f84e93dc 100644 --- a/gen/llvmcompat.h +++ b/gen/llvmcompat.h @@ -32,4 +32,8 @@ #define HAS_ATTRIBUTES(x) (x) #endif +#if LDC_LLVM_VER < 302 +#define llvm_move(value) (value) +#endif + #endif From c85ea7d5f7c3ace0b98fa737dbc1fe05b048f19b Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Fri, 3 Jan 2014 13:49:55 +0100 Subject: [PATCH 2/2] Remove duplicate "sudo" from .travis.yml. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 459ed010..5a57b8a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: cpp install: # LLVM 3.2 - - sudo sudo sh -c "echo 'deb http://archive.ubuntu.com/ubuntu/ precise-proposed restricted main multiverse universe' >> /etc/apt/sources.list" + - sudo sh -c "echo 'deb http://archive.ubuntu.com/ubuntu/ precise-proposed restricted main multiverse universe' >> /etc/apt/sources.list" # LLVM 3.4 snapshots - - sudo sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' >> /etc/apt/sources.list" + - sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' >> /etc/apt/sources.list" - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - # Some random Launchpad PPA for LLVM 3.3, should consder replacing this with