doc: "used" attribute saves decls from linker garbage collection
[gcc.git] / gcc / d / ChangeLog-2012
1 2013-02-15 Iain Buclaw <ibuclaw@gdcproject.org>
2
3 * Make-lang.in (GDC_EXTENDED_ASM_SYNTAX): Remove macro.
4
5 2013-02-14 Iain Buclaw <ibuclaw@gdcproject.org>
6
7 * d-lang.h (D_DECL_IS_CONTRACT): Remove macro.
8 * d-decls.cc (FuncDeclaration::toSymbol): Likewise.
9
10 2013-02-13 Iain Buclaw <ibuclaw@gdcproject.org>
11
12 * d-lang.cc (d_gcc_is_target_win32): Remove.
13 (d_add_builtin_version): New function to handle define_builtin
14 callback from backend.
15 * d-codegen.cc (IRState::maybeExpandSpecialCall): Remove intrinsic bt.
16
17 * d-builtins.c: Merge with d-builtins2.cc.
18 * d-builtins2.cc: Remove.
19
20 2013-02-07 Johannes Pfau <johannespfau@gmail.com>
21
22 * d-lang.cc (d_init): Use gcc's config system for predefined OS versions.
23 * setup-gcc.sh: Likewise.
24 * target-ver-syms.sh: Likewise.
25
26 2013-02-05 Iain Buclaw <ibuclaw@ubuntu.com>
27
28 * d-builtins2.cc (gcc_type_to_d_type): Remove STRUCTTHISREF condition.
29 * d-decls.cc (FuncDeclaration::toSymbol): Likewise.
30 * d-elem.cc (ThisExp::toElem): Likewise.
31 * d-ctype.cc (TypeSArray::toCtype): Remove SARRAYVALUE condition.
32 * d-codegen.cc (IRState::isDeclarationReferenceType): Likewise.
33 (IRState::isArgumentReferenceType): Likewise.
34
35 2013-02-01 Johannes Pfau <johannespfau@gmail.com>
36
37 * d-lang.cc (d_init): Use gcc's config system for predefined CPU versions.
38 (d_init): Fix definition of D_LP64 version.
39 * setup-gcc.sh: Likewise.
40 * target-ver-syms.sh: Likewise.
41
42 2012-12-16 Iain Buclaw <ibuclaw@ubuntu.com>
43
44 * d-decls.cc (FuncDeclaration::toSymbol): Don't optimise PUREconst
45 calls.
46
47 2012-10-27 Iain Buclaw <ibuclaw@ubuntu.com>
48
49 * d-codegen.cc (IRState::buildAssignOp): Handle case where LHS type is
50 not compatible with expression type.
51
52 2012-10-26 Iain Buclaw <ibuclaw@ubuntu.com>
53
54 * d-decls.cc (ClassDeclaration::toSymbol): Use empty RECORD_TYPE to
55 build internal symbol.
56 (Module::toSymbol): Likewise.
57 * d-objfile.cc (outdata): Set type size from constructor if not
58 COMPLETE_TYPE_P. Assert that DECL_INITIAL is never bigger than
59 TYPE_SIZE.
60
61 2012-10-25 Iain Buclaw <ibuclaw@ubuntu.com>
62
63 * d-codegen.cc (IRState::getFrameInfo): Use vthis to determine whether
64 function is nested.
65
66 2012-10-21 Iain Buclaw <ibuclaw@ubuntu.com>
67
68 * d-builtins2.cc (gcc_type_to_d_type): Remove special case for
69 double/long double types.
70 (d_gcc_magic_builtins_module): Cleanup generation of builtin types.
71 Add __builtin_unwind_int and __builtin_unwind_uint.
72
73 2012-10-16 Iain Buclaw <ibuclaw@ubuntu.com>
74
75 * d-objfile.cc (ObjectFile::outputThunk): Mark thunk as DECL_WEAK
76 rather than using weakref attribute.
77
78 2012-10-14 Iain Buclaw <ibuclaw@ubuntu.com>
79
80 * d-bi-attrs.h: Remove file.
81 * d-builtins.c (d_attribute_table): Define table of machine independant
82 attributes for gcc builtins.
83 (d_format_attribute_table): Define table of format attributes for gcc
84 builtins.
85 (handle_noreturn_attribute, handle_leaf_attribute,
86 handle_const_attribute, handle_malloc_attribute,
87 handle_returns_twice_attribute, handle_pure_attribute,
88 handle_novops_attribute, get_nonnull_operand,
89 handle_nonnull_attribute, handle_nothrow_attribute,
90 handle_sentinel_attribute, handle_type_generic_attribute,
91 handle_fnspec_attribute, handle_transaction_pure_attribute,
92 ignore_attribute): Moved common attribute handlers from d-bi-attrs.h.
93 * d-lang.cc (LANG_HOOKS_ATTRIBUTE_TABLE): Use instead of
94 LANG_HOOKS_COMMON_ATTRIBUTE_TABLE.
95 (d_attribute_table): Renamed from d_common_attribute_table.
96 (d_format_attribute_table): Renamed from
97 d_common_format_attribute_table.
98 (d_init_ts): Renamed from d_common_init_ts.
99
100 * d-builtins2.cc (d_bi_init): Determine D frontend type for size_t.
101 * d-objfile.cc (ObjectFile::hasModule): Remove old compatibility
102 macros.
103
104 2012-10-08 Iain Buclaw <ibuclaw@ubuntu.com>
105
106 * d-glue.cc (VectorExp::toElem): Handle non-constant array literals as
107 vector expressions.
108
109 2012-10-04 Iain Buclaw <ibuclaw@ubuntu.com>
110
111 * d-glue.cc (VectorExp::toElem): Handle both array literal as well as
112 single element constructors for vector expressions.
113
114 2012-09-27 Iain Buclaw <ibuclaw@ubuntu.com>
115
116 * d-convert.cc (convert): Remove assert.
117
118 2012-09-22 Iain Buclaw <ibuclaw@ubuntu.com>
119
120 * d-codegen.cc (IRState::maybeCompound): Use IRState::compound.
121 (IRState::maybeVoidCompound): Use IRState::voidCompound.
122 (IRState::call): Check TREE_SIDE_EFFECTS to determine order of
123 evaluation in function calls. Evaluate callee before arguments if has
124 side effects.
125 * d-decls.cc (FuncDeclaration::toSymbol): Don't set any pure/nothrow
126 attributes if asserts are generated in code.
127 * d-incpath (add_fileimp_path): Fix ICE using -J option.
128 * d-objfile.cc (Obj::moduleinfo): Clean-up.
129
130 2012-09-18 Iain Buclaw <ibuclaw@ubuntu.com>
131
132 * d-lang.cc (d_initialize_diagnostics): New function, disable unneeded
133 diagnostic options.
134 (d_handle_option): Remove OPT_fdebug_c.
135 * d-spec.c (lang_specific_driver): Remove OPT_fod_, OPT_fop.
136 * lang.opt: Remove -fdebug-c, -fod, and -fop compiler options.
137
138 2012-09-17 Iain Buclaw <ibuclaw@ubuntu.com>
139
140 * d-codegen.h (CtorEltMaker::cons): Adjust call to VEC_safe_push.
141 * d-objfile.cc (ObjectFile::stripVarDecl): Clean-up.
142
143 2012-09-16 Iain Buclaw <ibuclaw@ubuntu.com>
144
145 * d-codegen.cc (IRState::isCallByAlias): New function.
146 (IRState::call): Use IRState::isCallByAlias.
147 * d-objfile.cc (ObjectFile::setupSymbolStorage): Mark
148 force_static_public symbols as public.
149
150 * d-spec.c (lang_specific_driver): Update for GCC-4.8.
151 * lang.opt: Fix spelling of option -static-libphobos
152
153 * d-codegen.cc (IRState::maybeExpandSpecialCall): Do not handle inp*
154 and outp* port intrinsic functions.
155 (IRState::maybeSetUpBuiltin): Likewise.
156 (IRState::expandPortIntrinsic): Remove.
157
158 2012-09-10 Iain Buclaw <ibuclaw@ubuntu.com>
159
160 * d-codegen.cc (AggLayout::doFields): Propagate volatile out of type.
161 (AggLayout::addField): Likewise.
162 * d-decls.cc (VarDeclaration::toSymbol): Likewise.
163
164 2012-09-06 Iain Buclaw <ibuclaw@ubuntu.com>
165
166 * d-codegen.h (IRState::vconvert): Don't use VIEW_CONVERT_EXPR.
167 * d-glue.cc (TypeEnum::toCtype): Mark TYPE_PACKED if flag_short_enums.
168 (TypeClass::toCtype): Mark TREE_ADDRESSABLE to ensure class is always
169 passed in memory.
170
171 * d-tree.def (UNSIGNED_RSHIFT_EXPR): Define new tree expression.
172 (FLOAT_MOD_EXPR): Define new tree expression.
173 * d-lang.cc (d_common_init_ts): New function.
174 (d_write_global_declarations): Call check_global_declarations after
175 finalize_compilation_unit.
176 (d_gimplify_expr): Handle UNSIGNED_RSHIFT_EXPR, IASM_EXPR.
177 * d-codegen.cc (IRState::arrayOpNotImplemented): New function.
178 (IRState::buildOp): New function.
179 (IRState::buildAssignOp): New function.
180 * d-glue.cc (build_bool_binop): Remove function, mostly move to
181 CmpExp::toElem.
182 (build_math_op): Remove function, mostly move to IRState::buildOp.
183 (build_assign_math_op): Remove function, mostly move to
184 IRState::buildAssignOp.
185 (BinExp::toElemBin): Remove function.
186 (IdentityExp::toElem, EqualExp::toElem, CmpExp::toElem)
187 (AndAndExp::toElem, OrOrExp::toElem): Clean-up, use IRState::boolOp.
188 (XorExp::toElem, OrExp::toElem, AndExp::toElem, UshrExp::toElem)
189 (ShrExp::toElem, ShlExp::toElem, ModExp::toElem, DivExp::toElem)
190 (MulExp::toElem, MinExp::toElem, AddExp::toElem):Use
191 IRState::arrayOpNotImplemented, IRState::buildOp.
192 (XorAssignExp::toElem, OrAssignExp::toElem, AndAssignExp::toElem)
193 (UshrAssignExp::toElem, ShrAssignExp::toElem, ShlAssignExp::toElem)
194 (ModAssignExp::toElem, DivAssignExp::toElem, MulAssignExp::toElem)
195 (MinAssignExp::toElem, AddAssignExp::toElem): Use
196 IRState::arrayOpNotImplemented, IRState::buildAssignOp.
197
198 * d-codegen.cc (libcall_ids): Remove _adCmpChar.
199 (IRState::getLibCallDecl): Remove LIBCALL_ADCMPCHAR.
200 * d-glue.cc (CmpExp::toElem): Don't call LIBCALL_ADCMPCHAR.
201
202 * lang.opt: Define Wcast-result.
203 * d-codegen.cc (IRState::convertTo): Warn about null result, but only
204 if -Wcast-result.
205 (IRState::hwi2toli): Move to header.
206 (IRState::realPart): Likewise.
207 (IRState::imagPart): Likewise.
208 (IRState::toElemLvalue): Clean-up tree args array.
209 (IRState::doArraySet): New function.
210 (IRState::arraySetExpr): New function.
211 * d-glue.cc (EqualExp::toElem): Clean-up tree args array.
212 (CatAssignExp::toElem): Likewise.
213 (AssignExp::toElem): Likewise.
214 (DeleteExp::toElem): Likewise.
215 (NewExp::toElem): Use IRState::modify.
216 (ArrayLiteralExp::toElem): Don't call ARRAYLITERALTX library function
217 if assigning to static array.
218 (StructLiteralExp::toElem): Use IRState::arraySetExpr.
219 (do_array_set): Move to IRState::doArraySet.
220 (array_set_expr): Move to IRState::arraySetExpr.
221
222 * d-lang.h (D_TYPE_IMAGINARY_FLOAT): Define.
223 (d_convert_basic): Remove.
224 * d-builtins.c (d_init_builtins): Mark imaginary types as
225 D_TYPE_IMAGINARY_FLOAT.
226 * d-builtins2.cc (gcc_type_to_d_type): Use convert.
227 * d-codegen.cc (IRState::emitLocalVar): Call pushdecl earlier so
228 catches CONST_DECLs.
229 (IRState::convertTo): Remove handling of conversions between
230 imaginary/real, imaginary/complex, complex/imaginary types, use
231 convert.
232 (IRState::convertForArgument): Use convert.
233 (IRState::arrayElemRef): Likewise.
234 (IRState::call): Likewise.
235 (IRState::libCall): Likewise.
236 (IRState::maybeExpandSpecialCall): Likewise.
237 * d-convert.cc (d_convert_basic): Mark static.
238 (convert): Handle correct conversions between imaginary/real,
239 imaginary/complex, complex/imaginary types.
240 * d-glue.cc (InExp::toElem): Use convert.
241 (BoolExp::toElem): Likewise.
242 (FuncDeclaration::buildClosure): Likewise.
243
244 * d-builtins.c (def_fn_type): Use build_varargs_function_type_array and
245 build_function_type_array to create built-in functions.
246 (d_init_builtins): Use lang_hooks.types.type_for_size.
247 * d-builtins2.cc (d_gcc_magic_builtins_module): Use
248 lang_hooks.types.type_for_mode.
249 * d-codegen.cc (IRState::pointerIntSum): Use
250 lang_hooks.types.type_for_size.
251 (IRState::call): Use lang_hooks.types.type_promotes_to.
252 (IRState::maybeExpandSpecialCall): Likewise.
253 * d-glue.cc (build_math_op): Use lang_hooks.types.type_for_mode.
254 * d-lang.cc (d_type_for_mode): Mark static.
255 (d_type_for_size): Likewise.
256 (d_type_promotes_to): Likewise.
257
258 2012-08-31 Iain Buclaw <ibuclaw@ubuntu.com>
259
260 * d-glue.cc (FuncDeclaration::toObjFile): Flatten nested levels and
261 loops in function, delay printing function name in verbose mode until
262 we know the function is being compiled.
263
264 * d-codegen.cc (IRState::buildFrameForFunction): New function.
265 (IRState::buildChain): Use IRState::buildFrameForFunction to get the
266 frame record type.
267 (IRState::getFrameInfo): Likewise.
268 * d-glue.cc (FuncDeclaration::buildClosure): Likewise.
269
270 2012-08-30 Iain Buclaw <ibuclaw@ubuntu.com>
271
272 * asmstmt.cc (ExtAsmStatement::toCBuffer): Mark unused parameter as
273 ATTRIBUTE_UNUSED.
274 * d-codegen.cc (WrappedExp::toCBuffer): Likewise.
275 * d-objfile.cc (ObjectFile::setupSymbolStorage): Revert to previous
276 behaviour of setting symbol storage.
277
278 * d-codegen.cc (IRState::expandDecl): Use IRState::vinit.
279 (IRState::binding): Likewise.
280 (IRState::var): Handle all declarations, not just vars.
281 * d-glue.cc (PtrExp::toElem): Simplify use of IRState::var.
282 (SymbolExp::toElem ): Likewise.
283 (ThisExp::toElem): Likewise.
284
285 * d-lang.cc (d_init): Remove 'Thumb' identifier for ARM as 16bit
286 platforms aren't supported.
287 (GNU_LongDouble128): Remove identifier as long double size is
288 determined from type information.
289
290 * d-decls.cc (TypeInfoDeclaration::toSymbol): Mark all typeinfo decls
291 as 'used'.
292 * d-glue.cc (one_elem_array): Remove.
293 (CatExp::toElem): Inline use of one_elem_array, clean-up.
294 * d-objfile.cc (ObjectFile::setupSymbolStorage): Update to better
295 handle use of declarations marked with comdat, extern or static.
296 (ObjectFile::doSimpleFunction): Mark function as 'used'.
297 * dt.cc (dt2node): Clean-up indentation.
298
299 * Make-lang.in: Fix issue with cross-compiler configuration.
300
301 2012-08-29 Iain Buclaw <ibuclaw@ubuntu.com>
302
303 * lang-specs.h: Remove special case for handled D source files.
304 * Make-lang.in: Remove special case for building gcc.o, use
305 GCC_EXTRA_LIBS to link against, rather than specific gcc object files.
306 (D_DRIVER_NAME): Remove use of variable.
307 (D_DRIVER_OBJS): Likewise.
308 (D_COMPILER_NAME): Likewise.
309
310 2012-08-23 Iain Buclaw <ibuclaw@ubuntu.com>
311
312 * d-builtins2.cc (eval_builtin): Use builtin_decl_explicit.
313 * d-codegen.cc (IRState::emitLocalVar): Use warning.
314 (IRState::convertTo): Likewise.
315 (IRState::addressOf): Use IRState::markAddressable.
316 (IRState::markAddressable): New function.
317 (IRState::markUsed): New function.
318 (IRState::markRead): New function.
319 (IRState::maybeExpandSpecialCall): Use builtin_decl_explicit.
320 (IRState::floatMod): Likewise.
321 (IRState::exceptionObject): Likewise.
322 * d-glue.cc (IdentityExp::toElem): Likewise.
323 (EqualExp::toElem): Likewise.
324 (PowExp::toElem): Likewise.
325 (AssignExp::toElem): Likewise.
326 (HaltExp::toElem): Likewise.
327 (ArrayLiteralExp::toElem): Likewise.
328 (FuncDeclaration::toObjFile): Likewise.
329 * d-lang.cc (d_mark_addressable): Remove function.
330 (d_mark_exp_read): Remove function.
331 * d-lang.h (d_warning): Remove macro.
332 (d_built_in_decls): Remove macro.
333 * d-objfile.cc (Obj::includelib): Use warning.
334 (Obj::startaddress): Likewise.
335
336 2012-08-22 Iain Buclaw <ibuclaw@ubuntu.com>
337
338 * d-lang.cc (binary): Moved function from frontend.
339 * d-codegen.cc (IRState::extractMethodCallExpr): Update for new C++ VEC
340 template in GCC.
341 * d-bi-attrs.h (parse_optimize_options): Likewise.
342 * d-dmd-gcc.h: Remove ifdef __cplusplus, use GCC_SAFE_DMD.
343 * d-gcc-includes.h: Remove ifdef __cplusplus.
344 * d-lang.h: Likewise.
345 * Make-lang.in: Remove CC and CFLAGS from Makefile, add build rule for
346 new texi man pages.
347 * gdc.texi: New documentation for GDC.
348
349 2012-08-18 Iain Buclaw <ibuclaw@ubuntu.com>
350
351 * d-codegen.cc (IRState::convertTo): Fix to allow conversion between
352 void* and associative arrays.
353 (IRState::convertForArgument): Use d_convert_basic.
354 (IRState::call): Don't use d_convert_basic, now handled by
355 convertForArgument.
356 * d-gcc-real.cc (real_t::real_t): Increase real type mode to be greater
357 than integer type size to prevent overflow in conversions.
358 * d-glue.cc (CastExp::toElem): Don't get implicit AA type.
359
360 2012-08-17 Iain Buclaw <ibuclaw@ubuntu.com>
361
362 * dfrontend: Update to D frontend version 2.060
363
364 * d-codegen.cc (libcall_ids): New library functions.
365 (IRState::getLibCallDecl): Implement new library function signatures.
366 * d-codegen.h (LibCall::LIBCALL_NEWITEMT): New enum value.
367 (LibCall::LIBCALL_NEWITEMIT): Likewise.
368 * d-decls.cc (FuncDeclaration::toSymbol): Small readability cleanup.
369 * d-glue.cc (NewExp::toElem): Use new library functions.
370 (StructLiteralExp::toElem): Update for new frontend.
371 (ReturnStatement::toIR): Likewise.
372 * d-incpath.cc (add_import_path): New signature.
373 (add_fileimp_path): Likewise.
374 (add_import_paths): Pass split Strings to helper functions.
375 * d-lang.cc (d_parse_file): Use Obj::init and Obj::term.
376 * d-objfile.cc (objmod): New variable.
377 (Obj::init): New function.
378 (Obj::term): Likewise.
379 (Obj::includelib): Likewise.
380 (Obj::startaddress): Likewise.
381 (Obj::allowZeroSize): Likewise.
382 (Obj::moduleinfo): Likewise.
383 (Obj::export_symbol): Likewise.
384 * symbol.h (Obj): New struct to allow object oriented interface to glue
385 code from frontend.
386
387 * d-builtins2.cc (d_gcc_magic_stdarg_check): Add new va_arg magic
388 function that stores the next value through a passed parameter.
389 Remove workaround for inout signature as va_list is always passed by
390 reference to intrinsic templates.
391 (d_gcc_magic_module): Assign module directly to global IRState.
392 * d-codegen.cc (IRState::builtinsModule): Remove static declaration.
393 (IRState::intrinsicModule): Likewise.
394 (IRState::intrinsicCoreModule): Likewise.
395 (IRState::mathModule): Likewise.
396 (IRState::mathCoreModule): Likewise.
397 (IRState::cstdargTemplateDecl): Likewise.
398 (IRState::cstdargStartTemplateDecl): Likewise.
399 (IRState::varsInScope): Likewise.
400 (IRState::call): Use flag_split_darrays.
401 (IRState::maybeExpandSpecialCall): Clean-up va_start and va_arg
402 implementations.
403 (IRState::maybeSetUpBuiltin): Handle new va_arg function.
404 * d-codegen.h (Intrinsic::INTRINSIC_VA_ARG): New enum definition.
405 (IRState::setBuiltinsModule): Remove.
406 (IRState::setIntrinsicModule): Likewise.
407 (IRState::setMathModule): Likewise.
408 (IRState::setCStdArg): Likewise.
409 * d-glue.cc (CatExp::toElem): Use flag_split_darrays.
410 * d-irstate.cc (IRBase::startFunction): Set varsInScope.
411 * d-lang.cc (d_init_options): Set modules that require special
412 handling.
413 (d_handle_option): Don't handle OPT_fsplit_dynamic_arrays.
414 * lang.opt: fsplit-dynamic-arrays mapped to variable
415 flag_split_darrays.
416
417 2012-08-16 Iain Buclaw <ibuclaw@ubuntu.com>
418
419 * d-glue.cc (IdentityExp::toElem): Re-order precendence of type
420 checking. Treat static arrays as D arrays in identity comparisons.
421 (EqualExp::toElem): Use adEq2 over built-in memcmp for equality
422 comparisons for static and dynamic arrays.
423 (TypeStruct::toCtype): Remove old platform specific workaround.
424
425 * d-builtins2.cc (bi_lib_list): New decl to hold list of GCC library
426 built-ins.
427 (d_bi_init): Add decls to bi_list_list if recognising built-ins.
428 (d_gcc_magic_builtins_module): Rename built-in type C long to
429 __builtin_clong, built-in type C ulong to __builtin_culong.
430 (d_gcc_magic_libbuiltins_check): New function to assign internal
431 symbol for built-in library functions.
432 (d_gcc_magic_libbuiltins_module): New function to scan modules that
433 contain GCC library built-ins.
434 (d_gcc_magic_module): Search all core.stdc modules for possible GCC
435 library built-ins.
436 * d-codegen.h (IRState::useBuiltins): Remove.
437 * d-lang.cc (d_init_options): Don't set IRState::useBuiltins.
438 (d_handle_option): Likewise.
439 * lang.opt: Re-order D frontend compiler options.
440
441 * d-codegen.cc (IRState::buildChain): Override chainLink and chainFunc
442 for function if static chain is passed via hidden 'this' and no frame
443 is created.
444 (IRState::getFrameInfo): Pass static chain around nested functions in
445 the same way as closures for better performance.
446
447 * d-codegen.cc (libcall_ids): Re-order list in ascii collating order,
448 add new library routines to lookup, rename all non-vararg functions to
449 match DMD ABI implementation.
450 (LibCall): Re-order enum and rename values to match libcall_ids.
451 (IRState::toElemLvalue): Use new LibCall name.
452 (IRState::getLibCallDecl): Update to match current library signatures,
453 add implementation of new library routines.
454 (IRState::maybeSetLibCallDecl): New function to set internal symbol
455 for special D RT library functions.
456 * d-decls.cc (FuncDeclaration::toSymbol): Use
457 IRState::maybeSetLibCallDecl.
458 * d-glue.cc (InExp::toElem): Use new LibCall name.
459 (CatAssignExp::toElem): Likewise.
460 (IndexExp::toElem): Likewise.
461 (DeleteExp::toElem): Likewise.
462 (RemoveExp::toElem): Likewise.
463 (NewExp::toElem): Likewise.
464 (ArrayLiteralExp::toElem): Likewise.
465 (AssocArrayLiteralExp::toElem): Likewise.
466 (NullExp::toElem): Use IRState::convertTo.
467
468 * d-codegen.cc (needs_temp): Remove.
469 (IRState::makeTemp): New function.
470 (IRState::maybeMakeTemp): Re-implement to use isFreeOfSideEffects.
471 (IRState::isFreeOfSideEffects): Re-implement to allow better CSE.
472 (IRState::call): Use IRState::makeTemp.
473
474 * d-builtins2.cc (gcc_type_to_d_type): Use d_convert_basic.
475 * d-codegen.cc (IRState::emitLocalVar): Use IRState::vinit.
476 (IRState::convertTo): New function for tree conversions.
477 (IRState::convertTo): Use IRState::convertTo.
478 (IRState::convertForCondition): Likewise.
479 (IRState::darrayVal): Likewise.
480 (IRState::pointerIntSum): Likewise.
481 (IRState::pointerOffsetOp): Likewise.
482 (IRState::pvoidOkay): Likewise.
483 (IRState::boundsCond): Likewise.
484 * d-convert.cc (convert): New function to be called from C.
485 (d_build_truthvalue_op): Use d_convert_basic.
486 * d-glue.cc (convert): Remove.
487 (build_bool_binop): Use IRState::convertTo.
488 (build_math_op): Likewise.
489 (CmpExp::toElem): Likewise.
490 (PowExp::toElem): Likewise.
491 (do_array_set): Likewise.
492 (AssignExp::toElem): Likewise.
493 (VectorExp::toElem): Likewise.
494 (NotExp::toElem): Likewise.
495 (CallExp::toElem): Likewise.
496 (SymbolExp::toElem): Likewise.
497 * dt.cc (dt2tree_list_of_elems): Use d_convert_basic.
498
499 2012-07-26 Iain Buclaw <ibuclaw@ubuntu.com>
500
501 * d-gcc-real.cc (real_t::real_t): Use d_float64 for constructor.
502 (real_t::isConst0): Remove.
503 (real_t::isConst1): Likewise.
504 (real_t::isConst2): Likewise.
505 (real_t::isConstMinus1): Likewise.
506 (real_t::isConstHalf): Likewise.
507 * d-gcc-real.h (longdouble): New typedef for real_t.
508 (ldouble): New template for ldouble conversions.
509 (ld_sprint): New function for ldouble to string formatting.
510 * d-codegen.cc (IRState::hwi2toli): Handle maximum 64bit value case.
511
512 2012-07-18 Iain Buclaw <ibuclaw@ubuntu.com>
513
514 * d-codegen.cc (IRState::delegateVal): Remove ENABLE_CHECKING code.
515 (IRState::objectInstanceMethod): Remove special case to avoid calling
516 DotTypeExp::toElem.
517 * d-glue.cc (CommaExp::toElem): Likewise.
518 (DotTypeExp::toElem): Implement function.
519 (StructLiteralExp::toElem): Assert instead that basetype is a struct.
520 * d-gcc-reah.cc (real_t::real_t): New overload for 'double' type.
521 (real_t::format): Change function type to int, return size of buffer
522 from function.
523 (real_t::formatHex): Likewise.
524 * d-builtins2.cc (d_gcc_magic_stdarg_check): Update signature, remove
525 check for is_c_std_arg.
526 (d_gcc_magic_stdarg_module): Likewise.
527 (d_gcc_magic_module): Remove check for core.vararg.
528 * d-codegen.cc (INTRINSIC_STD_VA_ARG): Remove.
529 (IRState::maybeSetUpBuiltin): Don't handle INTRINSIC_STD_VA_ARG.
530
531 2012-07-13 Iain Buclaw <ibuclaw@ubuntu.com>
532
533 * d-decls.cc (Dsymbol::toSymbolX): Remove use of PRIuSIZE format macro.
534 (FuncDeclaration::toThunkSymbol): Likewise.
535
536 2012-07-12 Iain Buclaw <ibuclaw@ubuntu.com>
537
538 * d-lang.h (D_DECL_IS_CONTRACT): New macro.
539 * d-decls.cc (FuncDeclaration::toSymbol): Mark in and out contracts as
540 D_DECL_IS_CONTRACT.
541 (FuncDeclaration::toThunkSymbol): D thunks no longer private by
542 design. Alter mangling of thunk symbols to be unique across the entire
543 compilation unit.
544 * d-objfile.cc (ObjectFile::makeDeclOneOnly): Catch public contracts to
545 mark them as one-only.
546 (ObjectFile::outputThunk): Mark weakref thunks as private.
547
548 2012-07-10 Iain Buclaw <ibuclaw@ubuntu.com>
549
550 * Make-lang.in: Remove unused borrowed objects.
551 * d-builtins2.cc (d_bi_builtin_func): Don't add builtin if
552 -fno-builtin was given.
553 * d-codegen.cc (IRState::emitTemplates): Remove static declaration.
554 (IRState::splitDynArrayVarArgs): Likewise.
555 (IRState::useInlineAsm): Likewise.
556 (IRState::useBuiltins): Likewise.
557 (d_gcc_force_templates): Update to use global gen.
558 * d-codegen.h (emitTemplates): Remove static attribute.
559 (splitDynArrayVarArgs): Likewise.
560 (useBuiltins): Likewise.
561 (useInlineAsm): Remove member.
562 (stdInc): Define new member.
563 * d-incpath.cc (std_inc): Remove global.
564 (add_import_paths): Update function signature.
565 * d-lang.cc (d_init_options): Default splitDynArrayVarArgs to false.
566 (d_init): Update call to add_import_paths.
567 (d_handle_option): Remove OPT_fd_inline_asm, add
568 OPT_fsplit_dynamic_arrays.
569 * lang.opt: Likewise.
570
571 2012-07-08 Iain Buclaw <ibuclaw@ubuntu.com>
572
573 * d-builtins2.cc (d_gcc_type_align): Update function signature. Use
574 type align size to determine the known align size of a decl.
575 * d-dmd-gcc.h (d_gcc_type_align): Update function signature.
576 * symbol.h (Symbol): New member, Salignment.
577 * symbol.cc (Symbol::Symbol): Initialise Salignment.
578 * d-decls.cc (VarDeclaration::toSymbol): Set Salignment if there is an
579 alignment in effect on the decl.
580 (AggregateDeclaration::toInitializer): Likewise.
581 * d-objfile.cc (ObjectFile::outputStaticSymbol): Set DECL_ALIGN if
582 Salignment was given for static decl.
583
584 2012-07-07 Iain Buclaw <ibuclaw@ubuntu.com>
585
586 * d-builtins2.cc (d_gcc_magic_builtins_module): Add check for
587 DECL_ASSEMBLER_NAME_SET_P when testing for builtins that can be
588 markable as pure in the D frontend.
589
590 * d-codegen.cc (IRState::integerConstant): Hide use of
591 HOST_BITS_PER_WIDE_INT macros.
592 (IRState::hwi2toli): Likewise.
593 (IRState::getTargetSizeConst): Likewise.
594
595 * d-builtins.c (d_global_trees): Move declaration here.
596 (lookup_C_type_name): Rename to lookup_ctype_name.
597 (d_init_builtins): Move set-up of d_global_trees here.
598 (gcc_d_backend_init): Move function from d-glue.cc and refactored.
599 (gcc_d_backend_term): Likewise.
600 * d-builtins2.cc (d_bi_init): Set-up D frontend sizes here.
601 * d-glue.cc (gcc_d_backend_init): Removed.
602 (gcc_d_backend_term): Likewise.
603
604 * d-incpath.cc (add_phobos_versyms): New function to scan
605 phobos-vers-syms file.
606 (register_import_chains): Renamed to add_import_paths.
607 * d-lang.cc (d_init): Call add_phobos_versyms and add_import_paths.
608 (d_parse_int): Don't use strtol to get number from argument string.
609
610 * d-incpath.cc (maybe_fixup_phobos_target): Remove.
611 (register_import_chains): Remove use of maybe_fixup_phobos_target.
612 * d-lang.cc (maybe_fixup_os_versym): Remove
613 (d_init): Remove use of maybe_fixup_os_versym.
614
615 * d-lang.cc (saved_reg_names): Remove.
616 (d_init): Remove use of saved_reg_names.
617 (d_post_options): Likewise.
618
619 2012-07-05 Iain Buclaw <ibuclaw@ubuntu.com>
620
621 * d-glue.cc (StructLiteralExp::toElem): Stop after first assignment for
622 constructors built for union types.
623
624 2012-07-01 Iain Buclaw <ibuclaw@ubuntu.com>
625
626 * symbol.h (deferredNestedFuncs): Renamed from otherNestedFuncs, use as
627 value type rather than pointer.
628 (thunks): Use as value type rather than pointer.
629 * d-decls.cc (FuncDeclaration::toSymbol): Remove check for
630 deferredNestedFuncs being NULL.
631 (FuncDeclaration::toThunkSymbol): Remove check for thunks being NULL.
632 * d-glue.cc (DelegateExp::toElem): Remove check for deferredNestedFuncs
633 being NULL.
634 (FuncDeclaration::toObjFile): Likewise.
635 * d-objfile.cc (ObjectFile::shouldEmit): Add nested functions to
636 deferredNestedFuncs of their parent function incase parent is actually
637 emitted later in during compilation.
638 * d-builtins2.cc (d_gcc_type_align): Explicit alignment of variables
639 takes precedence over default alignment.
640 * d-gcc-includes.h: Re-order list of includes.
641
642 2012-06-26 Iain Buclaw <ibuclaw@ubuntu.com>
643
644 * d-codegen.cc (IRState::twoFieldType): Use rest_of_decl_compilation.
645 * d-gcc-includes.h: Remove last of poisoned backend headers.
646 * d-glue.cc (FuncDeclaration::toObjFile): Use fprintf for diagnostic
647 message. Use rest_of_decl_compilation directly.
648 (SynchronizedStatement::toIR): Likewise.
649 (TypeFunction::toCtype): Remove old version1 macro.
650 * d-lang.cc (d_parse_file): Remove dependency on backend header. Use
651 fprintf for diagnostic messages.
652 (nametype): Use rest_of_decl_compilation directly.
653 (d_handle_option): Remove version 1 option.
654 * dmd-script: Likewise.
655 * lang.opt: Likewise.
656 * d-objfile.cc (ObjectFile::outputStaticSymbol): Use
657 rest_of_decl_compilation directly.
658 (ObjectFile::declareType): Likewise.
659 (obj_moduleinfo): Likewise.
660 (obj_tlssections): Likewise.
661 (ObjectFile::outputThunk): Implement new method of thunk generation
662 for external symbols using weakref.
663 * d-objfile.h (rodc): Remove.
664
665 2012-06-25 Iain Buclaw <ibuclaw@ubuntu.com>
666
667 * d-builtins.c (d_init_builtins): Use build_tree_list to initialise
668 void_list_node.
669 * d-glue.cc (ArrayLiteralExp::toElem): Always generate code for
670 arrayliteralTp.
671 (TypeFunction::toCtype): Chain on void_list_node to the end of the
672 function type parameters. Fixes function signatures in debugging.
673
674 2012-06-23 Iain Buclaw <ibuclaw@ubuntu.com>
675
676 * Make-lang.in (d_OBJS): Add so IN_GCC_FRONTEND is defined when
677 building gdc sources.
678 * d-builtins.c: Remove poisoned headers.
679 * d-codegen.cc: Likewise.
680 * d-gcc-includes.h: GCC system headers included first, removed
681 internally defined macros and poisoned headers.
682 * d-gcc-tree.h: Use GCC system headers instead of defining tree_node.
683 * d-lang.cc: GCC system headers included first.
684 (pushdecl_top_level): Removed.
685 * d-objfile.cc: Remove poisoned headers.
686 * gdc_alloca.h: Use liberty.h instead of handling include of alloca.
687
688 * d-decls.cc (Dsymbol::toSymbolX): Use snprintf rather than sprintf.
689 (FuncDeclaration::toSymbol): Likewise.
690 * d-gcc-real.cc (real_t::init): Likewise.
691 * symbol.cc (Symbol::Symbol): Use NULL_TREE to initialise tree.
692 (symbol_calloc): Use xstrdup to copy string.
693
694 * Make-lang.in: Remove D language version 1 from build
695 (_GNU_SOURCE): Removed macro from build.
696 (ELFOBJ): Likewise.
697 (D_VA_LIST_TYPE_VOIDPTR): Likewise.
698 * asmstmt.cc (ExtAsmStatement::semantic): Removed use of V2 macro.
699 * d-builtins2.cc (d_gcc_builtin_va_list_d_type): Removed use of
700 D_VA_LIST_TYPE_VOIDPTR macro.
701 (gcc_type_to_d_type): Likewise.
702 (d_gcc_magic_stdarg_check): Likewise.
703 (d_gcc_magic_builtins_module): Removed use of V2 macro, and V1
704 encapsulated code.
705 * d-codegen.cc (IRState::convertTo): Likewise.
706 (IRState::toDArray): Likewise.
707 (IRState::typesCompatible): Likewise.
708 (IRState::arrayBoundsCheck): Likewise.
709 (IRState::assertCall): Likewise.
710 (libcall_ids): Likewise.
711 (IRState::getLibCallDecl): Likewise.
712 (IRState::getFrameForSymbol): Likewise.
713 (IRState::isFuncNestedIn): Likewise.
714 (IRState::buildChain): Likewise.
715 (IRState::getFrameInfo): Likewise.
716 (IRState::getFrameRef): Likewise.
717 (IRState::functionNeedsChain): Likewise.
718 (IRState::startCond): Likewise.
719 (IRState::exitIfFalse): Likewise.
720 (IRState::startCase): Likewise.
721 (IRState::doCase): Likewise.
722 (IRState::endCase): Likewise.
723 * d-decls.cc (VarDeclaration::toSymbol): Likewise
724 (FuncDeclaration::toSymbol): Likewise.
725 * d-glue.cc (CondExp::toElem): Likewise.
726 (build_bool_binop): Likewise.
727 (EqualExp::toElem): Likewise.
728 (CmpExp::toElem): Likewise.
729 (AndAndExp::toElem): Likewise.
730 (OrOrExp::toElem): Likewise.
731 (AssignExp::toElem): Likewise.
732 (CastExp::toElem): Likewise.
733 (CallExp::toElem): Likewise.
734 (AssertExp::toElem): Likewise.
735 (AssocArrayLiteralExp::toElem): Likewise.
736 (StructLiteralExp::toElem): Likewise.
737 (FuncDeclaration::toObjFile): Likewise.
738 (Module::genobjfile): Likewise.
739 (TypeFunction::toCtype): Likewise.
740 (ThrowStatement::toIR): Likewise.
741 (TryCatchStatement::toIR): Likewise.
742 (ReturnStatement::toIR): Likewise.
743 (SwitchStatement::toIR): Likewise.
744 (IfStatement::toIR): Likewise.
745 (ForStatement::toIR): Likewise.
746 (ExpStatement::toIR): Likewise.
747 * d-irstate.cc (IRBase::startFunction): Likewise.
748 * d-lang.cc (d_init_options_struct): Likewise.
749 (d_handle_option): Likewise.
750 (d_parse_file): Likewise.
751
752 2012-06-21 Iain Buclaw <ibuclaw@ubuntu.com>
753
754 * Make-lang.in: Remove d-asm-i386.h
755 * asmstmt.cc (d_build_asm_stmt): Update signature, use build5.
756 (getFrameRelativeValue): Remove.
757 (d_format_priv_asm_label): Likewise.
758 (d_have_inline_asm): Likewise.
759 (AsmProcessor): Likewise.
760 (AsmStatement::toIR): Update sorry message.
761 * d-codegen.cc (IRState::expandPortIntrinsic): Update call to
762 d_build_asm_stmt.
763 (IRState::doAsm): Likewise.
764 * d-decls.cc (FuncDeclaration::toSymbol): Remove check for inline asm.
765 * d-glue.cc (FuncDeclaration::toObjFile): Likewise.
766 (LabelStatement::toIR): Likewise.
767 * d-lang.cc (VersionCondition::addPredefinedGlobalIdent): Remove D
768 Inline Asm version identifiers.
769 * d-lang.h (d_build_asm_stmt): Update signature.
770
771 2012-06-19 Iain Buclaw <ibuclaw@ubuntu.com>
772
773 * d-decls.cc (FuncDeclaration::toSymbol): Mark in/out contracts as
774 TREE_PUBLIC to allow calling cross-module.
775 * d-lang.cc (d_parse_file): Update for 2.059.
776
777 2012-06-16 Iain Buclaw <ibuclaw@ubuntu.com>
778
779 * dfrontend: Merged with DMD 2.059.
780 * d-builtins2.cc (gcc_type_to_d_type): Use new frontend value.
781 * d-codegen.cc (IRState::getLibCallDecl): Fix return type of _aaDelp.
782 (IRState::getVThis): Use frontend provided member to determine if
783 function has nested references.
784 * d-decl.cc (FuncDeclaration::toSymbol): Weakly pure functions don't
785 guarantee no vops.
786 * d-gcc-real.cc (max_float_mode): Remove.
787 (real_t::convert): Catch imaginary types in conversion.
788 * d-glue.cc (EqualExp::toElem): Use memcmp for struct comparisons.
789 (CatAssignExp::toElem): Rework order of logic to allow appending
790 delegates to an array.
791 (DelegateExp::toElem): Implement handling of lambda functions.
792 (FuncExp::toElem): Ditto.
793 (AssocArrayLiteralExp::toElem): Implement handling of AssociativeArray
794 types sent to backend.
795 * d-objfile.cc (lmtab): Remove.
796 (cvtLocToloc_t): Update implementation.
797 (outdata): Now assert that we don't receive error nodes.
798
799 2012-06-05 Iain Buclaw <ibuclaw@ubuntu.com>
800
801 * d-decls.cc (FuncDeclaration::toSymbol): Make better use of 'pure' and
802 'pure const' functions in GCC codegen.
803 * d-bi-attrs.h: Added TM_ATTR* masks.
804 (handle_tm_wrap_attribute, handle_tm_attribute, tm_attr_to_mask,
805 find_tm_attribute): New.
806 (struct d_common_attribute_table): Added transaction* attributes.
807
808 2012-06-04 Iain Buclaw <ibuclaw@ubuntu.com>
809
810 * d-objfile.cc (ObjectFile::outputThunk): Output thunks moved back to
811 the frontend, as backend does not emit them for DECL_EXTERNAL functions.
812
813 2012-05-29 Daniel Green <venix1@gmail.com>
814
815 * setup-gcc.sh: Add GCC 4.8 to list of supported GCC versions. Patch
816 courtesy of Calrama
817 https://bitbucket.org/goshawk/gdc/issue/345
818
819 2012-05-29 Iain Buclaw <ibuclaw@ubuntu.com>
820
821 * d-codegen.cc (IRState::endCase): Remove parameter from function. Use
822 condition type as the SWITCH_EXPR type, rather than use of void.
823 * d-codegen.h (IRState::endCase): Update signature.
824 * d-glue.cc (SwitchStatement::toIR): Update call to endCase.
825
826 2012-05-28 Daniel Green <venix1@gmail.com>
827
828 * d-builtins.c (DEF_ATTR_STRING): Define and undefine along with other
829 macros.
830 * d-lang.cc (d_write_global_declartions): Use
831 finalize_compilation_unit. GCC 2012-04-30
832 * d-objfile.cc (ObjectFile::outputThunk): Use
833 symtab_add_to_same_comdat_group. GCC 2012-04-30
834 * lang.opt: Match help strings for duplicated options.
835
836 2012-02-01 Iain Buclaw <ibuclaw@ubuntu.com>
837
838 * setup-gcc.sh: Remove -hg option.
839 * dfrontend/func.c (FuncDeclaration::semantic): Remove code adding
840 method to flat list.
841 (FuncDeclaration::semantic3): Re-add here.
842
843 2012-01-01 Iain Buclaw <ibuclaw@ubuntu.com>
844
845 * d-builtins2.cc (IRState::buildChain): Don't do nrvo if the
846 variable is put in a closure.
847 * d-glue.cc (FuncDeclaration::buildClosure): Ditto.
848 (ReturnStatement::toIR): Don't call postblit on nrvo returns.
849 (DtorExpStatement::toIR): Don't call destructor if var is returned as
850 the nrvo variable.
851
852 \f
853 Copyright (C) 2012 Free Software Foundation, Inc.
854
855 Copying and distribution of this file, with or without modification,
856 are permitted in any medium without royalty provided the copyright
857 notice and this notice are preserved.