mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 16:11:08 +03:00
Remove STRUCTTHISREF
This commit is contained in:
parent
1e4a8fffc2
commit
c3801d65f5
3 changed files with 1 additions and 27 deletions
|
@ -90,28 +90,12 @@ llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nesttype,
|
|||
llvm::AttrBuilder().addAttribute(llvm::Attributes::StructRet)
|
||||
.addAttribute(llvm::Attributes::NoAlias)
|
||||
#endif
|
||||
#if !STRUCTTHISREF
|
||||
// In D2 where 'this' in structs is a reference, nocapture
|
||||
// might not actually be applicable, even if it probably still
|
||||
// is for all sane code from a high-level semantic standpoint.
|
||||
// Specifying nocapture on a parameter but then passing it as a
|
||||
// non-nocapture argument in a function call can lead to
|
||||
// _silent_ miscompilations (especially in the GVN pass).
|
||||
#if LDC_LLVM_VER >= 303
|
||||
.addAttribute(llvm::Attribute::NoCapture)
|
||||
#else
|
||||
.addAttribute(llvm::Attributes::NoCapture)
|
||||
#endif
|
||||
#endif
|
||||
#if LDC_LLVM_VER == 302
|
||||
)
|
||||
#endif
|
||||
);
|
||||
#else
|
||||
fty.arg_sret = new IrFuncTyArg(rt, true, StructRet | NoAlias
|
||||
#if !STRUCTTHISREF
|
||||
| NoCapture
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
rt = Type::tvoid;
|
||||
|
@ -1010,9 +994,7 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
|||
assert(thisvar);
|
||||
|
||||
LLValue* thismem = thisvar;
|
||||
#if STRUCTTHISREF
|
||||
if (!f->fty.arg_this->byref)
|
||||
#endif
|
||||
{
|
||||
thismem = DtoRawAlloca(thisvar->getType(), 0, "this"); // FIXME: align?
|
||||
DtoStore(thisvar, thismem);
|
||||
|
|
|
@ -1514,11 +1514,7 @@ DValue* ThisExp::toElem(IRState* p)
|
|||
} else
|
||||
if (vdparent != p->func()->decl) {
|
||||
Logger::println("nested this exp");
|
||||
#if STRUCTTHISREF
|
||||
return DtoNestedVariable(loc, type, vd, type->ty == Tstruct);
|
||||
#else
|
||||
return DtoNestedVariable(loc, type, vd);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
Logger::println("normal this exp");
|
||||
|
|
|
@ -640,13 +640,9 @@ void TypeInfoStructDeclaration::llvmDefine()
|
|||
{
|
||||
Scope sc;
|
||||
Parameters *arguments = new Parameters;
|
||||
#if STRUCTTHISREF
|
||||
|
||||
// arg type is ref const T
|
||||
Parameter *arg = new Parameter(STCref, tc->constOf(), NULL, NULL);
|
||||
#else
|
||||
// arg type is const T*
|
||||
Parameter *arg = new Parameter(STCin, tc->pointerTo(), NULL, NULL);
|
||||
#endif
|
||||
arguments->push(arg);
|
||||
tfcmpptr = new TypeFunction(arguments, Type::tint32, 0, LINKd);
|
||||
tfcmpptr->mod = MODconst;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue