mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 16:11:08 +03:00
Merge branch 'merge-2.064' into merge-2.065
This commit is contained in:
commit
09da15be0f
1 changed files with 14 additions and 4 deletions
|
@ -148,8 +148,17 @@ llvm::FunctionType* DtoFunctionType(Type* type, IrFuncTy &irFty, Type* thistype,
|
||||||
{
|
{
|
||||||
#if LDC_LLVM_VER >= 303
|
#if LDC_LLVM_VER >= 303
|
||||||
llvm::AttrBuilder attrBuilder;
|
llvm::AttrBuilder attrBuilder;
|
||||||
if (isCtor)
|
// Issue 624: In case of a ctor 'this' is passed to the function and is also
|
||||||
attrBuilder.addAttribute(llvm::Attribute::Returned);
|
// the return value. This could be a perfect case for the 'Returned' attribute.
|
||||||
|
// However the 'this' type and the return type are transformed in different
|
||||||
|
// ways, making them bitcast incompatible.
|
||||||
|
// Example: extern(C): struct Value { this(string) {} string s; }
|
||||||
|
// return type: { i64, i64 }
|
||||||
|
// this type: %ldc_github_624.Value*
|
||||||
|
// FIXME: (1) Investigate why the types are handled in different ways
|
||||||
|
// (2) The attributes are cleared by some abi implementations
|
||||||
|
// if (isCtor)
|
||||||
|
// attrBuilder.addAttribute(llvm::Attribute::Returned);
|
||||||
#endif
|
#endif
|
||||||
newIrFty.arg_this = new IrFuncTyArg(thistype, thistype->toBasetype()->ty == Tstruct
|
newIrFty.arg_this = new IrFuncTyArg(thistype, thistype->toBasetype()->ty == Tstruct
|
||||||
#if LDC_LLVM_VER >= 303
|
#if LDC_LLVM_VER >= 303
|
||||||
|
@ -919,8 +928,9 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
||||||
|
|
||||||
if (fd->ir.defined) return;
|
if (fd->ir.defined) return;
|
||||||
|
|
||||||
// Skip generating code if this part of a TemplateInstance that is instantiated
|
// Skip generating code for this part of a TemplateInstance if it has been
|
||||||
// only by non-root modules (i.e. modules not listed on the command line).
|
// instantiated by any non-root module (i.e. a module not listed on the
|
||||||
|
// command line).
|
||||||
// See DMD's FuncDeclaration::toObjFile. Check this before calling
|
// See DMD's FuncDeclaration::toObjFile. Check this before calling
|
||||||
// DtoDeclareFunction DtoDeclareFunction to avoid touching unanalyzed code.
|
// DtoDeclareFunction DtoDeclareFunction to avoid touching unanalyzed code.
|
||||||
TemplateInstance *ti = fd->isInstantiated();
|
TemplateInstance *ti = fd->isInstantiated();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue