2013-04-10  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-decls.cc(FuncDeclaration::toSymbol): Harden logic for marking
	functions pure as in 'has no side effects'.

2013-04-07  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-decls.cc(FuncDeclaration::toSymbol): Push deferred functions to
	FuncDeclaration::deferred.
	* d-elem.cc(DelegateExp::toElem): Likewise.
	(FuncExp::toElem): Likewise.
	* d-objfile.cc(ObjectFile::shouldEmit): Likewise.
	(FuncDeclaration::toObjFile): Process all deferred functions in
	FuncDeclaration::deferred.
	* symbol.cc(Symbol::deferredNestedFuncs): Remove.

2013-04-05  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-elem.cc(FuncExp::toElem): Defer function literals and lambdas
	until parent function has finished processing.

2013-04-04  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(IRState::buildChain): Use __frame decl directly when
	setting up the function frame.
	(maybe_set_builtin_frontend): Exit early if symbol has no parent.
	* d-decls.cc(FuncDeclaration::toSymbol): Defer all nested functions,
	not just templated instances.
	* d-objfile.cc(FuncDeclaration::toObjFile): Delay processed deferred
	nested functions until function has finished being generated.
	(ObjectFile::shouldEmit): Don't emit nested functions if the parent
	function hasn't finished processing.

2013-04-03  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(maybe_set_builtin_frontend): Merged from
	maybe_set_builtin and maybe_set_libcall.
	* d-decls.cc(FuncDeclaration::toSymbol): Use
	maybe_set_builtin_frontend.

2013-03-31  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-lang.cc(d_init_options): Default module info emission to on.
	(d_handle_option): New femit-moduleinfo switch.
	* d-objfile.cc(Module::genobjfile): Don't emit module if disabled
	explicitly.
	* d-builtins(is_intrinsic_module_p): New function to test whether
	module is core.bitops.
	(is_math_module_p): New function to test whether module is std.math or
	core.stdc.math.
	(is_builtin_va_arg_p): New function to test whether symbol is
	specially handled va_arg template.
	(is_builtin_va_start_p): New function to test whether symbol is
	specially handled va_start template.
	* d-codegen.cc(IRState::binding): Replace with bind_expr.
	(IRState::mathModule): Replace with std_math_module.
	(IRState::mathCoreModule): Replace with core_math_module.
	(IRState::intrinsicModule): Replace with std_intrinsic_module.
	(IRState::cstdargTemplateDecl): Replace with va_arg_template.
	(IRState::stdargTemplateDecl): Replace with va_arg2_template.
	(IRState::cstdargStartTemplateDecl): Replace with va_start_template.
	(IRState::getLibCallDecl): Replace with get_libcall.
	(IRState::maybeSetLibCallDecl): Replace with maybe_set_libcall.
	(IRState::libCall): Replace with build_libcall.
	(IRState::maybeSetUpBuiltin): Replace with maybe_set_builtin.
	(IRState::Intrinsic): Move enum out of IRState.

2013-03-30  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(IRState::darrayPtrRef): Replace with d_array_ptr.
	(IRState::darrayLenRef): Replace with d_array_length.
	(IRState::darrayVal): Replace with d_array_value.
	(IRState::darrayString): Replace with d_array_string.
	(IRState::arrayLength): Replace with get_array_length.
	(get_object_method): Remove dependancy on irs parameter.
	* d-lang.cc(d_init): Use static bool std_inc to determine whether to
	include standard module paths.
	(d_post_options): Canonicalize the input filename.
	(d_parse_file): Correctly catch cases where input file is stdin.

2013-03-27  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(IRState::getFrameInfo) Create a custom static chain for
	all nested functions.
	* d-gcc-includes.h: Rename to d-system.h

2013-03-24  Iain Buclaw  <ibuclaw@gdcproject.org>

	* GDC 4.8 branch created.

2013-03-23  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-builtins.c(d_bi_init): Set REALPAD to be TYPE_PRECISION of
	long_double_type_node.
	* d-codegen.cc(IRState::twoFieldType): Replace with
	build_two_field_type.
	(IRState::arrayOpNotImplemented): Replace with unhandled_arrayop_p.
	(IRState::delegateMethodRef): Replace with delegate_method.
	(IRState::delegateObjectRef): Replace with delegate_object.
	(IRState::delegateVal): Replace with build_delegate_cst.
	(IRState::methodCallExpr): Replace with build_method_call.
	(IRState::extractMethodCallExpr): Replace with
	extract_from_method_call.
	(IRState::objectInstanceMethod): Replace with get_object_method.
	(IRState::twoFieldCtor): Remove.
	(IRState::call): Assert that if calling a normal FUNCTION_TYPE,
	'object' is not set.
	* d-ctype.cc(TypeDelegate::toCtype): Build a METHOD_TYPE for the .func
	field type in delegates.
	* d-lang.h(D_IS_METHOD_CALL_EXPR): Rename to D_METHOD_CALL_EXPR.
	* d-objfile.cc(FuncDeclaration::toObjFile): Remove assert for chain
	function.

