d: Add support for compiling without libphobos library

Programming / Compilers / GCC - ibuclaw [138bc75d-0d04-0410-961f-82ee72b054a4] - 23 April 2019 20:08 EDT

Merges upstream dmd 3b3dca8be

Reviewed-on: https://github.com/dlang/dmd/pull/9678

gcc/d/ChangeLog:

2019-04-23 Iain Buclaw

- 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

- 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.

7ad41fff714 d: Add support for compiling without libphobos library.
gcc/d/ChangeLog | 31 ++++++
gcc/d/d-builtins.cc | 9 ++
gcc/d/d-codegen.cc | 5 +-
gcc/d/d-frontend.cc | 34 ++++++-
gcc/d/d-lang.cc | 31 +++++-
gcc/d/d-spec.cc | 6 ++
gcc/d/d-tree.h | 3 +-
gcc/d/decl.cc | 17 +++-
gcc/d/dmd/MERGE | 2 +-
gcc/d/dmd/clone.c | 12 +--
gcc/d/dmd/dcast.c | 2 +-
gcc/d/dmd/declaration.c | 4 +-
gcc/d/dmd/dinterpret.c | 6 +-
gcc/d/dmd/dmodule.c | 63 ------------
gcc/d/dmd/dstruct.c | 15 +--
gcc/d/dmd/expressionsem.c | 7 +-
gcc/d/dmd/func.c | 28 +++++-
gcc/d/dmd/globals.h | 15 ++-
gcc/d/dmd/idgen.c | 6 +-
gcc/d/dmd/opover.c | 8 +-
gcc/d/dmd/parse.c | 2 -
gcc/d/dmd/statementsem.c | 52 ++++++++--
gcc/d/expr.cc | 65 +++++++-----
gcc/d/gdc.texi | 19 ++++
gcc/d/lang.opt | 10 +-
gcc/d/modules.cc | 3 +-
gcc/d/toir.cc | 2 +-
gcc/d/typeinfo.cc | 78 +++++++++++----
gcc/testsuite/ChangeLog | 6 ++
gcc/testsuite/gdc.test/fail_compilation/fail2456.d | 110 +++++++++++++++++++++
.../gdc.test/fail_compilation/test18312.d | 15 +++
gcc/testsuite/gdc.test/gdc-test.exp | 3 +
32 files changed, 509 insertions(+), 160 deletions(-)

Upstream: gcc.gnu.org


  • Share