[all-commits] [llvm/llvm-project] aee492: Recommit: Compress formatting of array type names ...

David Blaikie via All-commits all-commits at lists.llvm.org
Thu Oct 21 11:35:05 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aee49255074fd4ef38d97e6e70cbfbf2f9fd0fa7
      https://github.com/llvm/llvm-project/commit/aee49255074fd4ef38d97e6e70cbfbf2f9fd0fa7
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2021-10-21 (Thu, 21 Oct 2021)

  Changed paths:
    M clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
    M clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
    M clang-tools-extra/clangd/unittests/HoverTests.cpp
    M clang/bindings/python/tests/cindex/test_type.py
    M clang/lib/AST/TypePrinter.cpp
    M clang/test/ARCMT/cxx-checking.mm
    M clang/test/AST/ast-dump-APValue-arithmetic.cpp
    M clang/test/AST/ast-dump-APValue-array.cpp
    M clang/test/AST/ast-dump-array.cpp
    M clang/test/AST/ast-dump-color.cpp
    M clang/test/AST/ast-dump-expr-json.c
    M clang/test/AST/ast-dump-expr-json.cpp
    M clang/test/AST/ast-dump-expr-json.m
    M clang/test/AST/ast-dump-expr.c
    M clang/test/AST/ast-dump-expr.cpp
    M clang/test/AST/ast-dump-file-line-json.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_9.c
    M clang/test/AST/ast-dump-records-json.cpp
    M clang/test/AST/ast-dump-records.c
    M clang/test/AST/ast-dump-records.cpp
    M clang/test/AST/ast-dump-stmt-json.cpp
    M clang/test/AST/ast-dump-stmt.cpp
    M clang/test/AST/ast-dump-template-decls-json.cpp
    M clang/test/AST/ast-dump-templates.cpp
    M clang/test/AST/ast-dump-types-errors-json.cpp
    M clang/test/AST/atomic-expr.cpp
    M clang/test/AST/float16.cpp
    M clang/test/AST/pr47636.cpp
    M clang/test/AST/sourceranges.cpp
    M clang/test/ASTMerge/var/test.c
    M clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
    M clang/test/Analysis/cfg.cpp
    M clang/test/Analysis/explain-svals.cpp
    M clang/test/Analysis/lifetime-cfg-output.cpp
    M clang/test/Analysis/malloc-sizeof.c
    M clang/test/Analysis/more-dtors-cfg-output.cpp
    M clang/test/Analysis/scopes-cfg-output.cpp
    M clang/test/CXX/basic/basic.types/p10.cpp
    M clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp
    M clang/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp
    M clang/test/CXX/dcl.decl/dcl.decomp/p2.cpp
    M clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp
    M clang/test/CXX/dcl.decl/dcl.meaning/dcl.array/p3.cpp
    M clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p13.cpp
    M clang/test/CXX/drs/dr177x.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.id/mixed-constraints.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.id/p4.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
    M clang/test/CXX/special/class.copy/p23-cxx11.cpp
    M clang/test/CXX/special/class.ctor/p5-0x.cpp
    M clang/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
    M clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
    M clang/test/CXX/temp/temp.constr/temp.constr.constr/non-function-templates.cpp
    M clang/test/CXX/temp/temp.decls/temp.variadic/p2.cpp
    M clang/test/CXX/temp/temp.explicit/p8.cpp
    M clang/test/CXX/temp/temp.param/p10-2a.cpp
    M clang/test/CodeGen/const-init.c
    M clang/test/CodeGen/dump-struct-builtin.c
    M clang/test/Import/array-init-loop-expr/test.cpp
    M clang/test/Index/print-type-size.cpp
    M clang/test/Index/print-type.c
    M clang/test/Index/print-type.cpp
    M clang/test/Layout/aix-Wpacked-expecting-diagnostics.cpp
    M clang/test/Layout/aix-double-struct-member.cpp
    M clang/test/Layout/aix-no-unique-address-with-double.cpp
    M clang/test/Layout/aix-power-alignment-typedef.cpp
    M clang/test/Layout/ms-aligned-array.c
    M clang/test/Layout/ms-x86-basic-layout.cpp
    M clang/test/Layout/ms-x86-empty-layout.c
    M clang/test/Layout/ms-x86-empty-nonvirtual-bases.cpp
    M clang/test/Layout/ms-x86-empty-virtual-base.cpp
    M clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
    M clang/test/Layout/ms-x86-misalignedarray.cpp
    M clang/test/Layout/ms-x86-pack-and-align.cpp
    M clang/test/Layout/no-unique-address.cpp
    M clang/test/Layout/watchos-standard-layout.cpp
    M clang/test/Misc/diag-macro-backtrace2.c
    M clang/test/Misc/integer-literal-printing.cpp
    M clang/test/Modules/cxx-templates.cpp
    M clang/test/Modules/odr_hash.cpp
    M clang/test/OpenMP/distribute_firstprivate_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_shared_messages.cpp
    M clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp
    M clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp
    M clang/test/OpenMP/distribute_simd_reduction_messages.cpp
    M clang/test/OpenMP/parallel_reduction_messages.c
    M clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
    M clang/test/PCH/objc_exprs.m
    M clang/test/Parser/atomic.c
    M clang/test/Sema/array-constraint.c
    M clang/test/Sema/array-init.c
    M clang/test/Sema/assign.c
    M clang/test/Sema/builtin-expect-with-probability-avr.cpp
    M clang/test/Sema/builtin-expect-with-probability.cpp
    M clang/test/Sema/c11-typedef-redef.c
    M clang/test/Sema/compound-literal.c
    M clang/test/Sema/crash-invalid-array.c
    M clang/test/Sema/empty1.c
    M clang/test/Sema/extern-redecl.c
    M clang/test/Sema/generic-selection.c
    M clang/test/Sema/gnu-flags.c
    M clang/test/Sema/incomplete-decl.c
    M clang/test/Sema/matrix-type-builtins.c
    M clang/test/Sema/merge-decls.c
    M clang/test/Sema/nullability.c
    M clang/test/Sema/predef.c
    M clang/test/Sema/typedef-retain.c
    M clang/test/Sema/types.c
    M clang/test/Sema/var-redecl.c
    M clang/test/Sema/vla.cpp
    M clang/test/Sema/warn-sizeof-array-decay.c
    M clang/test/Sema/warn-sizeof-arrayarg.c
    M clang/test/Sema/warn-write-strings.c
    M clang/test/SemaCXX/MicrosoftExtensions.cpp
    M clang/test/SemaCXX/address-space-initialize.cpp
    M clang/test/SemaCXX/alias-template.cpp
    M clang/test/SemaCXX/array-bound-merge.cpp
    M clang/test/SemaCXX/attr-gnu.cpp
    M clang/test/SemaCXX/c99-variable-length-array-cxx11.cpp
    M clang/test/SemaCXX/c99-variable-length-array.cpp
    M clang/test/SemaCXX/compare-cxx2a.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/constant-expression-cxx2a.cpp
    M clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
    M clang/test/SemaCXX/constexpr-string.cpp
    M clang/test/SemaCXX/coroutines.cpp
    M clang/test/SemaCXX/cxx0x-initializer-aggregates.cpp
    M clang/test/SemaCXX/cxx0x-type-convert-construct.cpp
    M clang/test/SemaCXX/cxx1z-decomposition.cpp
    M clang/test/SemaCXX/cxx2a-compat.cpp
    M clang/test/SemaCXX/dcl_init_aggr.cpp
    M clang/test/SemaCXX/decl-init-ref.cpp
    M clang/test/SemaCXX/exceptions.cpp
    M clang/test/SemaCXX/flexible-array-test.cpp
    M clang/test/SemaCXX/for-range-examples.cpp
    M clang/test/SemaCXX/new-delete.cpp
    M clang/test/SemaCXX/no-wchar.cpp
    M clang/test/SemaCXX/nullability.cpp
    M clang/test/SemaCXX/overload-call.cpp
    M clang/test/SemaCXX/overload-member-call.cpp
    M clang/test/SemaCXX/static-assert-cxx17.cpp
    M clang/test/SemaCXX/typedef-redecl.cpp
    M clang/test/SemaCXX/typeid.cpp
    M clang/test/SemaCXX/warn-string-conversion.cpp
    M clang/test/SemaObjC/argument-checking.m
    M clang/test/SemaObjC/flexible-array.m
    M clang/test/SemaObjC/ivar-sem-check-1.m
    M clang/test/SemaObjC/method-bad-param.m
    M clang/test/SemaObjC/nullability.m
    M clang/test/SemaObjC/rdr-6211479-array-property.m
    M clang/test/SemaObjC/warn-write-strings.m
    M clang/test/SemaObjCXX/message.mm
    M clang/test/SemaOpenCL/half.cl
    M clang/test/SemaOpenCL/invalid-kernel-parameters.cl
    M clang/test/SemaOpenCL/predefined-expr.cl
    M clang/test/SemaOpenCLCXX/address-space-deduction.clcpp
    M clang/test/SemaTemplate/deduction-guide.cpp
    M clang/test/SemaTemplate/instantiate-init.cpp
    M clang/test/SemaTemplate/instantiate-local-class.cpp
    M clang/test/SemaTemplate/instantiate-static-var.cpp
    M clang/test/SemaTemplate/pack-deduction.cpp
    M clang/test/SemaTemplate/temp_arg_nontype.cpp
    M clang/unittests/AST/ASTImporterTest.cpp
    M clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
    M clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
    M compiler-rt/test/ubsan/TestCases/Misc/bounds.cpp
    M libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
    M libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
    M libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.runtime.fail.cpp
    M lldb/source/Commands/CommandObjectType.cpp
    M lldb/source/DataFormatters/FormatManager.cpp
    M lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
    M lldb/test/API/functionalities/data-formatter/typedef_array/main.cpp
    M lldb/test/API/lang/c/array_types/TestArrayTypes.py
    M lldb/test/API/lang/c/vla/TestVLA.py
    M lldb/test/API/lang/cpp/bitfields/TestCppBitfields.py
    M lldb/test/API/lang/cpp/char1632_t/TestChar1632T.py
    M lldb/test/API/lang/cpp/char8_t/TestCxxChar8_t.py
    M lldb/test/API/lang/cpp/class_static/TestStaticVariables.py
    M lldb/test/API/lang/cpp/non-type-template-param/TestCppNonTypeTemplateParam.py
    M lldb/test/API/tools/lldb-vscode/variables/TestVSCode_variables.py
    M lldb/test/Shell/SymbolFile/DWARF/x86/DW_AT_const_value.s
    M lldb/test/Shell/SymbolFile/DWARF/x86/array-sizes.s
    M lldb/test/Shell/SymbolFile/NativePDB/global-classes.cpp

  Log Message:
  -----------
  Recommit: Compress formatting of array type names (int [4] -> int[4])

Based on post-commit review discussion on
2bd84938470bf2e337801faafb8a67710f46429d with Richard Smith.

Other uses of forcing HasEmptyPlaceHolder to false seem OK to me -
they're all around pointer/reference types where the pointer/reference
token will appear at the rightmost side of the left side of the type
name, so they make nested types (eg: the "int" in "int *") behave as
though there is a non-empty placeholder (because the "*" is essentially
the placeholder as far as the "int" is concerned).

This was originally committed in 277623f4d5a672d707390e2c3eaf30a9eb4b075c

Reverted in f9ad1d1c775a8e264bebc15d75e0c6e5c20eefc7 due to breakages
outside of clang - lldb seems to have some strange/strong dependence on
"char [N]" versus "char[N]" when printing strings (not due to that name
appearing in DWARF, but probably due to using clang to stringify type
names) that'll need to be addressed, plus a few other odds and ends in
other subprojects (clang-tools-extra, compiler-rt, etc).




More information about the All-commits mailing list