2013-03-20  Johannes Pfau  <johannespfau@gmail.com>

	* d-codegen.cc(IRState::objectInstanceMethod): Recursively check
	for TOKsuper / TOKdottype. Do not ignore CastExp.
	* d-elem.cc(IdentityExp::toElem): Ignore padding in bitwise floating
	point comparisons.
	* testsuite: Cleanup. Remove invalid tests, adjust tests, etc. 

2013-03-20  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(IRState::objectInstanceMethod): Get function pointer
	off function TREE_TYPE.
	(build_deref): Handle cases where expression to dereference is an
	address expression.
	(modify_expr): New function overload to set return type directly.
	* d-elem.cc(CatAssignExp::toElem): Use new modify_expr.
	(AssignExp::toElem): Likewise.
	* d-decls.cc(FuncDeclaration::toSymbol): Don't build a method type for
	nested functions / delegates.  Just add on the hidden 'this' pointer
	containing the custom static chain/closure object.

	* d-codegen.cc(GlobalValues): Replace with current_module,
	current_irs, object_file.
	(IRState::getFuncType): Replace with get_function_type.
	(IRState::isCallByAlias): Replace with call_by_alias_p.
	(IRState::isFuncType): Replace with function_type_p.
	(IRState::doExp): Remove.

	* d-asmstmt.cc(ExtAsmStatement::syntaxCopy): Use arraySyntaxCopy to
	copy front end expressions.

	* d-codegen.cc(AssignExp::toElem): Call _d_arrayassign / _d_arrayctor
	when assigning arrays of structs.

2013-03-18  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(IRState::realPart): Replace with real_part.
	(IRState::imagPart): Replace with imaginary_part.
	(IRState::integerConstant): Replace with build_integer_cst.
	(IRState::floatConstant): Replace with build_float_cst.
	(IRState::hwi2toli): Replace with cst_to_hwi.
	(IRState::addressOf): Replace with build_address.
	(IRState::markAddressable): Replace with d_mark_addressable.
	(IRState::markUsed): Replace with d_mark_used.
	(IRState::markRead): Replace with d_mark_read.
	(IRState::indirect): Replace with indirect_ref.
	(IRState::pvoidOkay): Replace with void_okay_p.
	(IRState::maybeCompound): Replace with maybe_compound_expr.
	(IRState::maybeVoidCompound): Replace with maybe_vcompound_expr.
	(IRState::isErrorMark): Replace with error_mark_p.
	(IRState::getTargetSizeConst): Replace with tree_to_hwi.
	(IRState::modify): Replace with modify_expr.
	(IRState::vmodify): Replace with vmodify_expr.
	(IRState::vinit): Replace with build_vinit.
	(IRState::nop): Replace with build_nop.
	(IRState::vconvert): Replace with build_vconvert.
	(IRState::boolOp): Replace with build_boolop.
	(IRState::compound): Replace with compound_expr.
	(IRState::voidCompound): Replace with vcompound_expr.
	(IRState::component): Replace with component_ref.
	(IRState::errorMark): Replace with error_mark.
	(IRState::typesSame): Replace with d_types_same.
	(IRState::typesCompatible): Replace with d_types_compatible.
	(IRState::getDType): Replace with build_dtype.
	(IRState::getObjectType): Replace with build_object_type.
	(IRState::isDeclarationReferenceType): Replace with decl_reference_p.
	(IRState::trueDeclarationType): Replace with declaration_type.
	(IRState::isArgumentReferenceType): Replace with arg_reference_p.
	(IRState::trueArgumentType): Replace with type_passed_as.
	(IRState::arrayType): Replace with d_array_type.
	(IRState::addTypeAttribute): Replace with insert_type_attributes.
	(IRState::addDeclAttribute): Replace with insert_decl_attributes.
	(IRState::attributes): Replace with build_attributes.
	(IRState::addTypeModifiers): Replace with insert_type_modifiers.
	(IRState::maybeMakeTemp): Replace with maybe_make_temp.
	(IRState::isFreeOfSideEffects): Replace with d_has_side_effects.
	(IRState::pointerOffsetOp): Replace with build_offset_op.
	(IRState::pointerOffset): Replace with build_offset.
	(IRState::buildCall): Replace with d_build_call.
	(IRState::exceptionObject): Replace with build_exception_object.

2013-03-17  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-asmstmt.cc(d_build_asm_stmt): Remove.
	(ExtAsmStatement::ExtAsmStatement): Update to match renamed members.
	(ExtAsmStatement::syntaxCopy): Likewise.
	(ExtAsmStatement::semantic): Likewise.
	(ExtAsmStatement::toCBuffer): Likewise.
	(ExtAsmStatement::comeFrom): New.
	(ExtAsmStatement::blockExit): Don't error if must not throw.
	(naturalString): Remove.
	(ExtAsmStatement::toIR): Inline IRState::doAsm implementation.
	* d-codegen.cc(IRState::doAsm): Remove.
	* d-decls.cc(FuncDeclaration::toSymbol): Don't generate 'naked'
	attribute.
	(binfo_for): Move into d-decls.cc.
	(intfc_binfo_for): Likewise.
	(ClassDeclaration::toDebug): Likewise.
	(EnumDeclaration::toDebug): Likewise.
	(TypedefDeclaration::toDebug): Likewise.
	(StructDeclaration::toDebug): Likewise.
	* d-objfile.cc(FuncDeclaration::toObjFile): Move into d-objfile.cc.
	(FuncDeclaration::buildClosure): Likewise.
	(Module::genobjfile): Likewise.
	* d-glue.cc: Remove file.

2013-03-16  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-ir.cc(SynchronizedStatement::toIR): Remove implementation as is
	now handled by the frontend.

2013-03-15  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(IRState::maybeExpandSpecialCall): Handle ref argptr
	arguments.

2013-03-13  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-builtins.c(handle_alias_attribute): New function to handle
	internal 'alias' attribute.
	(handle_weakref_attribute): New function to handle internal 'weakref'
	attribute.
	* d-objfile.cc(ObjectFile::outputThunk): Define thunks to external
	symbols as weakref, alias

2013-03-12  Johannes Pfau  <johannespfau@gmail.com>

	* patch-versym-os-4.8.x(mingw32.h): Fix typo
	* patch-versym-cpu-4.8.x(mips.h): Fix typo
	Update version symbols to latest dlang specification.

2013-03-10  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-decls.cc(FuncDeclaration::toSymbol): Delay setting TREE_TYPE as
	function type could be hidden in a nested function not yet built.
	* d-codegen.cc(IRState::findThis): Don't get 'this' from outer
	function if it's a closure type.  This has already been handled by
	IRState::getFrameForSymbol.
	(IRState::buildChain): Give frame decl debug name '__frame'.
	Always set '__chain' link field.
	(IRState::getFrameInfo): Don't build a frame for all nested functions.
	Search through nested aggregates for static chain in outer functions.
	* d-codegen.h(IRState::useParentChain): Remove.
	* d-glue.cc(FuncDeclaration::toObjFile): Don't call useParentChain.
	Don't create a local var for the chain link for a function.
	(FuncDeclaration::buildClosure): Always set '__chain' link field.

2013-03-08  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(d_gcc_force_templates): Only check for emitting
	templates as private.
	* d-lang.cc(d_handle_option): Remove -femit-templates= option.
	* d-objfile.cc(ObjectFile::makeDeclOneOnly): Fix code logic so
	fallback method could be reached.
	* d-objfile.h(TEall, TEauto): Remove.

2013-03-07  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-ir.cc(ReturnStatement::toIR): Don't call postblit on return.
	* d-codegen.cc(IRState::trueDeclarationType): Don't set
	D_TYPE_ADDRESSABLE.
	(IRState::makeTemp): Remove.
	(IRState::maybeMakeTemp): Copy makeTemp into function.
	* d-glue.cc(d_genericize): Remove D_TYPE_ADDRESSABLE handling.
	* d-lang.h(D_TYPE_ADDRESSABLE): Remove macro.

2013-03-04  Johannes Pfau  <johannespfau@gmail.com>

	* d-ctype.cc(Type::toCtype): Always call gen.addTypeModifiers to
	make sure TYPE_MAIN_VARIANT is set. Reuse tree from unqualified
	variant for that. Also cache the resulting qualified tree.
	(TypeTypedef::toCtype): Likewise.
	(TypeEnum::toCtype): Likewise.
	(TypeStruct::toCtype): Likewise.
	(TypeFunction::toCtype): Likewise.
	(TypeVector::toCtype): Likewise.
	(TypeSArray::toCtype): Likewise.
	(TypeDArray::toCtype): Likewise.
	(TypeAArray::toCtype): Likewise.
	(TypeDelegate::toCtype): Likewise.
	(TypeClass::toCtype): Likewise.
	* d-objfile.cc(ObjectFile::giveDeclUniqueName): Make sure DECL_NAME is set

