Skip to content

Commit

Permalink
Change location of assign to irFty.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
redstar committed Jan 3, 2014
1 parent 535221e commit 551bce6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gen/functions.cpp
Expand Up @@ -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<LLType*> argtypes;
argtypes.reserve(lidx);
Expand Down
4 changes: 4 additions & 0 deletions gen/llvmcompat.h
Expand Up @@ -32,4 +32,8 @@
#define HAS_ATTRIBUTES(x) (x)
#endif

#if LDC_LLVM_VER < 302
#define llvm_move(value) (value)
#endif

#endif

0 comments on commit 551bce6

Please sign in to comment.