delcypher wrote:
@rapidsna The CI is complaining about trailing whitespace
https://buildkite.com/llvm-project/clang-ci/builds/5817#018b830d-fb91-40df-8956-9e4dd325d27f
https://github.com/llvm/llvm-project/pull/70749
___
cfe-commits mailing list
cfe-co
@@ -3618,6 +3618,27 @@ void CompilerInvocationBase::GenerateLangArgs(const
LangOptions &Opts,
GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
}
+static void CheckBoundsSafetyLang(InputKind IK, DiagnosticsEngine &Diags) {
delcyph
@@ -3618,6 +3618,27 @@ void CompilerInvocationBase::GenerateLangArgs(const
LangOptions &Opts,
GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
}
+static void CheckBoundsSafetyLang(InputKind IK, DiagnosticsEngine &Diags) {
delcyph
@@ -0,0 +1,5 @@
+
+// RUN: %clang -fbounds-safety-experimental -fsyntax-only %s 2>&1 | FileCheck
%s
+// RUN: %clang_cc1 -fbounds-safety-experimental -fsyntax-only %s 2>&1 |
FileCheck %s
+
+// CHECK: warning: '-fbounds-safety' is ignored for assembly
delcypher wr
@@ -0,0 +1,5 @@
+; RUN: %clang -fbounds-safety-experimental -x ir -S %s -o /dev/null 2>&1 |
FileCheck %s
+; RUN: %clang_cc1 -fbounds-safety-experimental -x ir -S %s -o /dev/null 2>&1 |
FileCheck %s
+
delcypher wrote:
It might be worth having a small comment her
@@ -0,0 +1,11 @@
+// RUN: %clang -c %s -### 2>&1 | FileCheck -check-prefix T0 %s
delcypher wrote:
@nickdesaulniers As @rapidsna said there are multiple reasons:
1. Provides a very convenient way to run **only `-fbounds-safety` tests**.
2. More likely to avoid me
@@ -330,6 +330,14 @@ def warn_alias_with_section : Warning<
"as the %select{aliasee|resolver}2">,
InGroup;
+let CategoryName = "Bounds Safety Issue" in {
+def err_bounds_safety_lang_not_supported : Error<
+ "bounds safety is only supported for C">;
+def warn_bounds_safety
@@ -0,0 +1,12 @@
+// This reports a warning to follow the default behavior of ClangAs.
+// RUN: %clang -fexperimental-bounds-safety -x assembler -c %s -o /dev/null
2>&1 | FileCheck -check-prefix WARN %s
delcypher wrote:
@rapidsna Maybe there should be a version
@@ -0,0 +1,12 @@
+// This reports a warning to follow the default behavior of ClangAs.
+// RUN: %clang -fexperimental-bounds-safety -x assembler -c %s -o /dev/null
2>&1 | FileCheck -check-prefix WARN %s
+
+
+// WARN: warning: argument unused during compilation:
'-fexperimental-b
https://github.com/delcypher approved this pull request.
I have a few minor nits but other than that LGTM.
Please make sure this builds without errors/warnings.
I think you can configure CMake with `-DLLVM_BUILD_DOCS=ON -D
LLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERROR=ON` to enable building
@@ -0,0 +1,480 @@
+==
+-fbounds-safety: Enforcing bounds safety for C
+==
+
+.. contents::
+ :local:
+
+Overview
+
+
+-fbounds-safety is a C extension to enforce bounds safety to prev
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/70749
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,480 @@
+==
+-fbounds-safety: Enforcing bounds safety for C
+==
+
+.. contents::
+ :local:
+
+Overview
+
+
+-fbounds-safety is a C extension to enforce bounds safety to prev
@@ -0,0 +1,480 @@
+==
+-fbounds-safety: Enforcing bounds safety for C
+==
+
+.. contents::
+ :local:
+
+Overview
+
+
+-fbounds-safety is a C extension to enforce bounds safety to prev
@@ -0,0 +1,480 @@
+==
+-fbounds-safety: Enforcing bounds safety for C
+==
+
+.. contents::
+ :local:
+
+Overview
+
+
+-fbounds-safety is a C extension to enforce bounds safety to prev
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/70749
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,480 @@
+==
+-fbounds-safety: Enforcing bounds safety for C
+==
+
+.. contents::
+ :local:
+
+Overview
+
+
+-fbounds-safety is a C extension to enforce bounds safety to prev
@@ -0,0 +1,480 @@
+==
+-fbounds-safety: Enforcing bounds safety for C
+==
+
+.. contents::
+ :local:
+
+Overview
+
+
+-fbounds-safety is a C extension to enforce bounds safety to prev
Author: Dan Liew
Date: 2022-04-20T10:50:21-07:00
New Revision: 3d612a930dce229c887cd9a731084df419f43791
URL:
https://github.com/llvm/llvm-project/commit/3d612a930dce229c887cd9a731084df419f43791
DIFF:
https://github.com/llvm/llvm-project/commit/3d612a930dce229c887cd9a731084df419f43791.diff
LOG:
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
delcypher wrote:
Really? We don't test the generated IR in an optimized build? That seems like a
bad idea given that code built fo
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
delcypher wrote:
Really? We don't test the generated IR in an optimized build? That seems like a
bad idea given that code built fo
@@ -3452,6 +3452,18 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl
GD, unsigned BuiltinID,
case Builtin::BI__builtin_trap:
EmitTrapCall(Intrinsic::trap);
return RValue::get(nullptr);
+ case Builtin::BI__builtin_verbose_trap: {
+llvm::DILocation *Tra
@@ -3424,6 +3447,24 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *
+CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation,
+
https://github.com/delcypher requested changes to this pull request.
It looks like there are still some unresolved discussions in this PR.
https://github.com/llvm/llvm-project/pull/79230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://l
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/79230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s
+
+#if !__has_builtin(__builtin_verbose_trap)
+#error
+#endif
+
+constexpr char const* constMsg1 = "hello";
+char const* const constMsg2 = "hello";
+char const constMsg3[] = "hello";
+
+templ
@@ -3379,6 +3379,57 @@ Query for this feature with
``__has_builtin(__builtin_debugtrap)``.
Query for this feature with ``__has_builtin(__builtin_trap)``.
+``__builtin_verbose_trap``
+--
+
+``__builtin_verbose_trap`` causes the program to stop its exec
@@ -3379,6 +3379,60 @@ Query for this feature with
``__has_builtin(__builtin_debugtrap)``.
Query for this feature with ``__has_builtin(__builtin_trap)``.
+``__builtin_verbose_trap``
+--
+
+``__builtin_verbose_trap`` causes the program to stop its exec
@@ -3379,6 +3379,54 @@ Query for this feature with
``__has_builtin(__builtin_debugtrap)``.
Query for this feature with ``__has_builtin(__builtin_trap)``.
+``__builtin_verbose_trap``
+--
+
+``__builtin_verbose_trap`` causes the program to stop its exec
@@ -346,6 +348,15 @@ class CGDebugInfo {
const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI,
llvm::ArrayRef PreviousFieldsDI, const RecordDecl *RD);
+ // A cache that maps artificial inlined function names used for
+ // __builtin_verbose_trap to
@@ -346,6 +348,15 @@ class CGDebugInfo {
const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI,
llvm::ArrayRef PreviousFieldsDI, const RecordDecl *RD);
+ // A cache that maps artificial inlined function names used for
+ // __builtin_verbose_trap to
@@ -602,6 +613,19 @@ class CGDebugInfo {
return CoroutineParameterMappings;
}
+ // Create a debug location from `TrapLocation` that adds an artificial inline
+ // frame where the frame name is
+ //
+ // * `: ` if `` is not empty.
+ // * `` if `` is empty. Note `` mu
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
delcypher wrote:
@ahatanak Any follow up?
https://github.com/llvm/llvm-project/pull/79230
https://github.com/delcypher deleted
https://github.com/llvm/llvm-project/pull/79230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3424,6 +3445,26 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor(
delcypher wrote:
@dwblaikie We cu
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
delcypher wrote:
@pogo59 @ahatanak Thanks for the explanation.
A slight issue with that is some cases Clang will generate differen
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/79230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
delcypher wrote:
@nathanchance Thanks for reporting this. I'm going to have a quick go at
reproducing this to see if fixing this is straight forward. If it is not I will
revert this PR and then we can re-land this change with the problem you
reported fixed.
https://github.com/llvm/llvm-projec
https://github.com/delcypher approved this pull request.
LGTM. Thanks for the quick fix.
https://github.com/llvm/llvm-project/pull/86017
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3379,6 +3379,60 @@ Query for this feature with
``__has_builtin(__builtin_debugtrap)``.
Query for this feature with ``__has_builtin(__builtin_trap)``.
+``__builtin_verbose_trap``
delcypher wrote:
@ahatanak Is this in the wrong place in the document? `__b
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/79230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1628,6 +1628,25 @@ llvm::DIType *CGDebugInfo::createFieldType(
offsetInBits, flags, debugType,
Annotations);
}
+llvm::DISubprogram *
+CGDebugInfo::createInlinedTrapSubprogram(StringRef FuncName,
+
@@ -775,6 +775,11 @@ class Expr : public ValueStmt {
const Expr *PtrExpression, ASTContext &Ctx,
EvalResult &Status) const;
+ /// If the current Expr can be evaluated to a pointer to a null-terminated
+ /// co
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
+
+// CHECK-LABEL: define void @_Z2f0v()
+// CHECK: call void @llvm.trap(), !dbg ![[LOC17:.*]]
+
+// CHECK-LABEL: define void @_Z2f1v()
+// CHECK: ca
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
+
+// CHECK-LABEL: define void @_Z2f0v()
+// CHECK: call void @llvm.trap(), !dbg ![[LOC17:.*]]
+
+// CHECK-LABEL: define void @_Z2f1v()
+// CHECK: ca
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
delcypher wrote:
Could we add a separate test that tests the trap merging behavior in optimized
code?
https://github.com/llvm/llv
@@ -3452,6 +3452,18 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl
GD, unsigned BuiltinID,
case Builtin::BI__builtin_trap:
EmitTrapCall(Intrinsic::trap);
return RValue::get(nullptr);
+ case Builtin::BI__builtin_verbose_trap: {
+llvm::DILocation *Tra
@@ -3379,6 +3379,57 @@ Query for this feature with
``__has_builtin(__builtin_debugtrap)``.
Query for this feature with ``__has_builtin(__builtin_trap)``.
+``__builtin_verbose_trap``
+--
+
+``__builtin_verbose_trap`` causes the program to stop its exec
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -fcxx-exceptions -verify %s
+
+#if !__has_builtin(__builtin_verbose_trap)
+#error
+#endif
+
+constexpr char const* constMsg1 = "hello";
+char cons
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s
+
+#if !__has_builtin(__builtin_verbose_trap)
+#error
+#endif
+
+constexpr char const* constMsg1 = "hello";
+char const* const constMsg2 = "hello";
+char const constMsg3[] = "hello";
+
+templ
https://github.com/delcypher requested changes to this pull request.
Looks pretty good. I have a few minor comments. Some things I suggest we may
want to do in a follow up patch.
https://github.com/llvm/llvm-project/pull/79230
___
cfe-commits mailing
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *
+CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation,
+
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm
-debug-info-kind=limited %s -o - | FileCheck %s
+
+// CHECK-LABEL: define void @_Z2f0v()
+// CHECK: call void @llvm.trap(), !dbg ![[LOC17:.*]]
+
+// CHECK-LABEL: define void @_Z2f1v()
+// CHECK: ca
@@ -3416,6 +3437,27 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor(
+llvm::DebugLoc TrapLocation, StringRef Prefix,
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *
+CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation,
+
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile
*CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent,
return DBuilder.createTempMacroFile(Parent, Line, FName);
}
+llvm::DILocation *
+CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation,
+
@@ -346,6 +348,15 @@ class CGDebugInfo {
const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI,
llvm::ArrayRef PreviousFieldsDI, const RecordDecl *RD);
+ // A cache that maps artificial inlined function names used for
+ // __builtin_verbose_trap to
https://github.com/delcypher requested changes to this pull request.
In general looks good but there are some minor changes I'd like made.
https://github.com/llvm/llvm-project/pull/70480
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://l
@@ -3618,6 +3618,23 @@ void CompilerInvocationBase::GenerateLangArgs(const
LangOptions &Opts,
GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
}
+static bool SupportsBoundsSafety(Language Lang) {
+ // Currently, bounds safety is only supported f
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/70480
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3835,6 +3852,12 @@ bool CompilerInvocation::ParseLangArgs(LangOptions
&Opts, ArgList &Args,
Opts.Trigraphs =
Args.hasFlag(OPT_ftrigraphs, OPT_fno_trigraphs, Opts.Trigraphs);
+ Opts.BoundsSafety = Args.hasFlag(OPT_fbounds_safety, OPT_fno_bounds_safety,
---
@@ -330,6 +330,9 @@ def warn_alias_with_section : Warning<
"as the %select{aliasee|resolver}2">,
InGroup;
+def error_bounds_safety_lang_not_supported : Error<
delcypher wrote:
Nit: A lot of the error diagnostics use `err` as a preifx rather than `error`.
@@ -0,0 +1,9 @@
+// RUN: %clang -c %s -### 2>&1 | not grep fbounds-safety-experimental
delcypher wrote:
Could we use `FileCheck` here instead of `grep`?
https://github.com/llvm/llvm-project/pull/70480
___
cfe-commits m
@@ -330,6 +330,9 @@ def warn_alias_with_section : Warning<
"as the %select{aliasee|resolver}2">,
InGroup;
+def error_bounds_safety_lang_not_supported : Error<
delcypher wrote:
Should we introduce a "bounds safety" category and have the diagnostics fall
u
@@ -3618,6 +3618,23 @@ void CompilerInvocationBase::GenerateLangArgs(const
LangOptions &Opts,
GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
}
+static bool SupportsBoundsSafety(Language Lang) {
+ // Currently, bounds safety is only supported f
@@ -3835,6 +3852,12 @@ bool CompilerInvocation::ParseLangArgs(LangOptions
&Opts, ArgList &Args,
Opts.Trigraphs =
Args.hasFlag(OPT_ftrigraphs, OPT_fno_trigraphs, Opts.Trigraphs);
+ Opts.BoundsSafety = Args.hasFlag(OPT_fbounds_safety, OPT_fno_bounds_safety,
---
Author: Dan Liew
Date: 2021-02-25T12:02:21-08:00
New Revision: fdce098b49cb038996441741a7b2ab3652502aec
URL:
https://github.com/llvm/llvm-project/commit/fdce098b49cb038996441741a7b2ab3652502aec
DIFF:
https://github.com/llvm/llvm-project/commit/fdce098b49cb038996441741a7b2ab3652502aec.diff
LOG:
Author: Dan Liew
Date: 2021-02-25T12:02:21-08:00
New Revision: 5d64dd8e3c22e12e4f7b3d08ffe88fc41e727117
URL:
https://github.com/llvm/llvm-project/commit/5d64dd8e3c22e12e4f7b3d08ffe88fc41e727117
DIFF:
https://github.com/llvm/llvm-project/commit/5d64dd8e3c22e12e4f7b3d08ffe88fc41e727117.diff
LOG:
Author: Dan Liew
Date: 2021-02-25T13:24:50-08:00
New Revision: 7b1d2a2891d812ffc1bb08712143c79e457acbd4
URL:
https://github.com/llvm/llvm-project/commit/7b1d2a2891d812ffc1bb08712143c79e457acbd4
DIFF:
https://github.com/llvm/llvm-project/commit/7b1d2a2891d812ffc1bb08712143c79e457acbd4.diff
LOG:
Author: Dan Liew
Date: 2021-03-10T09:42:24-08:00
New Revision: a159f91c8d068cae660a200868b7fc28fcbcd3ff
URL:
https://github.com/llvm/llvm-project/commit/a159f91c8d068cae660a200868b7fc28fcbcd3ff
DIFF:
https://github.com/llvm/llvm-project/commit/a159f91c8d068cae660a200868b7fc28fcbcd3ff.diff
LOG:
Author: Dan Liew
Date: 2019-12-20T11:32:21-08:00
New Revision: 03512b267d9abd054d56c6d5fa118e78184cf015
URL:
https://github.com/llvm/llvm-project/commit/03512b267d9abd054d56c6d5fa118e78184cf015
DIFF:
https://github.com/llvm/llvm-project/commit/03512b267d9abd054d56c6d5fa118e78184cf015.diff
LOG:
delcypher added a comment.
The rest LGTM
Comment at: buildbot/osuosl/master/config/builders.py:1166
@@ +1165,3 @@
+ 'name':"libcxx-sphinx-docs",
+ 'slavenames':["ericwf-buildslave2],
+ 'builddir':"libcxx-sphinx-docs",
Is
delcypher added a subscriber: delcypher.
Comment at: docs/Proposals/GitHub.rst:102
@@ +101,3 @@
+
+How will the new workflow look like
+===
s/How will/What will/
Comment at: docs/Proposals/GitHub.rst:136
@@ +135,3
https://github.com/delcypher approved this pull request.
Thanks for addressing my comment. I have some nits but I'll leave it to your
discretion whether or not you fix them.
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8320,6 +8320,15 @@ static const RecordDecl
*GetEnclosingNamedOrTopAnonRecord(const FieldDecl *FD) {
return RD;
}
+static CountAttributedType::DynamicCountPointerKind
+getCountAttrKind(bool CountInBytes, bool OrNull) {
delcypher wrote:
Nit. Should this
@@ -425,6 +425,12 @@ Attribute Changes in Clang
size_t count;
};
+- The attributes ``sized_by``, ``counted_by_or_null`` and ``sized_by_or_null```
+ have been added as variants on ``counted_by``, each with slightly different
semantics.
+ ``sized_by`` takes a byte
@@ -0,0 +1,141 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))
+
+// This has been adapted from clang/test/Sema/attr-counted-by-vla.c, but with
VLAs replaced with pointers
+
+struct bar;
+
+struct not_foun
@@ -0,0 +1,141 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))
+
+// This has been adapted from clang/test/Sema/attr-counted-by-vla.c, but with
VLAs replaced with pointers
+
+struct bar;
+
+struct not_foun
@@ -29,6 +30,22 @@ struct LOCKABLE Mutex {};
struct Foo {
struct Mutex *mu_;
+ int a_value GUARDED_BY(mu_);
+
+ struct Bar {
+struct Mutex *other_mu ACQUIRED_AFTER(mu_);
delcypher wrote:
@pdherbemont Did you add the comment? I can't find it in the di
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/95455
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/delcypher approved this pull request.
@pdherbemont Thanks for working on this LGTM. Please confirm that the comments
that @aaronpuchert have been added because I couldn't see them.
Once you've done that we can get this merged :)
https://github.com/llvm/llvm-project/pull/954
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/95455
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs -Wthread-safety %s 2>&1 |
FileCheck %s
+// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs -Wthread-safety -std=c++98 %s
2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs -Wthread-safety -std=c++11 %s -D
C
@@ -5080,6 +5083,17 @@ void Parser::ParseLexedCAttribute(LateParsedAttribute
&LA, bool EnterScope,
ParseGNUAttributeArgs(&LA.AttrName, LA.AttrNameLoc, Attrs, nullptr, nullptr,
SourceLocation(), ParsedAttr::Form::GNU(), nullptr);
+ const auto &SM = P
@@ -5080,6 +5083,17 @@ void Parser::ParseLexedCAttribute(LateParsedAttribute
&LA, bool EnterScope,
ParseGNUAttributeArgs(&LA.AttrName, LA.AttrNameLoc, Attrs, nullptr, nullptr,
SourceLocation(), ParsedAttr::Form::GNU(), nullptr);
+ const auto &SM = P
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/87684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -673,6 +673,9 @@ option(LLVM_USE_OPROFILE
option(LLVM_EXTERNALIZE_DEBUGINFO
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
+option(LLVM_ENABLE_EXPORTED_SYMBOLS
delcypher wrote:
We may want to rename this. The name hints that
@@ -654,6 +654,11 @@ enabled sub-projects. Nearly all of these variable names
begin with
Generate dSYM files and strip executables and libraries (Darwin Only).
Defaults to OFF.
+**LLVM_ENABLE_EXPORTED_SYMBOLS**:BOOL
+ When building executables, preserve symbol exports. D
https://github.com/delcypher requested changes to this pull request.
Generally looks good. I have some minor nits. I'd like to see
`LLVM_ENABLE_EXPORTED_SYMBOLS` renamed to avoid ambiguity.
https://github.com/llvm/llvm-project/pull/87684
___
cfe-commi
@@ -654,6 +654,11 @@ enabled sub-projects. Nearly all of these variable names
begin with
Generate dSYM files and strip executables and libraries (Darwin Only).
Defaults to OFF.
+**LLVM_ENABLE_EXPORTED_SYMBOLS**:BOOL
+ When building executables, preserve symbol exports. D
@@ -673,6 +673,9 @@ option(LLVM_USE_OPROFILE
option(LLVM_EXTERNALIZE_DEBUGINFO
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
+option(LLVM_ENABLE_EXPORTED_SYMBOLS
danliew-apple wrote:
I'm fine with that. You could also do
`LLV
@@ -673,6 +673,9 @@ option(LLVM_USE_OPROFILE
option(LLVM_EXTERNALIZE_DEBUGINFO
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
+option(LLVM_ENABLE_EXPORTED_SYMBOLS
delcypher wrote:
> "tools" has a pretty specific meaning for LLV
https://github.com/delcypher deleted
https://github.com/llvm/llvm-project/pull/87684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -673,6 +673,9 @@ option(LLVM_USE_OPROFILE
option(LLVM_EXTERNALIZE_DEBUGINFO
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
+option(LLVM_ENABLE_EXPORTED_SYMBOLS
delcypher wrote:
@JDevlieghere
> "tools" has a pretty specific
@@ -654,6 +654,11 @@ enabled sub-projects. Nearly all of these variable names
begin with
Generate dSYM files and strip executables and libraries (Darwin Only).
Defaults to OFF.
+**LLVM_ENABLE_EXPORTED_SYMBOLS**:BOOL
+ When building executables, preserve symbol exports. D
@@ -1029,6 +1038,11 @@ macro(add_llvm_executable name)
add_llvm_symbol_exports( ${name} ${LLVM_EXPORTED_SYMBOL_FILE} )
endif(LLVM_EXPORTED_SYMBOL_FILE)
+ if (NOT LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES AND
LLVM_LINKER_SUPPORTS_NO_EXPORTED_SYMBOLS)
@@ -258,15 +258,24 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
endif()
endif()
- # Apple's linker complains about duplicate libraries, which CMake likes to do
- # to support ELF platforms. To silence that warning, we can use
- # -no_warn_duplicate_libraries
@@ -258,15 +258,24 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
endif()
endif()
- # Apple's linker complains about duplicate libraries, which CMake likes to do
- # to support ELF platforms. To silence that warning, we can use
- # -no_warn_duplicate_libraries
https://github.com/delcypher approved this pull request.
LGTM. Other than the nit about not using `FORCE` to set the CMake cache
variable.
https://github.com/llvm/llvm-project/pull/87684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://
1 - 100 of 398 matches
Mail list logo