2013-03-01  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-decls.cc(VarDeclaration::toSymbol): Remove use of c_ident.
	(FuncDeclaration::toSymbol): Likewise.
	* d-builtins.c(handle_noreturn_attribute): Assert that this is only
	used for internal purposes.
	(handle_const_attribute): Likewise.
	(handle_malloc_attribute): Likewise.
	(handle_pure_attribute): Likewise.
	(handle_nonnull_attribute): Likewise.
	(handle_nothrow_attribute): Likewise.
	(handle_sentinel_attribute): Likewise.
	(handle_transaction_pure_attribute): Likewise.
	(handle_returns_twice_attribute): Likewise.
	* d-glue.cc(FuncDeclaration::toObjFile): Result variables have no
	default initialiser.
	* d-codegen.cc(IRState::emitLocalVar): Add in assert that the local
	variable has no initialiser if called with no_init = true.
	(IRState::getLibCallDecl): Mark exceptional library functions as
	noreturn.
	(IRState::attributes): Gracefully handle @attribute, and
	@attribute(null).

2013-02-28  Jernej Krempus  <jkrempus@gmail.com>

	* d-builtins.c(d_attribute_table): Renamed it to
	d_builtins_attribute_table.
	* d-lang.cc(d_attribute_table): Added an empty table	
	* d-lang.cc(LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Defined it as
	d_builtins_attribute_table.
	* d-lang.h(d_builtins_attribute_table): Added a declaration.
	* d-codegen.cc(IRState::attributes): Changed it so it goes through
	in_attrs and looks for any @gcc.attribute.attribute("attr_name").
	* d-objfile.cc(ObjectFile::setupSymbolStorage): Pass userAttributes
	instead of attributes in all calls to IRState::attributes.
	* d-ctype.cc(TypeTypedef::toCtype): Likewise.
	(TypeEnum::toCtype): Likewise.
	(TypeStruct::toCtype): Likewise.
	(TypeClass::toCtype): Likewise.
	* libphobos/libdruntime/gcc/attribute.d: New file.

2013-02-28  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-lang.cc(d_handle_option): Remove OPT_fdeprecated and
	OPT_Wsign_compare, add handling for OPT_Wdeprecated.
	(d_post_options): Handle Wdeprecated and Werror switch combination.

2013-02-27  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc(ArrayScope::ArrayScope): Don't setup length var if its
	value is known at compile time.
	(ArrayScope::setArrayExp): Likewise.
	* d-decls.cc(uniqueName): Remove function.
	(VarDeclaration::toSymbol): Set decl assembler name directly.
	(FuncDeclaration::toSymbol): Likewise.

2013-02-15  Iain Buclaw  <ibuclaw@gdcproject.org>

	* Make-lang.in(GDC_EXTENDED_ASM_SYNTAX): Remove macro.

2013-02-14  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-lang.h(D_DECL_IS_CONTRACT): Remove macro.
	* d-decls.cc(FuncDeclaration::toSymbol): Likewise.

2013-02-13  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-lang.cc(d_gcc_is_target_win32): Remove.
	(d_add_builtin_version): New function to handle define_builtin
	callback from backend.
	* d-codegen.cc(IRState::maybeExpandSpecialCall): Remove intrinsic bt.

	* d-builtins.c: Merge with d-builtins2.cc.
	* d-builtins2.cc: Remove.

2013-02-07  Johannes Pfau  <johannespfau@gmail.com>

	* d-lang.cc(d_init): Use gcc's config system for predefined OS versions.
	* setup-gcc.sh: Likewise.
	* target-ver-syms.sh: Likewise.

2013-02-05  Iain Buclaw  <ibuclaw@ubuntu.com>

	* d-builtins2.cc(gcc_type_to_d_type): Remove STRUCTTHISREF condition.
	* d-decls.cc(FuncDeclaration::toSymbol): Likewise.
	* d-elem.cc(ThisExp::toElem): Likewise.
	* d-ctype.cc(TypeSArray::toCtype): Remove SARRAYVALUE condition.
	* d-codegen.cc(IRState::isDeclarationReferenceType): Likewise.
	(IRState::isArgumentReferenceType): Likewise.

2013-02-01  Johannes Pfau  <johannespfau@gmail.com>

	* d-lang.cc(d_init): Use gcc's config system for predefined CPU versions.
	(d_init): Fix definition of D_LP64 version.
	* setup-gcc.sh: Likewise.
	* target-ver-syms.sh: Likewise.

