From patchwork Tue Jun 16 21:59:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1310723 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=tk8+b1CS; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49mhvV28fsz9sSc for ; Wed, 17 Jun 2020 08:00:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F48838708A8; Tue, 16 Jun 2020 22:00:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F48838708A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592344801; bh=6vVFQP+PNL8aQPt/oRYfnnycJ/Fz7BykuIipGi27acY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=tk8+b1CSAw/1UW72+jD+IGZaBORTSUMtVQvmx883EfaUoG0BvERY3iquYFGxnvwnF UfF1h30SUrYjrv68p9xuRBm8qpd1eCl2JjdQxvfrFQtPw9OucG8GXanLyFfXe9lrLu Cky8MLXtoKaIHHLPFalFRjno1PUJOWXipd9nxCSw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by sourceware.org (Postfix) with ESMTPS id 31C34386F447 for ; Tue, 16 Jun 2020 21:59:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 31C34386F447 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 49mhvG2KFvzKmgv; Tue, 16 Jun 2020 23:59:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id Zzb6gETK4eQg; Tue, 16 Jun 2020 23:59:47 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Consistently format quotations in comments. Date: Tue, 16 Jun 2020 23:59:24 +0200 Message-Id: <20200616215933.3858164-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 3A56F175B X-Rspamd-Score: 1.79 / 15.00 / 15.00 X-Spam-Status: No, score=-17.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_ABUSE_SURBL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch updates comments to consistently format quotations in code comments throughout the D front-end. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain 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;