diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-04-29 10:19:55 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-04-29 10:36:00 +0200 |
commit | 75f758a703924184fc07b01a138bb6f0028d077c (patch) | |
tree | 9b90b2c92161b246f7acd4494c5b1a2a3e4f1d09 /gcc/d/d-codegen.cc | |
parent | d81bc2af7d2700888e414eb5a322ff5f5b0df0bb (diff) | |
download | gcc-75f758a703924184fc07b01a138bb6f0028d077c.zip gcc-75f758a703924184fc07b01a138bb6f0028d077c.tar.gz gcc-75f758a703924184fc07b01a138bb6f0028d077c.tar.bz2 |
d: Merge bug fix from upstream dmd 06160ccae
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).
Diffstat (limited to 'gcc/d/d-codegen.cc')
-rw-r--r-- | gcc/d/d-codegen.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc index 12c6f13..b4927a2 100644 --- a/gcc/d/d-codegen.cc +++ b/gcc/d/d-codegen.cc @@ -66,6 +66,7 @@ d_decl_context (Dsymbol *dsym) { Dsymbol *parent = dsym; Declaration *decl = dsym->isDeclaration (); + AggregateDeclaration *ad = dsym->isAggregateDeclaration (); while ((parent = parent->toParent2 ())) { @@ -74,7 +75,8 @@ d_decl_context (Dsymbol *dsym) but only for extern(D) symbols. */ if (parent->isModule ()) { - if (decl != NULL && decl->linkage != LINKd) + if ((decl != NULL && decl->linkage != LINKd) + || (ad != NULL && ad->classKind != ClassKind::d)) return NULL_TREE; return build_import_decl (parent); |