diff options
Diffstat (limited to 'gcc/d/modules.cc')
-rw-r--r-- | gcc/d/modules.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/d/modules.cc b/gcc/d/modules.cc index 8786344..06eb5ae 100644 --- a/gcc/d/modules.cc +++ b/gcc/d/modules.cc @@ -125,7 +125,7 @@ static Module *current_module_decl; by both module initialization and dso handlers. */ static FuncDeclaration * -get_internal_fn (tree ident, const Prot &prot) +get_internal_fn (tree ident, const Visibility &visibility) { Module *mod = current_module_decl; const char *name = IDENTIFIER_POINTER (ident); @@ -142,9 +142,9 @@ get_internal_fn (tree ident, const Prot &prot) FuncDeclaration *fd = FuncDeclaration::genCfunc (NULL, Type::tvoid, Identifier::idPool (name)); fd->generated = true; - fd->loc = Loc (mod->srcfile->toChars (), 1, 0); + fd->loc = Loc (mod->srcfile.toChars (), 1, 0); fd->parent = mod; - fd->protection = prot; + fd->visibility = visibility; fd->semanticRun = PASSsemantic3done; return fd; @@ -156,7 +156,9 @@ get_internal_fn (tree ident, const Prot &prot) static tree build_internal_fn (tree ident, tree expr) { - FuncDeclaration *fd = get_internal_fn (ident, Prot (Prot::private_)); + Visibility visibility; + visibility.kind = Visibility::private_; + FuncDeclaration *fd = get_internal_fn (ident, visibility); tree decl = get_symbol_decl (fd); tree old_context = start_function (fd); @@ -338,8 +340,9 @@ build_dso_cdtor_fn (bool ctor_p) } } */ - FuncDeclaration *fd = get_internal_fn (get_identifier (name), - Prot (Prot::public_)); + Visibility visibility; + visibility.kind = Visibility::public_; + FuncDeclaration *fd = get_internal_fn (get_identifier (name), visibility); tree decl = get_symbol_decl (fd); TREE_PUBLIC (decl) = 1; @@ -740,7 +743,8 @@ build_module_tree (Module *decl) /* Associate the module info symbol with a mock module. */ const char *name = concat (GDC_PREFIX ("modtest__"), decl->ident->toChars (), NULL); - Module *tm = Module::create (decl->arg, Identifier::idPool (name), 0, 0); + Module *tm = Module::create (decl->arg.ptr, Identifier::idPool (name), + 0, 0); Dsymbols members; /* Setting parent puts module in the same package as the current, to @@ -780,9 +784,7 @@ build_module_tree (Module *decl) /* Default behavior is to always generate module info because of templates. Can be switched off for not compiling against runtime library. */ - if (global.params.useModuleInfo - && Module::moduleinfo != NULL - && decl->ident != Identifier::idPool ("__entrypoint")) + if (global.params.useModuleInfo && Module::moduleinfo != NULL) { if (mi.ctors || mi.ctorgates) decl->sctor = build_funcs_gates_fn (get_identifier ("*__modctor"), |