diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2019-03-01 10:21:54 +0000 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gcc.gnu.org> | 2019-03-01 10:21:54 +0000 |
commit | 9503d7b1ffd205eac2fbb6418578972f5f428b9f (patch) | |
tree | bad3ebab9e324ebba545e561514db3637267913c /gcc/d/dmd/cppmangle.c | |
parent | c6b363486fc0c421f09cbf7fbc9a7c8bd20ea4eb (diff) | |
download | gcc-9503d7b1ffd205eac2fbb6418578972f5f428b9f.zip gcc-9503d7b1ffd205eac2fbb6418578972f5f428b9f.tar.gz gcc-9503d7b1ffd205eac2fbb6418578972f5f428b9f.tar.bz2 |
d/dmd: Merge dmd upstream ed71446aa
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
Diffstat (limited to 'gcc/d/dmd/cppmangle.c')
-rw-r--r-- | gcc/d/dmd/cppmangle.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/d/dmd/cppmangle.c b/gcc/d/dmd/cppmangle.c index e26f764..b991417 100644 --- a/gcc/d/dmd/cppmangle.c +++ b/gcc/d/dmd/cppmangle.c @@ -196,8 +196,8 @@ class CppMangleVisitor : public Visitor Expression *e = isExpression(o); if (d && d->isFuncDeclaration()) { - bool is_nested = d->toParent() && - !d->toParent()->isModule() && + bool is_nested = d->toParent3() && + !d->toParent3()->isModule() && ((TypeFunction*)d->isFuncDeclaration()->type)->linkage == LINKcpp; if (is_nested) buf->writeByte('X'); @@ -271,7 +271,7 @@ class CppMangleVisitor : public Visitor */ Dsymbol *getInstance(Dsymbol *s) { - Dsymbol *p = s->toParent(); + Dsymbol *p = s->toParent3(); if (p) { if (TemplateInstance *ti = p->isTemplateInstance()) @@ -292,7 +292,7 @@ class CppMangleVisitor : public Visitor */ static Dsymbol *getQualifier(Dsymbol *s) { - Dsymbol *p = s->toParent(); + Dsymbol *p = s->toParent3(); return (p && !p->isModule()) ? p : NULL; } @@ -324,7 +324,7 @@ class CppMangleVisitor : public Visitor Dsymbol *s = ((TypeStruct*)t)->toDsymbol(NULL); if (s->ident != ident) return false; - Dsymbol *p = s->toParent(); + Dsymbol *p = s->toParent3(); if (!p) return false; TemplateInstance *ti = p->isTemplateInstance(); @@ -427,7 +427,7 @@ class CppMangleVisitor : public Visitor void cpp_mangle_name(Dsymbol *s, bool qualified) { //printf("cpp_mangle_name(%s, %d)\n", s->toChars(), qualified); - Dsymbol *p = s->toParent(); + Dsymbol *p = s->toParent3(); Dsymbol *se = s; bool write_prefix = true; if (p && p->isTemplateInstance()) @@ -435,7 +435,7 @@ class CppMangleVisitor : public Visitor se = p; if (find(p->isTemplateInstance()->tempdecl) >= 0) write_prefix = false; - p = p->toParent(); + p = p->toParent3(); } if (p && !p->isModule()) @@ -521,7 +521,7 @@ class CppMangleVisitor : public Visitor fatal(); } - Dsymbol *p = d->toParent(); + Dsymbol *p = d->toParent3(); if (p && !p->isModule()) //for example: char Namespace1::beta[6] should be mangled as "_ZN10Namespace14betaE" { buf->writestring("_ZN"); @@ -561,7 +561,7 @@ class CppMangleVisitor : public Visitor */ TemplateInstance *ti = d->parent->isTemplateInstance(); assert(ti); - Dsymbol *p = ti->toParent(); + Dsymbol *p = ti->toParent3(); if (p && !p->isModule() && tf->linkage == LINKcpp) { buf->writeByte('N'); @@ -581,7 +581,7 @@ class CppMangleVisitor : public Visitor } else { - Dsymbol *p = d->toParent(); + Dsymbol *p = d->toParent3(); if (p && !p->isModule() && tf->linkage == LINKcpp) { /* <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E @@ -997,7 +997,7 @@ public: else { Dsymbol *s = t->toDsymbol(NULL); - Dsymbol *p = s->toParent(); + Dsymbol *p = s->toParent3(); if (p && p->isTemplateInstance()) { /* https://issues.dlang.org/show_bug.cgi?id=17947 @@ -1044,7 +1044,7 @@ public: { Dsymbol *s = t->toDsymbol(NULL); - Dsymbol *p = s->toParent(); + Dsymbol *p = s->toParent3(); if (p && p->isTemplateInstance()) { /* https://issues.dlang.org/show_bug.cgi?id=17947 |