SuccessChanges

Summary

  1. Fix strict aliasing warning in msan.cpp (details)
  2. Improve SmallPtrSetImpl::count implementation (details)
  3. [ASTMatchers] Force c++ unittests to specify correct language standard (details)
  4. [DebugInfo][CallSites] Remove decl subprograms from 'retainedTypes:' (details)
  5. AArch64: materialize large stack offset into xzr correctly. (details)
  6. [llvm-readobj] - Improve error reporting for hash tables. (details)
  7. [StructurizeCFG] Fix region nodes ordering (details)
  8. [llvm-readelf] - Add explicit braces. NFC. (details)
  9. [llvm-readelf] - Add explicit braces again. NFC. (details)
  10. [DebugInfo] Separate fields with commas in headers of .debug_pub* tables (1/3). (details)
  11. [DebugInfo] Separate fields with commas in headers of compile units (2/3). (details)
  12. [DebugInfo] Separate fields with commas in headers of type units (3/3). (details)
  13. MIPatternMatch.h - remove unused APFloat/APInt includes. NFC. (details)
  14. ARMFrameLowering.h - remove unnecessary includes. NFC. (details)
  15. [llvm-dwarfdump][test] Use verbose output to check expected opcodes (details)
  16. [utils] change default nameless value to "TMP" (details)
  17. [lldb][NFC] Make ClangExpressionSourceCode's wrapping logic more consistent (details)
  18. [DebugInfo] Add use of truncating data extractor to debug line parsing (details)
  19. Revert "[lldb] Pass -fPIC flag even when DYLIB_ONLY is set" (details)
Commit af38074874c605f9e598ae3f7e5d4befa3fe92bb by sguelton
Fix strict aliasing warning in msan.cpp

Use internal_memcpy instead.

Differential Revision: https://reviews.llvm.org/D80732
The file was modifiedcompiler-rt/lib/msan/msan.cpp
Commit 11efb0837c897c709ae162eb5ebabb460fc537ff by sguelton
Improve SmallPtrSetImpl::count implementation

Relying on the find method implies a roundtrip to the iterator world, which is
not costless because iterator creation involves a few check to ensure the
iterator is in a valid position (through the SmallPtrSetIteratorImpl::AdvanceIfNotValid
method). It turns out that the result of SmallPtrSetImpl::find_imp is either
valid or the EndPointer, so there's no need to go through that abstraction,
and the compiler cannot guess it.

Differential Revision: https://reviews.llvm.org/D80708
The file was modifiedllvm/include/llvm/ADT/SmallPtrSet.h
Commit b6d23f2efc64c226d30094bcc4258e0b63029da8 by n.james93
[ASTMatchers] Force c++ unittests to specify correct language standard

Force the unittests on c++ code for matchers to specify the correct standard.

Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D80884
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersTest.h
Commit 40a3fcb05c83c41862038277aa667c956e7cac82 by djordje.todorovic
[DebugInfo][CallSites] Remove decl subprograms from 'retainedTypes:'

After the D70350, the retainedTypes: isn't being used for the purpose
of call site debug info for extern calls, so it is safe to delete it
from IR representation.
We are also adding a test to ensure the subprogram isn't stored within
the retainedTypes: from corresponding DICompileUnit.

Differential Revision: https://reviews.llvm.org/D80369
The file was modifiedclang/test/Modules/ModuleDebugInfo.cpp
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
The file was modifiedclang/test/CodeGen/debug-info-extern-call.c
The file was modifiedclang/test/Modules/ModuleDebugInfo.m
The file was modifiedclang/test/Modules/DebugInfoTransitiveImport.m
Commit dace8224f38a31636a02fe9c2af742222831f70c by Tim Northover
AArch64: materialize large stack offset into xzr correctly.

When a stack offset was too big to materialize in a single instruction, we were
trying to do it in stages:

    adds xD, sp, #imm
    adds xD, xD, #imm

Unfortunately, if xD is xzr then the second instruction doesn't exist and
wouldn't do what was needed if it did. Instead we can use a temporary register
for all but the last addition.
The file was modifiedllvm/lib/Target/AArch64/AArch64InstrInfo.cpp
The file was addedllvm/test/CodeGen/AArch64/large-stack-cmp.ll
Commit e75efcc3c1af068a145ea83deb0435b195a44162 by grimar
[llvm-readobj] - Improve error reporting for hash tables.

This improves the next points for broken hash tables:

1) Use reportUniqueWarning to prevent duplication when
   --hash-table and --elf-hash-histogram are used together.

2) Dump nbuckets and nchain fields. It is often possible
   to dump them even when the table itself goes past the EOF etc.

Differential revision: https://reviews.llvm.org/D80373
The file was modifiedllvm/test/tools/llvm-readobj/ELF/hash-table.test
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit 85c308804966e52a14bc98874a6cc6e42cbb1d40 by ehudkatz
[StructurizeCFG] Fix region nodes ordering

