Re: [HACKERS] Preliminary results for proposed new pgindent implementation - Mailing list pgsql-hackers
From | Tom Lane |
---|---|
Subject | Re: [HACKERS] Preliminary results for proposed new pgindent implementation |
Date | |
Msg-id | 25566.1495220094@sss.pgh.pa.us Whole thread Raw |
In response to | Re: [HACKERS] Preliminary results for proposed new pgindent implementation (Tom Lane <tgl@sss.pgh.pa.us>) |
List | pgsql-hackers |
I wrote: > What I was just looking at is the possibility of absorbing struct > tags ("xllist" in the above) as if they were typedef names. In > at least 95% of our usages, if a struct has a tag then the tag is > also the struct's typedef name. The reason this is interesting > is that it looks like (on at least Linux and macOS) the debug info > captures struct tags even when it misses the corresponding typedef. > We could certainly create a coding rule that struct tags *must* > match struct typedef names for our own code, but I'm not sure what > violations of that convention might appear in system headers. I did an experiment with seeing what would happen to the typedef list if we included struct tags. On my Linux box, that adds about 10% more names (3343 instead of 3028). A lot of them would be good to have, but there are a lot of others that maybe not so much. See attached diff output. I hesitate to suggest any rule as grotty as "take struct tags only if they begin with an upper-case letter", but that would actually work really well, looks like. regards, tom lane --- typedefs.std 2017-05-19 14:41:15.357406399 -0400 +++ typedefs.log 2017-05-19 14:46:11.978739384 -0400 @@ -39,17 +39,24 @@ AggSplit AggState AggStatePerAgg +AggStatePerAggData AggStatePerGroup +AggStatePerGroupData AggStatePerHash +AggStatePerHashData AggStatePerPhase +AggStatePerPhaseData AggStatePerTrans +AggStatePerTransData AggStrategy Aggref AggrefExprState AlenState Alias AllocBlock +AllocBlockData AllocChunk +AllocChunkData AllocPointer AllocSet AllocSetContext @@ -118,6 +125,7 @@ ArrayExprIterState ArrayIOData ArrayIterator +ArrayIteratorData ArrayMapState ArrayMetaState ArrayParseState @@ -153,6 +161,7 @@ BITVECP BMS_Comparison BMS_Membership +BND BN_CTX BOX BTArrayKeyInfo @@ -167,6 +176,7 @@ BTPageStat BTPageState BTParallelScanDesc +BTParallelScanDescData BTScanOpaque BTScanOpaqueData BTScanPos @@ -251,6 +261,7 @@ BufFile Buffer BufferAccessStrategy +BufferAccessStrategyData BufferAccessStrategyType BufferCachePagesContext BufferCachePagesRec @@ -263,6 +274,7 @@ BuildAccumulator BuiltinScript BulkInsertState +BulkInsertStateData CACHESIGN CAC_state CEOUC_WAIT_MODE @@ -295,6 +307,7 @@ CheckpointStatsData CheckpointerRequest CheckpointerShmemStruct +CheckpointerSlotMapping Chromosome City CkptSortItem @@ -351,12 +364,14 @@ CompressorState ConditionVariable ConditionalStack +ConditionalStackData ConfigData ConfigVariable ConnCacheEntry ConnCacheKey ConnStatusType ConnType +ConnectionOption ConnectionStateEnum ConsiderSplitContext Const @@ -424,6 +439,7 @@ CustomExecMethods CustomOutPtrType CustomPath +CustomPathMethods CustomScan CustomScanMethods CustomScanState @@ -453,6 +469,7 @@ DeclareCursorStmt DecodedBkpBlock DecodingOutputState +DecomprData DefElem DefElemAction DefaultACLInfo @@ -484,6 +501,7 @@ DomainIOData DropBehavior DropOwnedStmt +DropRelationCallbackState DropReplicationSlotCmd DropRoleStmt DropStmt @@ -499,6 +517,10 @@ DumpableObjectType DynamicFileList DynamicZoneAbbrev +ECPGgeneric_varchar +ECPGstruct_member +ECPGtype +ECPGtype_information_cache EC_KEY EDGE ENGINE @@ -517,6 +539,7 @@ EditableObjectType ElementsState EnableTimeoutParams +EncStat EndBlobPtrType EndBlobsPtrType EndDataPtrType @@ -607,6 +630,7 @@ FieldStore File FileFdwExecutionState +FileFdwOption FileFdwPlanState FileName FileNameMap @@ -828,7 +852,9 @@ GinPostingList GinQualCounts GinScanEntry +GinScanEntryData GinScanKey +GinScanKeyData GinScanOpaque GinScanOpaqueData GinState @@ -844,6 +870,7 @@ GistSplitUnion GistSplitVector GlobalTransaction +GlobalTransactionData GrantObjectType GrantRoleStmt GrantStmt @@ -900,8 +927,11 @@ HashJoin HashJoinState HashJoinTable +HashJoinTableData HashJoinTuple +HashJoinTupleData HashMemoryChunk +HashMemoryChunkData HashMetaPage HashMetaPageData HashPageOpaque @@ -920,6 +950,7 @@ HeadlineParsedText HeadlineWordEntry HeapScanDesc +HeapScanDescData HeapTuple HeapTupleData HeapTupleFields @@ -967,6 +998,7 @@ IndexRuntimeKeyInfo IndexScan IndexScanDesc +IndexScanDescData IndexScanState IndexStateFlagsAction IndexStmt @@ -1008,6 +1040,7 @@ IterateJsonStringValuesState JEntry JHashState +JhashState Join JoinCostWorkspace JoinExpr @@ -1132,6 +1165,7 @@ LogicalTapeSet MAGIC MBuf +MDCBufData MJEvalResult MVDependencies MVDependency @@ -1152,6 +1186,7 @@ MergeAppendState MergeJoin MergeJoinClause +MergeJoinClauseData MergeJoinState MergePath MergeScanSelCache @@ -1211,10 +1246,14 @@ NullTestType Numeric NumericAggState +NumericData NumericDigit +NumericLong +NumericShort NumericSortSupport NumericSumAccum NumericVar +ONEXIT OP OSAPerGroupState OSAPerQueryState @@ -1241,6 +1280,7 @@ OidOptions OkeysState OldSerXidControl +OldSerXidControlData OldSnapshotControlData OldToNewMapping OldToNewMappingData @@ -1303,6 +1343,7 @@ PGQueryClass PGRUsage PGSemaphore +PGSemaphoreData PGSetenvStatusType PGShmemHeader PGTransactionStatusType @@ -1449,7 +1490,9 @@ ParallelContext ParallelExecutorInfo ParallelHeapScanDesc +ParallelHeapScanDescData ParallelIndexScanDesc +ParallelIndexScanDescData ParallelSlot ParallelState ParallelWorkerInfo @@ -1459,6 +1502,7 @@ ParamFetchHook ParamKind ParamListInfo +ParamListInfoData ParamPathInfo ParamRef ParentMapEntry @@ -1482,6 +1526,7 @@ PartitionDispatchData PartitionElem PartitionKey +PartitionKeyData PartitionListValue PartitionRangeBound PartitionRangeDatum @@ -1561,6 +1606,8 @@ Pg_magic_struct PipeProtoChunk PipeProtoHeader +PktData +PktStreamStat PlaceHolderInfo PlaceHolderVar Plan @@ -1584,6 +1631,7 @@ PopulateRecordsetState Port Portal +PortalData PortalHashEnt PortalStatus PortalStrategy @@ -1596,7 +1644,9 @@ PredIterInfo PredIterInfoData PredXactList +PredXactListData PredXactListElement +PredXactListElementData PredicateLockData PredicateLockTargetType PrepareStmt @@ -1672,6 +1722,7 @@ RBOrderControl RBTree RBTreeIterator +RELCACHECALLBACK RIX RI_CompareHashEntry RI_CompareKey @@ -1680,7 +1731,9 @@ RI_QueryKey RTEKind RWConflict +RWConflictData RWConflictPoolHeader +RWConflictPoolHeaderData Range RangeBound RangeBox @@ -1790,6 +1843,7 @@ ReservoirStateData ResourceArray ResourceOwner +ResourceOwnerData ResourceReleaseCallback ResourceReleaseCallbackItem ResourceReleasePhase @@ -1805,6 +1859,7 @@ RewriteMappingFile RewriteRule RewriteState +RewriteStateData RmgrData RmgrDescData RmgrId @@ -1836,6 +1891,7 @@ SISeg SMgrRelation SMgrRelationData +SN_env SPELL SPIPlanPtr SPITupleTable @@ -1847,6 +1903,7 @@ SQLDropObject SQLFunctionCache SQLFunctionCachePtr +SQLFunctionParseInfo SQLFunctionParseInfoPtr SQLValueFunction SQLValueFunctionOp @@ -1855,6 +1912,7 @@ SSL_CTX STRLEN SV +SYSCACHECALLBACK SampleScan SampleScanGetSampleSize_function SampleScanState @@ -1895,6 +1953,7 @@ SetOpPath SetOpState SetOpStatePerGroup +SetOpStatePerGroupData SetOpStrategy SetOperation SetOperationStmt @@ -2030,6 +2089,7 @@ Syn SyncRepConfigData SysScanDesc +SysScanDescData SyscacheCallbackFunction SystemRowsSamplerData SystemSamplerData @@ -2064,6 +2124,7 @@ TSQuery TSQueryData TSQueryParserState +TSQueryParserStateData TSQuerySign TSReadPointer TSTemplateInfo @@ -2072,6 +2133,7 @@ TSVectorBuildState TSVectorData TSVectorParseState +TSVectorParseStateData TSVectorStat TState TStoreState @@ -2176,6 +2238,7 @@ TupleHashEntryData TupleHashIterator TupleHashTable +TupleHashTableData TupleQueueReader TupleRemapClass TupleRemapInfo @@ -2290,6 +2353,7 @@ WindowStatePerAgg WindowStatePerAggData WindowStatePerFunc +WindowStatePerFuncData WithCheckOption WithClause WordEntry @@ -2347,6 +2411,7 @@ XactCallbackItem XactEvent XactLockTableWaitInfo +XidCache XidStatus XmlExpr XmlExprOp @@ -2357,11 +2422,79 @@ YYSTYPE YY_BUFFER_STATE YY_CHAR +ZipStat +_DestReceiver +_FuncCandidateList +_IndexList +_MdfdVec +_PQconninfoOption +_PQprintOpt +_PublicationInfo +_PublicationRelInfo _SPI_connection _SPI_plan +_SubscriptionInfo +_TTOffList +_accessMethodInfo +_aggInfo +_archiveHandle +_attrDefInfo +_avl_node +_avl_tree +_blobInfo +_castInfo +_cfgInfo +_collInfo +_constraintInfo +_convInfo +_defaultACLInfo +_defines +_dictInfo +_dumpOptions +_dumpableObject +_evttriggerInfo +_extensionInfo +_extensionMemberId +_fdwInfo +_foreignServerInfo +_funcInfo +_helpStruct +_if_value +_include_path +_indxInfo +_inhInfo +_internalPQconninfoOption +_namespaceInfo +_opclassInfo +_opfamilyInfo +_oprInfo +_outputContext +_param +_pivot_field +_policyInfo +_procLangInfo +_prsInfo +_psqlSettings +_restoreOptions +_ruleInfo +_shellTypeInfo +_statsExtInfo +_tableDataInfo +_tableInfo +_tmplInfo +_tocEntry +_transformInfo +_triggerInfo +_typeInfo +_variable +_yy_buffer acquireLocksOnSubLinks_context +addrinfo +adhoc_opts adjust_appendrel_attrs_context +aff_struct allocfunc +am_propname ambeginscan_function ambuild_function ambuildempty_function @@ -2375,6 +2508,7 @@ aminitparallelscan_function aminsert_function ammarkpos_function +among amoptions_function amparallelrescan_function amproperty_function @@ -2382,10 +2516,18 @@ amrestrpos_function amvacuumcleanup_function amvalidate_function +arc +arcbatch +arcp +arguments array_iter array_unnest_fctx assign_collations_context +assignment +attrDefault +auto_mem autovac_table +av av_relation avl_dbase avl_node @@ -2400,11 +2542,20 @@ bitmapword bits32 bits8 +bkend +block bool brin_column_state +buftag bytea cached_re_str +cachedesc +carc cashKEY +catcache +catcacheheader +catclist +catctup cfp check_agg_arguments_context check_function_callback @@ -2414,18 +2565,34 @@ check_ungrouped_columns_context chkpass chr +cipher_info clock_t cmpEntriesArg cmpfunc +cname +cnfa codes_t coercion collation_cache_entry color +colordesc +colormap colormaprange +config_bool +config_enum +config_enum_entry +config_generic +config_int +config_real +config_string config_var_value +connection +constrCheck contain_aggs_of_level_context +context convert_testexpr_context copy_data_source_cb +copy_options core_YYSTYPE core_yy_extra_type core_yyscan_t @@ -2435,24 +2602,39 @@ createdb_failure_params crosstab_HashEnt crosstab_cat_desc +crosstab_hashent +cursor +cv +cvec +datapagemap +datapagemap_iterator datapagemap_iterator_t datapagemap_t dateKEY datetkn dce_uuid_t +ddlinfo +debug_expect decimal deparse_columns deparse_context deparse_expr_cxt deparse_namespace +descriptor +descriptor_item destructor dev_t +df_files +dfa +digest_info directory_fctx +dirent disassembledLeaf dlist_head dlist_iter dlist_mutable_iter dlist_node +dropmsgstrings ds_state dsa_area dsa_area_control @@ -2476,6 +2658,9 @@ ec_member_foreign_arg ec_member_matches_arg emit_log_hook_type +encoding_match +epoll_event +error_desc eval_const_expressions_context event_trigger_command_tag_check_result event_trigger_support_data @@ -2485,6 +2670,7 @@ fd_set fe_scram_state fe_scram_state_enum +fetch_desc file_action_t file_entry_t file_type_t @@ -2499,12 +2685,17 @@ flex_int32_t float4 float4KEY +float4key float8 float8KEY +float8key fmNodePtr fmgr_hook_type +fmgr_security_definer_cache +fns foreign_glob_cxt foreign_loc_cxt +fp_info freefunc fsec_t gbt_vsrt_arg @@ -2515,6 +2706,7 @@ generate_series_timestamp_fctx generate_series_timestamptz_fctx generate_subscripts_fctx +generator get_agg_clause_costs_context get_attavgwidth_hook_type get_index_stats_hook_type @@ -2536,45 +2728,63 @@ gistxlogPage gistxlogPageSplit gistxlogPageUpdate +group grouping_sets_data gseg_picksplit_item gtrgm_consistent_cache +guc_stack +guts +gv gzFile hashfunc hbaPort +he heap_page_items_state help_handler hlCheck +hostent hstoreCheckKeyLen_t hstoreCheckValLen_t hstorePairs_t hstoreUniquePairs_t hstoreUpgrade_t +hv hyperLogLogState ifState +ifaddrs import_error_callback_arg +in6_addr +in_addr +index indexed_tlist inet inetKEY inet_struct +inetkey inline_error_callback_arg ino_t inquiry instr_time int16 int16KEY +int16key int2vector int32 int32KEY int32_t +int32key int64 int64KEY +int64key int8 internalPQconninfoOption +interpreter intptr_t intvKEY +io itemIdSort itemIdSortData +itimerval join_search_hook_type json_aelem_action json_ofield_action @@ -2582,18 +2792,23 @@ json_struct_action keyEntryData key_t +lc_time_T lclContext lclTocEntry +lconv leafSegmentInfo line_t +lineptr locale_t locate_agg_of_level_context locate_var_of_level_context locate_windowfunc_context logstreamer_param +loop lquery lquery_level lquery_variant +lsinfo ltree ltree_gist ltree_level @@ -2604,11 +2819,13 @@ macaddr macaddr8 macaddr_sortsupport_state +magic map_variable_attnos_context max_parallel_hazard_context mb2wchar_with_len_converter mbcharacter_incrementer mbdisplaylen_converter +mbinterval mblen_converter mbverifier md5_ctxt @@ -2619,18 +2836,27 @@ movedb_failure_params mxact mxtruncinfo +nameData needs_fmgr_hook_type +nfa nodeitem normal_rand_fctx ntile_context numeric object_access_hook_type +object_type_map off_t oidKEY oidvector on_dsm_detach_callback on_exit_nicely_callback +op +opclasscacheent +option +options ossl_EVP_cipher_func +ossl_cipher +ossl_cipher_lookup output_type pagetable_hash pagetable_iterator @@ -2639,9 +2865,17 @@ pairingheap_node parallel_worker_main_type parse_error_callback_arg +passwd +pct_info pendingPosition +pgDataValue +pgLobjfuncs +pgMessageField +pgNotify pgParameterStatus pg_atomic_uint32 +pg_cancel +pg_conn pg_conn_host pg_conn_host_type pg_conv_map @@ -2652,12 +2886,15 @@ pg_enc2gettext pg_enc2name pg_encname +pg_encoding pg_int64 pg_local_to_utf_combined +pg_locale_struct pg_locale_t pg_mb_radix_tree pg_on_exit_callback pg_re_flags +pg_result pg_saslprep_rc pg_sha224_ctx pg_sha256_ctx @@ -2665,6 +2902,7 @@ pg_sha512_ctx pg_stack_base_t pg_time_t +pg_tm pg_tz pg_tz_cache pg_tzenum @@ -2676,6 +2914,9 @@ pg_wchar_tbl pgp_armor_headers_state pgpid_t +pgresAttDesc +pgresAttValue +pgresParamDesc pgsocket pgsql_thing_t pgssEntry @@ -2701,16 +2942,21 @@ plpgsql_CastHashEntry plpgsql_CastHashKey plpgsql_HashEnt +plpgsql_hashent pltcl_call_state pltcl_interp_desc pltcl_proc_desc pltcl_proc_key pltcl_proc_ptr pltcl_query_desc +pollfd +portalhashent pos_trgm post_parse_analyze_hook_type pqbool pqsigfunc +prep +prepared_statement printQueryOpt printTableContent printTableFooter @@ -2736,6 +2982,12 @@ pull_vars_context pullup_replace_vars_context pushdown_safety_info +px_alias +px_cipher +px_combo +px_crypt_algo +px_digest +px_hmac qsort_arg_comparator query_pathkeys_callback radius_attribute @@ -2755,6 +3007,7 @@ regmatch_t regoff_t regproc +relidcacheent relopt_bool relopt_gen relopt_int @@ -2770,18 +3023,25 @@ rendezvousHashEntry replace_rte_variables_callback replace_rte_variables_context +rerr rewrite_event +rix +rlimit rm_detail_t role_auth_extra row_security_policy_hook_type +rule +rusage save_buffer scram_HMAC_ctx scram_state scram_state_enum sem_t +separator sequence_magic set_join_pathlist_hook_type set_rel_pathlist_hook_type +sha1_ctxt shm_mq shm_mq_handle shm_mq_iovec @@ -2790,9 +3050,12 @@ shm_toc_entry shm_toc_estimator shmem_startup_hook_type +shmid_ds sig_atomic_t +sigaction sigjmp_buf signedbitmapword +sigpipe_info sigset_t size_t slist_head @@ -2800,8 +3063,15 @@ slist_mutable_iter slist_node slock_t +smalldfa smgrid +sockaddr +sockaddr_in +sockaddr_in6 +sockaddr_storage +sockaddr_un socklen_t +spell_struct spgBulkDeleteState spgChooseIn spgChooseOut @@ -2827,33 +3097,54 @@ spgxlogVacuumRoot split_pathtarget_context sql_error_callback_arg +sqlca_t +sqlda_compat +sqlda_struct +sqlname sqlparseInfo sqlparseState +sqlvar_compat +sqlvar_struct ss_lru_item_t ss_scan_location_t ss_scan_locations_t +sset ssize_t standard_qp_extra +stat +state +statement stemmer_module stmtCacheEntry storeInfo storeRes_func stream_stop_callback +su_symbol +subre +subst substitute_actual_parameters_context substitute_actual_srf_parameters_context substitute_multiple_relids_context +sv svtype symbol tablespaceinfo +tablesync_start_time_mapping teReqs teSection temp_tablespaces_extra +termios text +this_type timeKEY time_t timeout_handler_proc timeout_params +timespec +timeval tlist_vinfo +tm +tms toast_compress_header transferMode trgm @@ -2862,14 +3153,24 @@ tsKEY ts_db_fctx ts_tokentype +tsearch_config_match tsearch_readline_state +ttinfo +tupleConstr +tupleDesc tuplehash_hash tuplehash_iterator txid +typedefs +typinfo +typmap tzEntry +tzhead +tztry u_char u_int uchr +ucred uid_t uint16 uint16_t @@ -2886,6 +3187,7 @@ unicode_linestyle unit_conversion unlogged_relation_entry +user_args utf_local_conversion_func uuidKEY uuid_sortsupport_state @@ -2894,11 +3196,18 @@ va_list vacuumingOptions validate_string_relopt +var_list varatt_expanded +varatt_external +varatt_indirect varattrib_1b varattrib_1b_e varattrib_4b +variable +varlena +vars vbits +vfd walrcv_check_conninfo_fn walrcv_connect_fn walrcv_create_slot_fn @@ -2913,6 +3222,8 @@ walrcv_startstreaming_fn wchar2mb_with_len_converter wchar_t +when +winsize wint_t xl_brin_createidx xl_brin_desummarize @@ -2994,6 +3305,7 @@ xl_xact_subxacts xl_xact_twophase xl_xact_xinfo +xllist xmlBuffer xmlBufferPtr xmlChar @@ -3016,9 +3328,12 @@ xsltSecurityPrefsPtr xsltStylesheetPtr xsltTransformContextPtr +yy_buffer_state yy_parser yy_size_t yy_state_type +yy_trans_info +yyguts_t yyscan_t yytype_int16 yytype_int8 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
pgsql-hackers by date: