Age | Commit message (Collapse) | Author | Files | Lines |
|
Adds classKind information to the front-end AST, which in turn allows us
to fix code generation of type names for extern(C) and extern(C++)
structs and classes. Inspecting such types inside a debugger now just
works without the need to 'cast(module_name.cxx_type)'.
gcc/d/ChangeLog:
* d-codegen.cc (d_decl_context): Don't include module in the name of
class and struct types that aren't extern(D).
|
|
Adds a new test directive COMPILABLE_MATH_TEST, and support has been
added for it in gdc-convert-test so that they are skipped if phobos is
not present on the target.
Only change in D runtime is a small documentation fix.
Reviewed-on: https://github.com/dlang/druntime/pull/3067
https://github.com/dlang/dmd/pull/11060
gcc/testsuite/ChangeLog:
PR d/89418
* lib/gdc-utils.exp (gdc-convert-test): Add dg-skip-if for compilable
tests that depend on the phobos standard library.
|
|
* New core.math.toPrec templates have been added as an intrinsic.
Some floating point algorithms, such as Kahan-Babuska-Neumaier
Summation, require rounding to specific precisions. Rounding to
precision after every operation, however, loses overall precision in
the general case and is a runtime performance problem.
Adding these functions guarantee the rounding at required points in
the code, and document where in the algorithm the requirement exists.
* Support IBM long double types in core.internal.convert.
* Add missing aliases for 64-bit vectors in core.simd.
* RUNNABLE_PHOBOS_TEST directive has been properly integrated into the
D2 language testsuite.
Reviewed-on: https://github.com/dlang/druntime/pull/3063
https://github.com/dlang/dmd/pull/11054
gcc/d/ChangeLog:
* intrinsics.cc (expand_intrinsic_toprec): New function.
(maybe_expand_intrinsic): Handle toPrec intrinsics.
* intrinsics.def (TOPRECF, TOPREC, TOPRECL): Add toPrec intrinsics.
|
|
Adjusts the hardcoded index of Error.bypassException.
Fixes: PR d/94623
Reviewed-on: https://github.com/dlang/dmd/pull/11052
|
|
Initializes the VectorArrayExp::size field with the correct value.
Fixes: PR d/94652
Reviewed-on: https://github.com/dlang/dmd/pull/11046
|
|
Initializes ncost before use, which was caught by valgrind.
Fixes: PR d/94653
Reviewed-on: https://github.com/dlang/dmd/pull/11045
|
|
Removes the implementation of __traits(argTypes), which only supported
x86_64 targets. The only use of this trait is an unused va_arg()
function, this has been removed as well.
Reviewed-on: https://github.com/dlang/dmd/pull/11022
gcc/d/ChangeLog:
2020-04-13 Iain Buclaw <ibuclaw@gdcproject.org>
* Make-lang.in (D_FRONTEND_OBJS): Remove d/argtypes.o.
* d-target.cc (Target::toArgTypes): New function.
libphobos/ChangeLog:
2020-04-13 Iain Buclaw <ibuclaw@gdcproject.org>
* libdruntime/core/stdc/stdarg.d: Remove run-time va_list template.
|
|
Tests have been moved into runnable_cxx as part of upstream dmd 3e10e2dd2.
The extra flags required for tests that mix C++ and D are now limited to
only a small subset of tests, rather than applied to all tests across
gdc.dg and gdc.test.
Reviewed-on: https://github.com/dlang/dmd/pull/10980
gcc/testsuite/ChangeLog:
* gdc.test/runnable_cxx/runnable_cxx.exp: New file.
* lib/gdc-utils.exp (gdc-do-test): Add case for runnable_cxx.
* lib/gdc.exp (gdc_include_flags): Only add flags for libstdc++-v3 if
GDC_INCLUDE_CXX_FLAGS is true.
(gdc_link_flags): Likewise.
(gdc_init): Move setting of default gdc test flags to...
(gdc_target_compile): ...here.
|
|
Fixes long standing regression in the D front-end implemention, and adds
a new field to allow retrieving a list of all content imports from the
code generator.
Reviewed-on: https://github.com/dlang/dmd/pull/10913
https://github.com/dlang/dmd/pull/10933
|
|
Fixes an ICE in the parser, and deprecates a previously allowed style of
syntax that deviated from GNU-style extended asm.
Reviewed-on: https://github.com/dlang/dmd/pull/10916
gcc/testsuite/ChangeLog:
2020-03-16 Iain Buclaw <ibuclaw@gdcproject.org>
* gdc.dg/asm1.d: Add new test for ICE in asm parser.
* gdc.dg/asm5.d: New test.
|
|
1. Implement DIP 1010 - (Static foreach)
Support for 'static foreach' has been added. 'static foreach' is a conditional
compilation construct that is to 'foreach' what 'static if' is to 'if'. It is
a convenient way to generate declarations and statements by iteration.
import std.conv: to;
static foreach(i; 0 .. 10)
{
// a 'static foreach' body does not introduce a nested scope
// (similar to 'static if').
// The following mixin declaration is at module scope:
// declares 10 variables x0, x1, ..., x9
mixin('enum x' ~ to!string(i) ~ ' = i;');
}
import std.range: iota;
// all aggregate types that can be iterated with a standard 'foreach'
// loop are also supported by static foreach:
static foreach(i; iota(10))
{
// we access the declarations generated in the first 'static foreach'
pragma(msg, "x", i, ": ", mixin(`x` ~ to!string(i)));
static assert(mixin(`x` ~ to!string(i)) == i);
}
void main()
{
import std.conv: text;
import std.typecons: tuple;
import std.algorithm: map;
import std.stdio: writeln;
// 'static foreach' has both declaration and statement forms
// (similar to 'static if').
static foreach(x; iota(3).map!(i => tuple(text("x", i), i)))
{
// generates three local variables x0, x1 and x2.
mixin(text(`int `,x[0],` = x[1];`));
scope(exit) // this is within the scope of 'main'
{
writeln(mixin(x[0]));
}
}
writeln(x0," ",x1," ",x2); // first runtime output
}
2. Aliases can be created directly from a '__trait'.
Aliases can be created directly from the traits that return symbol(s) or
tuples. This includes 'getMember', 'allMembers', 'derivedMembers', 'parent',
'getOverloads', 'getVirtualFunctions', 'getVirtualMethods', 'getUnitTests',
'getAttributes' and finally 'getAliasThis'. Previously an 'AliasSeq' was
necessary in order to alias their return. Now the grammar allows to write
shorter declarations:
struct Foo
{
static int a;
}
alias oldWay = AliasSeq!(__traits(getMember, Foo, "a"))[0];
alias newWay = __traits(getMember, Foo, "a");
To permit this it was more interesting to include '__trait' in the basic types
rather than just changing the alias syntax. So additionally, wherever a type
appears a '__trait' can be used, for example in a variable declaration:
struct Foo { static struct Bar {} }
const(__traits(getMember, Foo, "Bar")) fooBar;
static assert(is(typeof(fooBar) == const(Foo.Bar)));
3. fix Issue 10100 - Identifiers with double underscores and allMembers
The identifer whitelist has been converted into a blacklist of all possible
internal D language declarations.
Reviewed-on: https://github.com/dlang/dmd/pull/10791
|
|
From-SVN: r279813
|
|
PR d/91339
d/dmd: Merge upstream dmd b37a537d3
Fixes the error: cannot find source code for runtime library file
'object.d' when the path contains '~'.
Reviewed-on: https://github.com/dlang/dmd/pull/10309
From-SVN: r274771
|
|
Don't crash when compiling for 16-bit platforms.
Reviewed-on: https://github.com/dlang/dmd/pull/10306
gcc/d/ChangeLog:
* d-target.cc: Include diagnostic.h.
(Target::_init): Set Tsize_t and Tptrdiff_t as D ushort and short if
the target pointer size is 2. Add sorry if the pointer size is not
either 2, 4, or 8.
From-SVN: r274768
|
|
PR d/90603
d/dmd: Merge upstream dmd 792f0fdf2
Fixes segmentation fault in functionParameters, and other related
semantic bugs in forward or recursively referenced declarations.
Reviewed-on: https://github.com/dlang/dmd/pull/10046
From-SVN: r272366
|
|
d/dmd/statementsem.c:1992)
PR d/90863
d/dmd: Merge upstream dmd 6e44734cc
Fixes segmentation fault in StatementSemanticVisitor::visit.
Reviewed-on: https://github.com/dlang/dmd/pull/10033
From-SVN: r272352
|
|
PR d/90559
d/dmd: Merge upstream dmd 7afcc60c3
Partially fixes out of memory because of negative length.
Reviewed-on: https://github.com/dlang/dmd/pull/10025
gcc/d/ChangeLog:
2019-06-16 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/90559
* d-target.cc (Target::_init): Reduce max static data size to INT_MAX.
From-SVN: r272351
|
|
Fixes bug where foreach(int) doesn't work on BigEndian targets by
deprecating the use of index types smaller than a size_t/ptrdiff_t.
Reviewed-on: https://github.com/dlang/dmd/pull/10009
From-SVN: r272350
|
|
Adds static function VarDeclaration::create to the dmd C++ interface.
Reviewed-on: https://github.com/dlang/dmd/pull/10008
From-SVN: r272349
|
|
PR d/90560
d/dmd: Merge upstream dmd c6887d9bb
Fixes segmentation fault in castTo::CastTo::visit.
Reviewed-on: https://github.com/dlang/dmd/pull/10007
From-SVN: r272348
|
|
PR d/90762
d/dmd: Merge upstream dmd b0cd59177
Fixes segmentation fault in resolvePropertiesX.
Reviewed-on: https://github.com/dlang/dmd/pull/10006
From-SVN: r272347
|
|
PR d/90761
d/dmd: Merge upstream dmd d912f4e49
Fixes segmentation fault in implicitConvTo::ImplicitConvTo::visit.
Reviewed-on: https://github.com/dlang/dmd/pull/10005
From-SVN: r272346
|
|
PR d/90651
d/dmd: Merge upstream dmd 0f6cbbcad
Fixes segmentation fault in FuncDeclaration::semantic3.
Reviewed-on: https://github.com/dlang/dmd/pull/10003
gcc/d/ChangeLog:
2019-06-16 Iain Buclaw <ibuclaw@gdcproject.org>
* typeinfo.cc (object_module): New variable.
(make_frontend_typeinfo): Update signature. Set temporary on
generated TypeInfo classes.
(create_tinfo_types): Set object_module. Move generation of front-end
typeinfo into ...
(create_frontend_tinfo_types): ... New function.
(layout_typeinfo): Call create_frontend_tinfo_types.
(layout_classinfo): Likewise.
(layout_cpp_typeinfo): Likewise.
(create_typeinfo): Likewise.
From-SVN: r272345
|
|
PR d/90650
d/dmd: Merge upstream dmd ab03e2918
Fixes internal compiler error in fold_convert_loc.
Reviewed-on: https://github.com/dlang/dmd/pull/9996
gcc/testsuite/ChangeLog:
2019-06-16 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/90650
* gdc.dg/pr90650a.d: New test.
* gdc.dg/pr90650b.d: New test.
From-SVN: r272344
|
|
PR d/90604
d/dmd: Merge upstream dmd f30c5dc79
Fixes internal compiler error in Type::sizemask.
Reviewed-on: https://github.com/dlang/dmd/pull/9998
From-SVN: r272343
|
|
PR d/90602
d/dmd: Merge upstream dmd 420cce2a6
Fixes internal compiler error during CTFE.
Reviewed-on: https://github.com/dlang/dmd/pull/9997
From-SVN: r272342
|
|
PR d/90661
d/dmd: Merge upstream dmd c74e624c9
Fixes segmentation fault in AlignDeclaration::syntaxCopy.
Reviewed-on: https://github.com/dlang/dmd/pull/10001
From-SVN: r272341
|
|
PR d/90651
d/dmd: Merge upstream dmd 78dc31152
Fixes bug where the object module was not always implicitly imported.
Reviewed-on: https://github.com/dlang/dmd/pull/9999
From-SVN: r272340
|
|
PR d/90660
d/dmd: Merge upstream dmd bbc5ea66a
Fixes segmentation fault in TypeQualified::resolveHelper.
Reviewed-on: https://github.com/dlang/dmd/pull/10000
From-SVN: r272339
|
|
Fixes another failing test to pass on BigEndian.
Initial patch by Robin Dapp.
Reviewed-on: https://github.com/dlang/dmd/pull/9684
gcc/testsuite/ChangeLog:
2019-04-24 Iain Buclaw <ibuclaw@gdcproject.org>
* gdc.test/README.gcc: New file.
From-SVN: r270536
|
|
Merges upstream dmd 3b3dca8be
Reviewed-on: https://github.com/dlang/dmd/pull/9678
gcc/d/ChangeLog:
2019-04-23 Iain Buclaw <ibuclaw@gdcproject.org>
* d-builtins.cc (d_init_versions): Add D_BetterC, D_ModuleInfo,
D_Exceptions, D_TypeInfo as predefined version conditions.
* d-codegen.cc (build_bounds_condition): Generate trap if D asserts
are turned off.
* d-frontend.cc (getTypeInfoType): Add error when -fno-rtti is set.
* d-lang.cc (d_init_options): Initialize new front-end options.
(d_handle_option): Handle -fdruntime, -fexceptions, and -frtti.
(d_post_options): Turn off D runtime features if -fno-druntime is set.
* d-spec.cc (lang_specific_driver): Handle -fdruntime.
* d-tree.h (have_typeinfo_p): Add prototype.
(build_typeinfo): Update prototype.
* decl.cc (DeclVisitor::visit(StructDeclaration)): Create typeinfo
only if TypeInfo exists.
(DeclVisitor::visit(ClassDeclaration)): Likewise.
(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
(DeclVisitor::visit(EnumDeclaration)): Likewise.
* expr.cc: Update all calls to build_typeinfo.
* gdc.texi (Runtime Options): Document -fdruntime and -frtti.
* lang.opt: Add -fdruntime and -frtti.
* modules.cc (build_module_tree): Create module info only if
ModuleInfo exists.
* toir.cc (IRVisitor::visit(ThrowStatement)): Update test for
-fno-exceptions.
* typeinfo.cc (create_tinfo_types): Build internal typeinfo classes
only if Object exists.
(have_typeinfo_p): New function.
(class TypeInfoVisitor): Update all calls to build_typeinfo.
(build_typeinfo): Add error when -fno-rtti is set.
gcc/testsuite/ChangeLog:
2019-04-23 Iain Buclaw <ibuclaw@gdcproject.org>
* gdc.test/fail_compilation/fail2456.d: New test.
* gdc.test/fail_compilation/test18312.d: New test.
* gdc.test/gdc-test.exp (gdc-convert-args): Handle -betterC.
From-SVN: r270518
|
|
PR d/90130
d/dmd: Merge upstream dmd 065fbd452
Fixes endian bug in CTFE, and corrects tests in the D2 testsuite that
failed on big endian targets.
Initial patch by Robin Dapp.
Reviewed-on: https://github.com/dlang/dmd/pull/9665
From-SVN: r270485
|
|
Adds new virtual isVersionCondition, this is so that in the code
generation pass, a ConditionDeclaration's condition can be identified
without requiring a Visitor function.
Reviewed-on: https://github.com/dlang/dmd/pull/9591
From-SVN: r270300
|
|
Fixes ICE when accessing empty array in CTFE.
Reviewed-on: https://github.com/dlang/dmd/pull/9563
From-SVN: r270294
|
|
The D2 testsuite script has been updated to handle EXTRA_SOURCES and
EXTRA_FILES settings being split across multiple lines, which is how
they appear in upstream.
Reviewed-on: https://github.com/dlang/dmd/pull/9517
gcc/testsuite/ChangeLog:
2019-03-30 Iain Buclaw <ibuclaw@gdcproject.org>
* gdc.test/gdc-test.exp (gdc-copy-extra): Append copied files to
cleanup_extra_files.
(dmd2dg): Copy additional files after test is processed.
(gdc-do-test): Remove all copied files after test.
From-SVN: r270038
|
|
Fixes memory leak in the front-end symbol mangler, and introduces
recognition and rejection of a few more C types and directives.
Reviewed-on: https://github.com/dlang/dmd/pull/9492
From-SVN: r269945
|
|
Introduces a fix for a segfault when building without object.d being
present, as well as MinGW host build errors in dmd/root/filename.c.
Updates a couple of non-portable tests, removing one and fixing the
other.
From-SVN: r269897
|
|
PR d/88990
d/dmd: Merge upstream dmd 8d4c876c6
The extern storage class flag was wrongly propagated to function scope
when starting the semantic pass on the body.
Fixes https://gcc.gnu.org/PR88990
Reviewed-on: https://github.com/dlang/dmd/pull/9452
From-SVN: r269708
|
|
Backports fixes for many ICEs that occurred when using the vector .array
property in both CTFE and code generation passes.
Fixes https://gcc.gnu.org/PR88957
Reviewed-on: https://github.com/dlang/dmd/pull/9438
gcc/d/ChangeLog:
2019-03-13 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/88957
* expr.cc (ExprVisitor::visit(VectorArrayExp)): New override.
gcc/testsuite/ChangeLog:
2019-03-13 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/88957
* gdc.dg/pr88957.d: New test.
* gdc.dg/simd.d: Add new vector tests.
From-SVN: r269627
|
|
Fixes C++ mangling for substituted basic types that are target-specific.
Introduces a new method that currently does nothing, but could in future
make use of flag_abi_version as extern(C++) integration improves in
latter versions of the D front-end.
Reviewed-on: https://github.com/dlang/dmd/pull/9439
gcc/d/ChangeLog:
2019-03-12 Iain Buclaw <ibuclaw@gdcproject.org>
* d-lang.cc (d_init_options): Set global.params.cplusplus to C++14.
* d-target.cc (Target::cppFundamentalType): New method.
From-SVN: r269611
|
|
PR d/87824
d/dmd: Merge upstream dmd fcc235e8e
Associative arrays are value types, which are not covariant with the
pointer type typeof(null).
Updates https://gcc.gnu.org/PR87824
Reviewed-on: https://github.com/dlang/dmd/pull/9435
From-SVN: r269561
|
|
PR d/89016
d/dmd: Merge upstream dmd da26db819
Backports supplementary fix for ICE on importing deprecated modules.
Updates https://gcc.gnu.org/PR89016
Reviewed-on: https://github.com/dlang/dmd/pull/9436
From-SVN: r269560
|
|
PR d/88958
d/dmd: Merge upstream dmd 0fc786f49
Backport fix to disallow passing functions as parameters.
Fixes https://gcc.gnu.org/PR88958
Reviewed-on: https://github.com/dlang/dmd/pull/9437
From-SVN: r269557
|
|
Fixes https://gcc.gnu.org/PR89016
Reviewed-on: https://github.com/dlang/dmd/pull/9427
From-SVN: r269465
|
|
Backports support for extern(C++, "namespace"), which makes the
core.stdcpp package compilable.
Added predefined condition for CppRuntime_Gcc unconditionally, as it is
unlikely that D code will be linking to anything other than libstdc++
when extern(C++) is used.
Reviewed-on: https://github.com/dlang/dmd/pull/9371
gcc/d/ChangeLog:
2019-03-01 Iain Buclaw <ibuclaw@gdcproject.org>
* d-builtins.cc (d_init_versions): Add CppRuntime_Gcc as predefined
version condition.
From-SVN: r269304
|
|
Backported fix from upstream dmd 2.079 for an internal compiler error
that occurred during semantic analysis on a recursive field initializer.
Fixes https://gcc.gnu.org/PR88989
Reviewed-on: https://github.com/dlang/dmd/pull/9284
From-SVN: r268740
|
|
Fixes bootstrap regression introduced by the previous merge.
Reviewed-on: https://github.com/dlang/dmd/pull/9283
From-SVN: r268167
|
|
Reduces the memory footprint of the CTFE interpreter by replacing new
with emplacement new in many places.
gcc/d/ChangeLog:
2019-01-21 Iain Buclaw <ibuclaw@gdcproject.org>
* d-frontend.cc (Compiler::paintAsType): Update for new signature.
From-SVN: r268124
|
|
One fix in the asm statement parser to stop parsing if the end of the
statement has been reached, and moves all inline asm tests to gdc.dg.
These being adjusted where necessary to test the GCC style instead.
gcc/testsuite/ChangeLog:
2019-01-14 Iain Buclaw <ibuclaw@gdcproject.org>
* gdc.dg/asm1.d: New test.
* gdc.dg/asm2.d: New test.
* gdc.dg/asm3.d: New test.
* gdc.dg/asm4.d: New test.
* lib/gdc.exp (gdc_init): Set gcc_error_prefix and gcc_warning_prefix.
From-SVN: r267913
|
|
Updates the copyright years of all d/dmd sources.
Reviewed-on: https://github.com/dlang/dmd/pull/9181
From-SVN: r267778
|