This is a reimplementation of the `orderNodes` function, as the old
implementation didn't take into account all cases.
The new implementation uses SCCs instead of Loops to take account of
irreducible loops.

Fix PR41509

Differential Revision: https://reviews.llvm.org/D79037
The file was addedllvm/test/Transforms/StructurizeCFG/interleaved-loop-order.ll
The file was addedllvm/test/Transforms/StructurizeCFG/nested-loop-subregion.ll
The file was modifiedllvm/lib/Transforms/Scalar/StructurizeCFG.cpp
Commit feee98645dde4be31a70cc6660d2fc4d4b9d32d8 by grimar
[llvm-readelf] - Add explicit braces. NFC.

Should fix the BB (http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/3907/steps/build%20stage%201/logs/stdio):

llvm-readobj/ELFDumper.cpp:4708:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
    else
    ^
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit b21f32fcecd012fa2c2f8c61d7259079a7f1865e by grimar
[llvm-readelf] - Add explicit braces again. NFC.

Partially reverts feee98645dde4be31a70cc6660d2fc4d4b9d32d8.

Add explicit braces to a different place to fix
"error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]"
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit 937403d68430cb59ff7ccba7b2a13b3a815c12fa by ikudrin
[DebugInfo] Separate fields with commas in headers of .debug_pub* tables (1/3).

For most tables, we already use commas in headers. This set of patches
unifies dumping the remaining ones.

Differential Revision: https://reviews.llvm.org/D80806
The file was modifiedllvm/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
The file was modifiedllvm/test/DebugInfo/X86/gnu-public-names-tu.ll
The file was modifiedllvm/test/tools/dsymutil/X86/basic-linking-x86.test
The file was modifiedllvm/test/DebugInfo/X86/gnu-public-names.ll
The file was modifiedllvm/test/tools/dsymutil/X86/basic-lto-linking-x86.test
The file was modifiedllvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll
The file was modifiedllvm/test/DebugInfo/dwarfdump-pubnames.test
The file was modifiedllvm/test/tools/dsymutil/ARM/obfuscated.test
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugPubTable.cpp
Commit 2a7af304823d4bb60efbbfea97d35030f0732748 by ikudrin
[DebugInfo] Separate fields with commas in headers of compile units (2/3).

For most tables, we already use commas in headers. This set of patches
unifies dumping the remaining ones.

Differential Revision: https://reviews.llvm.org/D80806
The file was modifiedllvm/test/MC/WebAssembly/dwarfdump.ll
The file was modifiedllvm/test/DebugInfo/Generic/version.ll
The file was modifiedllvm/test/tools/dsymutil/X86/generate-empty-CU.test
The file was modifiedllvm/test/tools/llvm-dwp/X86/dwos_list_from_exec_simple.test
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
The file was modifiedllvm/test/tools/llvm-dwp/X86/merge.test
The file was modifiedllvm/test/tools/llvm-dwp/X86/info-v5.s
The file was modifiedllvm/test/tools/dsymutil/X86/empty-CU.test
The file was modifiedllvm/test/CodeGen/X86/dwarf-headers.ll
The file was modifiedllvm/test/DebugInfo/X86/dwarfdump-header.s
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/lookup.s
The file was modifiedllvm/test/DebugInfo/X86/dwarfdump-header-64.s
The file was modifiedllvm/test/DebugInfo/dwarfdump-zlib.test
The file was modifiedllvm/test/tools/llvm-dwp/X86/simple.test
Commit cbec419b3ebba3fe5551540cfd3e484dfa253a3a by ikudrin
[DebugInfo] Separate fields with commas in headers of type units (3/3).

For most tables, we already use commas in headers. This set of patches
unifies dumping the remaining ones.

Differential Revision: https://reviews.llvm.org/D80806
The file was modifiedllvm/test/DebugInfo/typeunit-header.test
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
The file was modifiedllvm/test/tools/llvm-dwp/X86/simple.test
The file was modifiedllvm/test/DebugInfo/X86/dwarfdump-header.s
The file was modifiedllvm/test/CodeGen/X86/dwarf-headers.ll
The file was modifiedllvm/test/CodeGen/X86/dwarf-split-line-1.ll
The file was modifiedllvm/test/DebugInfo/dwarfdump-type-units.test
The file was modifiedllvm/test/tools/llvm-dwp/X86/type_dedup.test
Commit de82114db86bb1bd89f3596409dc8f30fa316ce5 by llvm-dev
MIPatternMatch.h - remove unused APFloat/APInt includes. NFC.
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
Commit 014648e8f27b2f57940844f0170d15b42a497d33 by llvm-dev
ARMFrameLowering.h - remove unnecessary includes. NFC.

