SuccessChanges

Summary

  1. [LLD] Set alignment as part of Characteristics in TLS table. (details)
  2. Fix style warnings. (details)
  3. Update tests. (details)
  4. Mask out existing alignment bits. (details)
  5. Nit: Use early return to reduce indentation. (details)
  6. [LLD] Set alignment as part of Characteristics in TLS table. (details)
  7. clang/Basic: Stop using SourceManager::getBuffer, NFC (details)
  8. [dsymutil] Fix handling of aliases to private external symbols (details)
  9. clang/Frontend: Mostly stop using SourceManager::getBuffer, NFC (details)
  10. clang/CodeGen: Stop using SourceManager::getBuffer, NFC (details)
  11. [AArch64] Combine UADDVs to generate vector add (details)
  12. clang/StaticAnalyzer: Stop using SourceManager::getBuffer (details)
  13. clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC (details)
Commit 8b70d527d7ec1c8b9e921177119a0d906ffad4f0 by me
[LLD] Set alignment as part of Characteristics in TLS table.

Differential Revision: https://reviews.llvm.org/D88637
The file was modifiedlld/COFF/Writer.cpp
The file was modifiedllvm/include/llvm/Object/COFF.h
Commit 0778cad9f325df4d7b32b22f3dba201a16a0b8fe by me
Fix style warnings.
The file was modifiedllvm/include/llvm/Object/COFF.h
Commit f80950a8bb985c082b26534b0e157447bf803935 by me
Update tests.
The file was modifiedlld/test/COFF/tls-alignment-32.ll
The file was modifiedlld/test/COFF/tls-alignment-64.ll
Commit 51fbc1bef657bb0f5808986555ec3517a84768c4 by me
Mask out existing alignment bits.
The file was modifiedllvm/include/llvm/Object/COFF.h
Commit 7fe13af676678815989a6d0ece684687953245e7 by me
Nit: Use early return to reduce indentation.
The file was modifiedlld/COFF/Writer.cpp
Commit 32a4ad3b6ce6028a371b028cf06fa5feff9534bf by me
[LLD] Set alignment as part of Characteristics in TLS table.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46473

LLD wasn't previously specifying any specific alignment in the TLS table's Characteristics field so the loader would just assume the default value (16 bytes). This works most of the time except if you have thread locals that want specific higher alignments (e.g. 32 as in the bug) *even* if they specify an alignment on the thread local. This change updates LLD to take the max alignment from tls section.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D88637
The file was modifiedlld/COFF/Writer.cpp
Commit 54c1bcab90102481fe43b73f8547d47446ba2163 by Duncan P. N. Exon Smith
clang/Basic: Stop using SourceManager::getBuffer, NFC

Update clang/lib/Basic to stop relying on a `MemoryBuffer*`, using the
`MemoryBufferRef` from `getBufferOrNone` or `getBufferOrFake` instead of
`getBuffer`.

Differential Revision: https://reviews.llvm.org/D89394
The file was modifiedclang/lib/Basic/SourceManager.cpp
The file was modifiedclang/include/clang/Basic/SourceManager.h
The file was modifiedclang/lib/Basic/Diagnostic.cpp
The file was modifiedclang/lib/Basic/SourceLocation.cpp
Commit f9fb9da36c34d2745b74dc30e6c26f7d3f48466c by Jonas Devlieghere
[dsymutil] Fix handling of aliases to private external symbols

dsymutil was incorrectly ignoring aliases to private extern symbols in
the MachODebugMapParser. This resulted in spurious warnings about not
being able to find symbols.

rdar://49652389

Differential revision: https://reviews.llvm.org/D89444
The file was modifiedllvm/tools/dsymutil/MachODebugMapParser.cpp
The file was addedllvm/test/tools/dsymutil/Inputs/private/tmp/private_extern/private_extern.o
The file was addedllvm/test/tools/dsymutil/Inputs/private/tmp/private_extern/main.o
The file was addedllvm/test/tools/dsymutil/ARM/private-extern-alias.test
The file was addedllvm/test/tools/dsymutil/Inputs/private/tmp/private_extern/private_extern.out
Commit 63af2422798188d70a411f76b0f06ab63a783a0d by Duncan P. N. Exon Smith
clang/Frontend: Mostly stop using SourceManager::getBuffer, NFC

