[all-commits] [llvm/llvm-project] 69c8c9: [Sema] Use underlying type of scoped enum for -Wfo...

Arvind Mukund via All-commits all-commits at lists.llvm.org
Mon Oct 9 23:46:54 PDT 2023


  Branch: refs/heads/release/17.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 69c8c96691c76d43b6a05ea5ec2feaa11bbba58c
      https://github.com/llvm/llvm-project/commit/69c8c96691c76d43b6a05ea5ec2feaa11bbba58c
  Author: Shoaib Meenai <smeenai at fb.com>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaChecking.cpp
    A clang/test/FixIt/format-darwin-enum-class.cpp
    M clang/test/FixIt/format.cpp

  Log Message:
  -----------
  [Sema] Use underlying type of scoped enum for -Wformat diagnostics (#67378)

Right now, `-Wformat` for a scoped enum will suggest a cast based on the
format specifier being used. This can lead to incorrect results, e.g.
attempting to format a scoped enum with `%s` would suggest casting to
`char *` instead of fixing the specifier. Change the logic to treat the
scoped enum's underlying type as the intended type to be printed, and
suggest format specifier changes and casts based on that.

(cherry picked from commit 0b07b06effe5fdf779b75bb5ac6cf15e477cb0be)


  Commit: 1090b91a28401b82f7553076c75fe035f1c759a0
      https://github.com/llvm/llvm-project/commit/1090b91a28401b82f7553076c75fe035f1c759a0
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M llvm/lib/MC/MCWin64EH.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    A llvm/test/CodeGen/AArch64/sched-loop-align.ll

  Log Message:
  -----------
  [AArch64] Disable loop alignment for Windows targets (#67894)

This should fix #66912. When emitting SEH unwind info, we need to be
able to calculate the exact length of functions before alignments are
fixed. Until that limitation is overcome, just disable all loop
alignment on Windows targets.

(cherry picked from commit 6ae36c012728a274a78a771e4506681732f85a6d)


  Commit: 8a8ade49ff49c5e06bced50f52be5d2e1eef5748
      https://github.com/llvm/llvm-project/commit/8a8ade49ff49c5e06bced50f52be5d2e1eef5748
  Author: Tom Stellard <tstellar at redhat.com>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M .github/workflows/release-binaries.yml

  Log Message:
  -----------
  workflows/release-binaries: Use more cores to avoid the 6 hour timeout (#67874)

(cherry picked from commit 95b2c6b3d6dc5f8b6ee5eb4f8dbc96dea0f50cac)


  Commit: f0a687d821c151b23013da75296be369a4c420d3
      https://github.com/llvm/llvm-project/commit/f0a687d821c151b23013da75296be369a4c420d3
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M lld/COFF/InputFiles.cpp
    A lld/test/COFF/comdat-drectve.s

  Log Message:
  -----------
  [LLD] [COFF] Fix handling of comdat .drectve sections (#68116)

This can happen when manually emitting strings into .drectve sections
with `__attribute__((section(".drectve")))`, which is a way to emulate
`#pragma comment(linker, "...")` for mingw compilers, without requiring
building with -fms-extensions.

Normally, this doesn't generate any comdat, but if compiled with
-fsanitize=address, this section does get turned into a comdat section.

This fixes #67261. This issue can be seen as a regression; a change in
the "lli" tool in 17.x triggers this case, if compiled with ASAN
enabled, triggering this unsupported corner case in LLD. With this
change, LLD can handle it.

(cherry picked from commit 503bc5f66111f7e4fc79972bb9bfec8bb5606bab)


  Commit: e7b3b94cf500c5c4dc1bed6dd47e031d73678c86
      https://github.com/llvm/llvm-project/commit/e7b3b94cf500c5c4dc1bed6dd47e031d73678c86
  Author: Arvind Mukund <MasterAwesome at users.noreply.github.com>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/utils/TableGen/ClangAttrEmitter.cpp

  Log Message:
  -----------
  [clang] Correct behavior of `LLVM_UNREACHABLE_OPTIMIZE=OFF` for `Release` builds (#68284)

```c++
AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) {
  AttributeCommonInfo I(Range, NoSemaHandlerAttribute, (
    S == GNU_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} :
    S == CXX11_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} :
    S == C23_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} :
    (llvm_unreachable("Unknown attribute spelling!"),  AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/})));
  return CreateImplicit(Ctx, I);
}
```

```c++
AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) {
  AttributeCommonInfo I(Range, NoSemaHandlerAttribute, [&]() {
    switch (S) {
    case GNU_aarch64_sve_pcs:
      return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
    case CXX11_clang_aarch64_sve_pcs:
      return AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
    case C23_clang_aarch64_sve_pcs:
      return AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
    default:
      llvm_unreachable("Unknown attribute spelling!");
      return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
    }
  }());
  return CreateImplicit(Ctx, I);
}
```

Fixes https://github.com/llvm/llvm-project/issues/68237
Conflicts:
	clang/docs/ReleaseNotes.rst


Compare: https://github.com/llvm/llvm-project/compare/b2417f51dbbd...e7b3b94cf500


More information about the All-commits mailing list