They are implicitly included in TargetFrameLowering.h and only ever used in TargetFrameLowering override methods.
The file was modifiedllvm/lib/Target/ARM/ARMFrameLowering.h
Commit 7bcde99f7779a71a389e559b7ff2ff6ec43ae004 by james.henderson
[llvm-dwarfdump][test] Use verbose output to check expected opcodes

The debug_line_invalid.test test case was previously using the
interpreted line table dumping to identify which opcodes have been
parsed. This change moves to looking for the expected opcodes
explicitly. This is probably a little clearer and also allows for
testing some cases that wouldn't be easily identifiable from the
interpreted table.

Reviewed by: MaskRay

Differential Revision: https://reviews.llvm.org/D80795
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
Commit e5b8772756737e41cb1e8ee1a5a33cb3d8a25be6 by spatel
[utils] change default nameless value to "TMP"

This is effectively reverting rGbfdc2552664d to avoid test churn
while we figure out a better way forward.

We at least salvage the warning on name conflict from that patch
though.

If we change the default string again, we may want to mass update
tests at the same time. Alternatively, we could live with the poor
naming if we change -instnamer.

This also adds a test to LLVM as suggested in the post-commit
review. There's a clang test that is also affected. That seems
like a layering violation, but I have not looked at fixing that yet.

Differential Revision: https://reviews.llvm.org/D80584
The file was modifiedclang/test/utils/update_cc_test_checks/Inputs/mangled_names.c.expected
The file was modifiedclang/test/utils/update_cc_test_checks/Inputs/mangled_names.c.funcsig.expected
The file was modifiedllvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic.ll.funcsig.expected
The file was modifiedllvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic.ll
The file was modifiedllvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic.ll.expected
The file was modifiedllvm/utils/UpdateTestChecks/common.py
Commit 2b37c5b560584f05edf5d375d4ca86fe9c5b0173 by Raphael Isemann
[lldb][NFC] Make ClangExpressionSourceCode's wrapping logic more consistent

Summary:
ClangExpressionSourceCode has different ways to wrap the user expression based on
which context the expression is executed in. For example, if we're in a C++ member
function we put the expression inside a fake member function of a fake class to make the
evaluation possible. Similar things are done for Objective-C instance/static methods.
There is also a default wrapping where we put the expression in a normal function
just to make it possible to execute it.

The way we currently define which kind of wrapping the expression needs is based on
the `wrapping_language` we keep passing to the ClangExpressionSourceCode
instance. We repurposed the language type enum for that variable to distinguish the
cases above with the following mapping:
* language = C_plus_plus -> member function wrapping
* language = ObjC -> instance/static method wrapping (`is_static` distinguished between those two).
* language = C -> normal function wrapping
* all other cases like C_plus_plus11, Haskell etc. make our class a no-op that does mostly nothing.

That mapping is currently not documented and just confusing as the `language`
is unrelated to the expression language (and in the ClangUserExpression we even pretend
that it *is* the actual language, but luckily never used it for anything). Some of the code
in ClangExpressionSourceCode is also obviously thinking that this is the actual language of
the expression as it checks for non-existent cases such as `ObjC_plus_plus` which is
not part of the mapping.

This patch makes a new enum to describe the four cases above (with instance/static Objective-C
methods now being their own case). It also make that enum just a member of
ClangExpressionSourceCode instead of having to pass the same value to the class repeatedly.
This gets also rid of all the switch-case-checks for 'unknown' language such as C_plus_plus11 as this
is no longer necessary.

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: abidh

Differential Revision: https://reviews.llvm.org/D80793
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
Commit e8bcf4ef07ccba4a707b197f1bdee05a19936c47 by james.henderson
[DebugInfo] Add use of truncating data extractor to debug line parsing

This will ensure that nothing can ever start parsing data from a future
sequence and part-read data will be returned as 0 instead.

Reviewed by: aprantl, labath

Differential Revision: https://reviews.llvm.org/D80796
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/Inputs/debug_line_malformed.s
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
Commit 54422d21700cfb532c80b22662f7b79d741b21ba by Raphael Isemann
Revert "[lldb] Pass -fPIC flag even when DYLIB_ONLY is set"

This reverts commit fd0ab3b3eb88de3fe4792c34b50084595e22d68d.

The fix here is incorrect and the actual fault was an incorrect test Makefile.

To give some more background:

The original test for D80798 compiled three source files into either one
executable or one executable + 2 shared libraries, each being one different
test setup. If both the monolithic executable and the shared libraries
where compiled in the same directory, then Make would overwrite the .o files
of one test setup with the other. This caused that while -fPIC was passed
correctly to the test setup with the shared libraries, the compiler invocations
for the monolithic executable would later overwrite these object files (and
as only the test setup with the shared library used -fPIC, it appeared as if
the shared library object files didn't receive the -fPIC flag).

Thanks to Pavel for figuring this out.
The file was modifiedlldb/packages/Python/lldbsuite/test/make/Makefile.rules