diff --git a/gen/functions.cpp b/gen/functions.cpp index a48b6d7724..9fc74e2d1c 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -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); diff --git a/gen/toir.cpp b/gen/toir.cpp index c12d336657..0fcad2a7be 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -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"); diff --git a/gen/typinf.cpp b/gen/typinf.cpp index cb531eb1ef..f9df4a574b 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -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;