Update clang/lib/Frontend to use a `MemoryBufferRef` from
`getBufferOrFake` instead of `MemoryBuffer*` from `getBuffer`, with the
exception of `FrontendInputFile`, which I'm leaving for later.

Differential Revision: https://reviews.llvm.org/D89409
The file was modifiedclang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
The file was modifiedclang/lib/Frontend/FrontendAction.cpp
The file was modifiedclang/lib/Frontend/Rewrite/HTMLPrint.cpp
The file was modifiedclang/lib/Frontend/Rewrite/RewriteObjC.cpp
The file was modifiedclang/lib/Frontend/FrontendActions.cpp
Commit dde4e0318c4cd2054ed241bf248fdddb8d1973e3 by Duncan P. N. Exon Smith
clang/CodeGen: Stop using SourceManager::getBuffer, NFC

Update `clang/lib/CodeGen` to use a `MemoryBufferRef` from
`getBufferOrNone` instead of `MemoryBuffer*` from `getBuffer`. No
functionality change here.

Differential Revision: https://reviews.llvm.org/D89411
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
The file was modifiedclang/lib/CodeGen/CodeGenAction.cpp
Commit 159b2d8e62b833c472be13f15d19e54cc9c69e70 by vinay
[AArch64] Combine UADDVs to generate vector add

ADD(UADDV a, UADDV b) --> UADDV(ADD a, b)

This partially solves the bug: https://bugs.llvm.org/show_bug.cgi?id=46888
Meta ticket: https://bugs.llvm.org/show_bug.cgi?id=46929

Differential Revision: https://reviews.llvm.org/D88731
The file was modifiedllvm/test/CodeGen/AArch64/aarch64-addv.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Commit af4fb416bd355960ce93f271a0591f24f58d25ec by Duncan P. N. Exon Smith
clang/StaticAnalyzer: Stop using SourceManager::getBuffer

Update clang/lib/StaticAnalyzer to stop relying on a `MemoryBuffer*`,
using the `MemoryBufferRef` from `getBufferOrNone` or the
`Optional<MemoryBufferRef>` from `getBufferOrFake`, depending on whether
there's logic for checking validity of the buffer. The change to
clang/lib/StaticAnalyzer/Core/IssueHash.cpp is potentially a
functionality change, since the logic was wrong (it checked for
`nullptr`, which was never returned by the old API), but if that was
reachable the new behaviour should be better.

Differential Revision: https://reviews.llvm.org/D89414
The file was modifiedclang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporter.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/IssueHash.cpp
Commit 006519816689acef5fd971955e21b7ab17ae65d9 by Duncan P. N. Exon Smith
clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC

Update clang-tools-extra, clang/tools, clang/unittests to migrate from
`SourceManager::getBuffer`, which returns an always dereferenceable
`MemoryBuffer*`, to `getBufferOrNone` or `getBufferOrFake`, both of
which return a `MemoryBufferRef`, depending on whether the call site was
checking for validity of the buffer. No functionality change intended.

Differential Revision: https://reviews.llvm.org/D89416
The file was modifiedclang-tools-extra/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp
The file was modifiedclang-tools-extra/modularize/PreprocessorTracker.cpp
The file was modifiedclang/tools/clang-import-test/clang-import-test.cpp
The file was modifiedclang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp
The file was modifiedclang-tools-extra/clangd/SemanticHighlighting.cpp
The file was modifiedclang-tools-extra/clangd/SourceCode.cpp
The file was modifiedclang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
The file was modifiedclang/tools/libclang/CIndex.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp
The file was modifiedclang/unittests/AST/ASTImporterTest.cpp
The file was modifiedclang-tools-extra/clangd/ParsedAST.cpp
The file was modifiedclang/tools/clang-diff/ClangDiff.cpp