[clang] [Clang] Fix a regression introduced by #161163. (PR #162612)
cor3ntin wrote:
> hasNonTrivialDefaultConstructor
you can have
```cpp
template
class C {
C();
C() requires true;
};
```
But in the case of __builtin_is_implicit_lifetime we probably want to allow
that, actually...
https://github.com/llvm/llvm-project/pull/162612
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Add __builtin_bswapg (PR #162433)
@@ -755,6 +755,12 @@ def BSwap : Builtin, Template<["unsigned short",
"uint32_t", "uint64_t"],
let Prototype = "T(T)";
}
+def BSwapg : Builtin {
+ let Spellings = ["__builtin_bswapg"];
+ let Attributes = [NoThrow, Const, Constexpr, CustomTypeChecking];
+ let Prototype = "int(...)";
clingfei wrote:
No, this will cause a build error:
llvm-project/clang/include/clang/Basic/Builtins.td:761:7: error: Not a template
let Prototype = "T(T)";
^
https://github.com/llvm/llvm-project/pull/162433
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [NFC][SpecialCaseList] Split Matcher into RegexMatcher and GlobMatcher (PR #162303)
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/162303 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Sema] Keep attribute lists in the order the attributes were parsed (PR #162714)
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot12` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/18431 Here is the relevant piece of the build log for the reference ``` Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure) ... -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success -- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG -- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success -- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG -- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success -- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG -- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success -- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG -- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success -- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG -- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG - Success -- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG -- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG - Success -- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS -- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Success -- Looking for os_signpost_interval_begin -- Looking for os_signpost_interval_begin - not found -- Looking for flock -- Looking for flock - found -- Found Python3: /usr/bin/python3 (found version "3.13.3") found components: Interpreter -- LLVM host triple: aarch64-unknown-linux-gnu -- LLVM default target triple: aarch64-unknown-linux-gnu -- Using libc++abi testing configuration: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in -- Looking for fopen in c -- Looking for fopen in c - found -- Looking for __gcc_personality_v0 in gcc_s -- Looking for __gcc_personality_v0 in gcc_s - found -- Looking for __aeabi_uldivmod in gcc -- Looking for __aeabi_uldivmod in gcc - not found -- Performing Test C_SUPPORTS_COMMENT_LIB_PRAGMA -- Performing Test C_SUPPORTS_COMMENT_LIB_PRAGMA - Success -- Looking for dladdr in dl -- Looking for dladdr in dl - found -- Looking for pthread_once in pthread -- Looking for pthread_once in pthread - found -- Looking for __cxa_thread_atexit_impl in c -- Looking for __cxa_thread_atexit_impl in c - found -- Performing Test CXX_SUPPORTS_FNO_OMIT_FRAME_POINTER_FLAG -- Performing Test CXX_SUPPORTS_FNO_OMIT_FRAME_POINTER_FLAG - Success -- Performing Test CXX_SUPPORTS_GLINE_TABLES_ONLY_FLAG -- Performing Test CXX_SUPPORTS_GLINE_TABLES_ONLY_FLAG - Success -- Performing Test CXX_SUPPORTS_FSTRICT_ALIASING_FLAG -- Performing Test CXX_SUPPORTS_FSTRICT_ALIASING_FLAG - Success -- Performing Test CXX_SUPPORTS_EHSC_FLAG -- Performing Test CXX_SUPPORTS_EHSC_FLAG - Failed -- Performing Test C_SUPPORTS_FUNWIND_TABLES_FLAG -- Performing Test C_SUPPORTS_FUNWIND_TABLES_FLAG - Success -- Performing Test CXX_SUPPORTS_WALL_FLAG Step 11 (stage2/hwasan check) failure: stage2/hwasan check (failure) ... llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/lld-link llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld64.lld llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/wasm-ld llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld.lld llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/lld-link llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/ld64.lld llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/bin/wasm-ld llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual tes
[clang] [CIR] Add inline function attributes (PR #162866)
https://github.com/andykaylor commented: It's great to see function attribute support get started! This looks good overall. https://github.com/llvm/llvm-project/pull/162866 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [LifetimeSafety] Reorganize code into modular components (PR #162474)
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/162474 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [CIR] Add inline function attributes (PR #162866)
@@ -1801,6 +1817,16 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
p << ")";
}
+ if (auto inlineKind = getInlineKind()) {
+if (*inlineKind == cir::InlineKind::NoInline) {
+ p << " inline_never";
+} else if (*inlineKind == cir::InlineKind::AlwaysInline) {
+ p << " inline_always";
+} else if (*inlineKind == cir::InlineKind::InlineHint) {
+ p << " inline_hint";
+}
xlauko wrote:
I believe this should use stringify method from the generate `CIR_InlineAttr`
instead of manual listing.
The attribute needs to be fixed though to specify expected stringified names.
https://github.com/llvm/llvm-project/pull/162866
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Remove support for really old Ubuntu releases (PR #162778)
llvmbot wrote:
@llvm/pr-subscribers-clang-driver
Author: Brad Smith (brad0)
Changes
After 07ca4db1e1f53876b14e5773e8b9d77c20774fca remove support
for really old and older Ubunutu releases.
---
Full diff: https://github.com/llvm/llvm-project/pull/162778.diff
2 Files Affected:
- (modified) clang/include/clang/Driver/Distro.h (+1-6)
- (modified) clang/lib/Driver/Distro.cpp (-5)
``diff
diff --git a/clang/include/clang/Driver/Distro.h
b/clang/include/clang/Driver/Distro.h
index 5c25592e68ade..008de0dc94b03 100644
--- a/clang/include/clang/Driver/Distro.h
+++ b/clang/include/clang/Driver/Distro.h
@@ -48,11 +48,6 @@ class Distro {
Fedora,
Gentoo,
OpenSUSE,
-UbuntuHardy,
-UbuntuIntrepid,
-UbuntuJaunty,
-UbuntuKarmic,
-UbuntuLucid,
UbuntuMaverick,
UbuntuNatty,
UbuntuOneiric,
@@ -135,7 +130,7 @@ class Distro {
}
bool IsUbuntu() const {
-return DistroVal >= UbuntuHardy && DistroVal <= UbuntuQuesting;
+return DistroVal >= UbuntuMaverick && DistroVal <= UbuntuQuesting;
}
bool IsAlpineLinux() const { return DistroVal == AlpineLinux; }
diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
index 90e5a390be7eb..8a5a9fc3026a3 100644
--- a/clang/lib/Driver/Distro.cpp
+++ b/clang/lib/Driver/Distro.cpp
@@ -61,11 +61,6 @@ static Distro::DistroType
DetectLsbRelease(llvm::vfs::FileSystem &VFS) {
if (Version == Distro::UnknownDistro &&
Line.starts_with("DISTRIB_CODENAME="))
Version = llvm::StringSwitch(Line.substr(17))
-.Case("hardy", Distro::UbuntuHardy)
-.Case("intrepid", Distro::UbuntuIntrepid)
-.Case("jaunty", Distro::UbuntuJaunty)
-.Case("karmic", Distro::UbuntuKarmic)
-.Case("lucid", Distro::UbuntuLucid)
.Case("maverick", Distro::UbuntuMaverick)
.Case("natty", Distro::UbuntuNatty)
.Case("oneiric", Distro::UbuntuOneiric)
``
https://github.com/llvm/llvm-project/pull/162778
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Fix inconsistencies with the device_kernel attr on different targets (PR #161905)
sarnex wrote: Will do. https://github.com/llvm/llvm-project/pull/161905 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [HIP][SPIRV] Enable the SPIRV backend instead of the translator through an experimental flag. (PR #162282)
https://github.com/mgcarrasco edited https://github.com/llvm/llvm-project/pull/162282 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [HIP][SPIRV] Enable the SPIRV backend instead of the translator through an experimental flag. (PR #162282)
@@ -1421,6 +1421,18 @@ def fhip_emit_relocatable : Flag<["-"], "fhip-emit-relocatable">, HelpText<"Compile HIP source to relocatable">; def fno_hip_emit_relocatable : Flag<["-"], "fno-hip-emit-relocatable">, HelpText<"Do not override toolchain to compile HIP source to relocatable">; +def hip_use_experimental_spirv_backend shiltian wrote: Maybe just `use-experimental-spirv-backend` and it can also be used by other targets. https://github.com/llvm/llvm-project/pull/162282 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [CIR] Upstream CIR Dialect TryOp with Catch Attrs (PR #162897)
@@ -0,0 +1,84 @@
+// RUN: cir-opt %s --verify-roundtrip | FileCheck %s
+
+!u8i = !cir.int
+
+module {
+
+cir.global "private" constant external @_ZTIi : !cir.ptr
+cir.global "private" constant external @_ZTIPKc : !cir.ptr
+
+cir.func dso_local @empty_try_block_with_catch_all() {
+ cir.scope {
+cir.try {
+ cir.yield
+} catch [type #cir.all {
+ cir.yield
+}]
+ }
+ cir.return
+}
+
+// CHECK: cir.func dso_local @empty_try_block_with_catch_all() {
+// CHECK:cir.scope {
+// CHECK: cir.try {
+// CHECK:cir.yield
+// CHECK: } catch [type #cir.all {
+// CHECK:cir.yield
+// CHECK: }]
+// CHECK:}
+// CHECK:cir.return
+// CHECK: }
+
+cir.func dso_local @empty_try_block_with_catch_unwind() {
+ cir.scope {
+cir.try {
+ cir.yield
+} catch [#cir.unwind {
+ cir.yield
+}]
+ }
+ cir.return
+}
+
+// CHECK: cir.func dso_local @empty_try_block_with_catch_unwind() {
+// CHECK: cir.scope {
+// CHECK:cir.try {
+// CHECK: cir.yield
+// CHECK:} catch [#cir.unwind {
+// CHECK: cir.yield
+// CHECK:}]
+// CHECK: }
+// CHECK: cir.return
+// CHECK: }
+
+cir.func dso_local @empty_try_block_with_catch_ist() {
+ cir.scope {
+cir.try {
+ cir.yield
+} catch [type #cir.global_view<@_ZTIi> : !cir.ptr {
+ cir.yield
+}, type #cir.global_view<@_ZTIPKc> : !cir.ptr {
+ cir.yield
+}, #cir.unwind {
+ cir.yield
+}]
+ }
+ cir.return
+}
+
+// CHECK: cir.func dso_local @empty_try_block_with_catch_ist() {
+// CHECK: cir.scope {
+// CHECK: cir.try {
+// CHECK: cir.yield
+// CHECK: } catch [type #cir.global_view<@_ZTIi> : !cir.ptr {
+// CHECK: cir.yield
+// CHECK: }, type #cir.global_view<@_ZTIPKc> : !cir.ptr {
+// CHECK: cir.yield
+// CHECK: }, #cir.unwind {
andykaylor wrote:
Nevermind. I see that this is an artifact of the square bracket placement.
https://github.com/llvm/llvm-project/pull/162897
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][Sema] Split SYCLKernel back into its own attribute (PR #162868)
@@ -1599,8 +1599,15 @@ def CUDAShared : InheritableAttr {
}
def : MutualExclusions<[CUDAConstant, CUDAShared, HIPManaged]>;
+def SYCLKernel : InheritableAttr {
+ let Spellings = [Clang<"sycl_kernel">];
+ let Subjects = SubjectList<[FunctionTmpl]>;
+ let LangOpts = [SYCLDevice];
jhuber6 wrote:
You should just require `SYCL` and probably ignore it on the CPU, I think
that's how CUDA's `__global__` works.
https://github.com/llvm/llvm-project/pull/162868
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Support header shadowing diagnostics in Clang header search (PR #162491)
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff origin/main HEAD --extensions c,cpp,h --
clang/test/Preprocessor/header-shadowing.c
clang/include/clang/Lex/DirectoryLookup.h
clang/include/clang/Lex/HeaderSearch.h clang/lib/Lex/HeaderSearch.cpp
``
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
View the diff from clang-format here.
``diff
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index fe11be555..47cf79a29 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -481,8 +481,8 @@ OptionalFileEntryRef DirectoryLookup::LookupFile(
SmallVectorImpl *SearchPath, SmallVectorImpl *RelativePath,
Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule,
bool &InUserSpecifiedSystemFramework, bool &IsFrameworkFound,
-bool &IsInHeaderMap, SmallVectorImpl &MappedName,
-bool NeedSuggest, bool OpenFile) const {
+bool &IsInHeaderMap, SmallVectorImpl &MappedName, bool NeedSuggest,
+bool OpenFile) const {
InUserSpecifiedSystemFramework = false;
IsInHeaderMap = false;
MappedName.clear();
@@ -884,15 +884,13 @@ diagnoseFrameworkInclude(DiagnosticsEngine &Diags,
SourceLocation IncludeLoc,
<< IncludeFilename;
}
-
/// Return true if a shadow has been detected and the caller should
/// stop and return the first-found file and module, false otherwise.
static bool checkAndStoreCandidate(
-ModuleMap::KnownHeader *SuggestedModule,
-OptionalFileEntryRef CandidateFile, StringRef CandidateDir,
-DiagnosticsEngine &Diags, StringRef Filename, SourceLocation IncludeLoc,
-ModuleMap::KnownHeader &FirstModule, OptionalFileEntryRef &FirstHeader,
-SmallString<1024> &FirstDir) {
+ModuleMap::KnownHeader *SuggestedModule, OptionalFileEntryRef
CandidateFile,
+StringRef CandidateDir, DiagnosticsEngine &Diags, StringRef Filename,
+SourceLocation IncludeLoc, ModuleMap::KnownHeader &FirstModule,
+OptionalFileEntryRef &FirstHeader, SmallString<1024> &FirstDir) {
if (!FirstHeader) {
// Found the first candidate
FirstHeader = CandidateFile;
@@ -1003,10 +1001,9 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
RequestingModule, SuggestedModule, NeedSuggest)) {
if (!Includer) {
assert(First && "only first includer can have no file");
- checkAndStoreCandidate(SuggestedModule, FE,
- IncluderAndDir.second.getName(), Diags,
- Filename, IncludeLoc, FirstModule,
- FirstHeader, FirstDir);
+ checkAndStoreCandidate(
+ SuggestedModule, FE, IncluderAndDir.second.getName(), Diags,
+ Filename, IncludeLoc, FirstModule, FirstHeader, FirstDir);
NeedSuggest = false;
break;
}
@@ -1037,9 +1034,9 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
diagnoseFrameworkInclude(Diags, IncludeLoc,
IncluderAndDir.second.getName(), Filename,
*FE);
- checkAndStoreCandidate(SuggestedModule, FE,
- IncluderAndDir.second.getName(), Diags, Filename, IncludeLoc,
- FirstModule, FirstHeader, FirstDir);
+ checkAndStoreCandidate(
+ SuggestedModule, FE, IncluderAndDir.second.getName(), Diags,
+ Filename, IncludeLoc, FirstModule, FirstHeader, FirstDir);
NeedSuggest = false;
break;
}
@@ -1047,15 +1044,15 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
// Otherwise, we found the path via MSVC header search rules. If
// -Wmsvc-include is enabled, we have to keep searching to see if we
// would've found this header in -I or -isystem directories.
-if (checkAndStoreCandidate(SuggestedModule, FE,
-IncluderAndDir.second.getName(), Diags, Filename, IncludeLoc,
-FirstModule, FirstHeader, FirstDir)) {
+if (checkAndStoreCandidate(
+SuggestedModule, FE, IncluderAndDir.second.getName(), Diags,
+Filename, IncludeLoc, FirstModule, FirstHeader, FirstDir)) {
// Found mutiple candidates via MSVC rules
if (Diags.isIgnored(diag::ext_pp_include_search_ms, IncludeLoc))
return FirstHeader;
else
NeedSuggest = false;
-break;
+ break;
}
MSFE = FE;
if (SuggestedModule) {
@@ -1171,27 +1168,29 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
for (unsigned j = SystemHeaderP
[clang-tools-extra] [clang-tidy][NFC] Migrate tests away from `--match-partial-fixes` (PR #162851)
@@ -151,7 +151,6 @@ void g() {
for (int i = 0; i < 10; ++i) {
a[i] = i;
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not use array subscript
when the index is not an integer constant expression
-// CHECK-FIXES: gsl::at(a, i) = i;
gsl::at(a, i) = i; // OK, gsl::at() instead of []
localspook wrote:
This `// CHECK-FIXES` shouldn't be here;
`cppcoreguidelines-pro-bounds-constant-array-index` only offers fixes when the
`GslHeader` option is specified, and that's tested in a different file. The
only reason this worked is that it matches the following line.
https://github.com/llvm/llvm-project/pull/162851
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
