From cdbf48bed4e947f8d20c8c22d400fb52a407d46f Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Tue, 16 Jun 2020 15:57:58 +0200 Subject: [PATCH] d: Consistently format quotations in comments. gcc/d/ChangeLog: * d-builtins.cc: Update quotation formatting of comments. * d-codegen.cc: Likewise. * d-lang.cc: Likewise. * decl.cc: Likewise. * expr.cc: Likewise. * imports.cc: Likewise. * runtime.cc: Likewise. * toir.cc: Likewise. * typeinfo.cc: Likewise. * types.cc: Likewise. --- gcc/d/d-builtins.cc | 2 +- gcc/d/d-codegen.cc | 28 ++++++++++++++-------------- gcc/d/d-lang.cc | 2 +- gcc/d/decl.cc | 22 +++++++++++----------- gcc/d/expr.cc | 8 ++++---- gcc/d/imports.cc | 2 +- gcc/d/runtime.cc | 2 +- gcc/d/toir.cc | 22 +++++++++++----------- gcc/d/typeinfo.cc | 4 ++-- gcc/d/types.cc | 4 ++-- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc index f1bdcb9fafd..75eaa6b8a73 100644 --- a/gcc/d/d-builtins.cc +++ b/gcc/d/d-builtins.cc @@ -222,7 +222,7 @@ build_frontend_type (tree type) Identifier::idPool (IDENTIFIER_POINTER (TYPE_IDENTIFIER (type))) : NULL; /* Neither the `object' and `gcc.builtins' modules will not exist when - this is called. Use a stub 'object' module parent in the meantime. + this is called. Use a stub `object' module parent in the meantime. If `gcc.builtins' is later imported, the parent will be overridden with the correct module symbol. */ static Identifier *object = Identifier::idPool ("object"); diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc index 9d13e1263a9..b82e16fe79e 100644 --- a/gcc/d/d-codegen.cc +++ b/gcc/d/d-codegen.cc @@ -82,7 +82,7 @@ d_decl_context (Dsymbol *dsym) return build_import_decl (parent); } - /* Declarations marked as 'static' or '__gshared' are never + /* Declarations marked as `static' or `__gshared' are never part of any context except at module level. */ if (decl != NULL && decl->isDataseg ()) continue; @@ -164,7 +164,7 @@ declaration_type (Declaration *decl) if (declaration_reference_p (decl)) return build_reference_type (type); - /* The 'this' parameter is always const. */ + /* The `this' parameter is always const. */ if (decl->isThisDeclaration ()) return insert_type_modifiers (type, MODconst); @@ -1830,7 +1830,7 @@ call_by_alias_p (FuncDeclaration *caller, FuncDeclaration *callee) } /* Entry point for call routines. Builds a function call to FD. - OBJECT is the 'this' reference passed and ARGS are the arguments to FD. */ + OBJECT is the `this' reference passed and ARGS are the arguments to FD. */ tree d_build_call_expr (FuncDeclaration *fd, tree object, Expressions *arguments) @@ -1839,7 +1839,7 @@ d_build_call_expr (FuncDeclaration *fd, tree object, Expressions *arguments) build_address (get_symbol_decl (fd)), object, arguments); } -/* Builds a CALL_EXPR of type TF to CALLABLE. OBJECT holds the 'this' pointer, +/* Builds a CALL_EXPR of type TF to CALLABLE. OBJECT holds the `this' pointer, ARGUMENTS are evaluated in left to right order, saved and promoted before passing. */ @@ -2044,7 +2044,7 @@ build_float_modulus (tree type, tree arg0, tree arg1) } /* Build a function type whose first argument is a pointer to BASETYPE, - which is to be used for the 'vthis' context parameter for TYPE. + which is to be used for the `vthis' context parameter for TYPE. The base type may be a record for member functions, or a void for nested functions and delegates. */ @@ -2085,7 +2085,7 @@ get_frame_for_symbol (Dsymbol *sym) /* Check that the nested function is properly defined. */ if (!fd->fbody) { - /* Should instead error on line that references 'fd'. */ + /* Should instead error on line that references `fd'. */ error_at (make_location_t (fd->loc), "nested function missing body"); return null_pointer_node; } @@ -2181,7 +2181,7 @@ get_frame_for_symbol (Dsymbol *sym) { tree frame_ref = get_framedecl (thisfd, fdparent); - /* If 'thisfd' is a derived member function, then 'fdparent' is the + /* If `thisfd' is a derived member function, then `fdparent' is the overridden member function in the base class. Even if there's a closure environment, we should give the original stack data as the nested function frame. */ @@ -2195,12 +2195,12 @@ get_frame_for_symbol (Dsymbol *sym) if (cdo->isBaseOf (cd, &offset) && offset != 0) { /* Generate a new frame to pass to the overriden function that - has the 'this' pointer adjusted. */ + has the `this' pointer adjusted. */ gcc_assert (offset != OFFSET_RUNTIME); tree type = FRAMEINFO_TYPE (get_frameinfo (fdoverride)); tree fields = TYPE_FIELDS (type); - /* The 'this' field comes immediately after the '__chain'. */ + /* The `this' field comes immediately after the `__chain'. */ tree thisfield = chain_index (1, fields); vec *ve = NULL; @@ -2263,7 +2263,7 @@ d_nested_struct (StructDeclaration *sd) /* Starting from the current function FD, try to find a suitable value of - 'this' in nested function instances. A suitable 'this' value is an + `this' in nested function instances. A suitable `this' value is an instance of OCD or a class that has OCD as a base. */ static tree @@ -2301,7 +2301,7 @@ find_this_tree (ClassDeclaration *ocd) return NULL_TREE; } -/* Retrieve the outer class/struct 'this' value of DECL from +/* Retrieve the outer class/struct `this' value of DECL from the current function. */ tree @@ -2327,7 +2327,7 @@ build_vthis (AggregateDeclaration *decl) outer = ((TemplateInstance *) outer->parent)->enclosing; } - /* For outer classes, get a suitable 'this' value. + /* For outer classes, get a suitable `this' value. For outer functions, get a suitable frame/closure pointer. */ ClassDeclaration *cdo = outer->isClassDeclaration (); FuncDeclaration *fdo = outer->isFuncDeclaration (); @@ -2412,7 +2412,7 @@ build_frame_type (tree ffi, FuncDeclaration *fd) } } - /* Also add hidden 'this' to outer context. */ + /* Also add hidden `this' to outer context. */ if (fd->vthis) { for (size_t i = 0; i < fd->closureVars.length; i++) @@ -2542,7 +2542,7 @@ build_closure (FuncDeclaration *fd) } /* Return the frame of FD. This could be a static chain or a closure - passed via the hidden 'this' pointer. */ + passed via the hidden `this' pointer. */ tree get_frameinfo (FuncDeclaration *fd) diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 34fbc5f41d8..dd5a83cb4fe 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -337,7 +337,7 @@ d_init_options_struct (gcc_options *opts) /* Avoid range issues for complex multiply and divide. */ opts->x_flag_complex_method = 2; - /* Unlike C, there is no global 'errno' variable. */ + /* Unlike C, there is no global `errno' variable. */ opts->x_flag_errno_math = 0; opts->frontend_set_flag_errno_math = true; diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc index 28d1d6d5f31..f43b334aac7 100644 --- a/gcc/d/decl.cc +++ b/gcc/d/decl.cc @@ -859,7 +859,7 @@ public: /* Special arguments... */ - /* 'this' parameter: + /* `this' parameter: For nested functions, D still generates a vthis, but it should not be referenced in any expression. */ if (d->vthis) @@ -1205,7 +1205,7 @@ get_symbol_decl (Declaration *decl) } else if (fd->isThis ()) { - /* Add an extra argument for the 'this' parameter. The handle type is + /* Add an extra argument for the `this' parameter. The handle type is used even if there is no debug info. It is needed to make sure virtual member functions are not called statically. */ AggregateDeclaration *ad = fd->isMember2 (); @@ -1226,11 +1226,11 @@ get_symbol_decl (Declaration *decl) } else if (fd->isMain () || fd->isCMain ()) { - /* The main function is named 'D main' to distinguish from C main. */ + /* The main function is named `D main' to distinguish from C main. */ if (fd->isMain ()) DECL_NAME (decl->csym) = get_identifier (fd->toPrettyChars (true)); - /* 'void main' is implicitly converted to returning an int. */ + /* `void main' is implicitly converted to returning an int. */ newfntype = build_function_type (d_int_type, TYPE_ARG_TYPES (fntype)); } @@ -1253,14 +1253,14 @@ get_symbol_decl (Declaration *decl) DECL_NO_INLINE_WARNING_P (decl->csym) = 1; } - /* In [pragma/inline], functions decorated with 'pragma(inline)' affects + /* In [pragma/inline], functions decorated with `pragma(inline)' affects whether they are inlined or not. */ if (fd->inlining == PINLINEalways) DECL_DECLARED_INLINE_P (decl->csym) = 1; else if (fd->inlining == PINLINEnever) DECL_UNINLINABLE (decl->csym) = 1; - /* Function was declared 'naked'. */ + /* Function was declared `naked'. */ if (fd->naked) { insert_decl_attribute (decl->csym, "naked"); @@ -1466,7 +1466,7 @@ get_decl_tree (Declaration *decl) DECL_LANG_FRAME_FIELD (t)); } - /* Get the non-local 'this' value by going through parent link + /* Get the non-local `this' value by going through parent link of nested classes, this routine pretty much undoes what getRightThis in the frontend removes from codegen. */ if (vd->parent != fd && vd->isThisDeclaration ()) @@ -1501,9 +1501,9 @@ get_decl_tree (Declaration *decl) fd = outer->isFuncDeclaration (); while (fd != NULL) { - /* If outer function creates a closure, then the 'this' + /* If outer function creates a closure, then the `this' value would be the closure pointer, and the real - 'this' the first field of that closure. */ + `this' the first field of that closure. */ tree ff = get_frameinfo (fd); if (FRAMEINFO_CREATES_FRAME (ff)) { @@ -1900,7 +1900,7 @@ start_function (FuncDeclaration *fd) cfun->language = ggc_cleared_alloc (); cfun->language->function = fd; - /* Default chain value is 'null' unless parent found. */ + /* Default chain value is `null' unless parent found. */ cfun->language->static_chain = null_pointer_node; /* Find module for this function. */ @@ -2194,7 +2194,7 @@ build_new_class_expr (ClassReferenceExp *expr) /* Get the VAR_DECL of the static initializer symbol for the struct/class DECL. If this does not yet exist, create it. The static initializer data is - accessible via TypeInfo, and is also used in 'new class' and default + accessible via TypeInfo, and is also used in `new class' and default initializing struct literals. */ tree diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index bf9bb45690a..e1842cc6fee 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -1739,7 +1739,7 @@ public: thisexp = TREE_OPERAND (thisexp, 1); } - /* Want reference to 'this' object. */ + /* Want reference to `this' object. */ if (!POINTER_TYPE_P (TREE_TYPE (thisexp))) thisexp = build_address (thisexp); @@ -1770,7 +1770,7 @@ public: { /* This gets the true function type, getting the function type from e1->type can sometimes be incorrect, such as when calling - a 'ref' return function. */ + a `ref' return function. */ tf = get_function_type (e1b->isDotVarExp ()->var->type); } else @@ -1794,7 +1794,7 @@ public: if (fd->isNested ()) { - /* Maybe re-evaluate symbol storage treating 'fd' as public. */ + /* Maybe re-evaluate symbol storage treating `fd' as public. */ if (call_by_alias_p (d_function_chain->function, fd)) TREE_PUBLIC (callee) = 1; @@ -2099,7 +2099,7 @@ public: { Type *ftype = e->type->toBasetype (); - /* This check is for lambda's, remove 'vthis' as function isn't nested. */ + /* This check is for lambda's, remove `vthis' as function isn't nested. */ if (e->fd->tok == TOKreserved && ftype->ty == Tpointer) { e->fd->tok = TOKfunction; diff --git a/gcc/d/imports.cc b/gcc/d/imports.cc index e6e696ab325..34cd5e1fdd2 100644 --- a/gcc/d/imports.cc +++ b/gcc/d/imports.cc @@ -202,7 +202,7 @@ build_import_decl (Dsymbol *d) input_location = saved_location; } - /* Not all visitors set 'isym'. */ + /* Not all visitors set `isym'. */ return d->isym ? d->isym : NULL_TREE; } diff --git a/gcc/d/runtime.cc b/gcc/d/runtime.cc index ab1c04db4de..b4426e150ba 100644 --- a/gcc/d/runtime.cc +++ b/gcc/d/runtime.cc @@ -219,7 +219,7 @@ build_libcall_decl (const char *name, d_libcall_type return_type, bool varargs = false; tree fntype; - /* Add parameter types, using 'void' as the last parameter type + /* Add parameter types, using `void' as the last parameter type to mean this function accepts a variable list of arguments. */ va_list ap; va_start (ap, nparams); diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc index 130cbbafe00..b6f72092e5f 100644 --- a/gcc/d/toir.cc +++ b/gcc/d/toir.cc @@ -564,14 +564,14 @@ public: { this->start_scope (level_cond); - /* Build the outer 'if' condition, which may produce temporaries + /* Build the outer `if' condition, which may produce temporaries requiring scope destruction. */ tree ifcond = convert_for_condition (build_expr_dtor (s->condition), s->condition->type); tree ifbody = void_node; tree elsebody = void_node; - /* Build the 'then' branch. */ + /* Build the `then' branch. */ if (s->ifbody) { push_stmt_list (); @@ -579,7 +579,7 @@ public: ifbody = pop_stmt_list (); } - /* Now build the 'else' branch, which may have nested 'else if' parts. */ + /* Now build the `else' branch, which may have nested `else if' parts. */ if (s->elsebody) { push_stmt_list (); @@ -627,7 +627,7 @@ public: this->pop_continue_label (lcontinue); } - /* Build the outer 'while' condition, which may produce temporaries + /* Build the outer `while' condition, which may produce temporaries requiring scope destruction. */ tree exitcond = convert_for_condition (build_expr_dtor (s->condition), s->condition->type); @@ -885,7 +885,7 @@ public: { tree defaultlabel = this->lookup_label (s->sdefault); - /* The default label is the last 'else' block. */ + /* The default label is the last `else' block. */ if (s->hasVars) { this->do_jump (defaultlabel); @@ -917,7 +917,7 @@ public: SWITCH_BREAK_LABEL_P (lbreak) = 1; - /* If the switch had any 'break' statements, emit the label now. */ + /* If the switch had any `break' statements, emit the label now. */ this->pop_break_label (lbreak); this->finish_scope (); } @@ -968,7 +968,7 @@ public: this->build_stmt (s->statement); } - /* Implements 'goto default' by jumping to the label associated with + /* Implements `goto default' by jumping to the label associated with the DefaultStatement in a switch block. */ void visit (GotoDefaultStatement *s) @@ -977,7 +977,7 @@ public: this->do_jump (label); } - /* Implements 'goto case' by jumping to the label associated with the + /* Implements `goto case' by jumping to the label associated with the CaseStatement in a switch block. */ void visit (GotoCaseStatement *s) @@ -1112,7 +1112,7 @@ public: if (s->wthis) { - /* Perform initialisation of the 'with' handle. */ + /* Perform initialisation of the `with' handle. */ ExpInitializer *ie = s->wthis->_init->isExpInitializer (); gcc_assert (ie != NULL); @@ -1127,7 +1127,7 @@ public: this->finish_scope (); } - /* Implements 'throw Object'. Frontend already checks that the object + /* Implements `throw Object'. Frontend already checks that the object thrown is a class type, but does not check if it is derived from Object. Foreign objects are not currently supported at run-time. */ @@ -1432,7 +1432,7 @@ public: optimization, this could be unset when building in release mode. */ ASM_VOLATILE_P (exp) = 1; - /* If the function has been annotated with 'pragma(inline)', then mark + /* If the function has been annotated with `pragma(inline)', then mark the asm expression as being inline as well. */ if (this->func_->inlining == PINLINEalways) ASM_INLINE_P (exp) = 1; diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc index f3051d3e122..b03019bdff5 100644 --- a/gcc/d/typeinfo.cc +++ b/gcc/d/typeinfo.cc @@ -456,7 +456,7 @@ class TypeInfoVisitor : public Visitor CONSTRUCTOR_APPEND_ELT (v, size_int (2), value); } - /* The 'this' offset. */ + /* The `this' offset. */ CONSTRUCTOR_APPEND_ELT (v, size_int (3), size_int (b->offset)); /* Add to the array of interfaces. */ @@ -1483,7 +1483,7 @@ create_typeinfo (Type *type, Module *mod) /* Kinds of TypeInfo that add one extra pointer field. */ if (tk == TK_SHARED_TYPE) { - /* Does both 'shared' and 'shared const'. */ + /* Does both `shared' and `shared const'. */ t->vtinfo = TypeInfoSharedDeclaration::create (t); ident = Identifier::idPool ("TypeInfo_Shared"); } diff --git a/gcc/d/types.cc b/gcc/d/types.cc index ba7e29a12e1..b8984a50ff0 100644 --- a/gcc/d/types.cc +++ b/gcc/d/types.cc @@ -106,7 +106,7 @@ same_type_p (Type *t1, Type *t2) return false; } -/* Returns 'Object' type which all D classes are derived from. */ +/* Returns `Object' type which all D classes are derived from. */ Type * get_object_type (void) @@ -204,7 +204,7 @@ insert_type_modifiers (tree type, unsigned mod) tree qualtype = build_qualified_type (type, quals); - /* Mark whether the type is qualified 'shared'. */ + /* Mark whether the type is qualified `shared'. */ if (mod & MODshared) TYPE_SHARED (qualtype) = 1; -- 2.30.2