[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-07 Thread Dan Liew via cfe-commits
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

[clang] [Driver][BoundsSafety] Add -fexperimental-bounds-safety flag (PR #70480)

2023-11-08 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fexperimental-bounds-safety flag (PR #70480)

2023-11-08 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-30 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-30 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-31 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-11-02 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-11-03 Thread Dan Liew via cfe-commits
@@ -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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via cfe-commits
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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via 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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via cfe-commits
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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via 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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via 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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via 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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via cfe-commits
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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via 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

[clang] [BoundsSafety] Initial documentation for -fbounds-safety (PR #70749)

2023-11-03 Thread Dan Liew via 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

[clang] 3d612a9 - [NFC] Avoid unnecessary duplication of code generating diagnostic.

2022-04-20 Thread Dan Liew via cfe-commits
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:

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -3424,6 +3447,24 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation * +CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via 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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via 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`` +-- + +``__builtin_verbose_trap`` causes the program to stop its exec

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via cfe-commits
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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-18 Thread Dan Liew via 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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-20 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-20 Thread Dan Liew via cfe-commits
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

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-03-20 Thread Dan Liew via 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

[clang] Unwrap CountAttributed for debug info (PR #86017)

2024-03-20 Thread Dan Liew via cfe-commits
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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-03-20 Thread Dan Liew via 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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -1628,6 +1628,25 @@ llvm::DIType *CGDebugInfo::createFieldType( offsetInBits, flags, debugType, Annotations); } +llvm::DISubprogram * +CGDebugInfo::createInlinedTrapSubprogram(StringRef FuncName, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via 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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation * +CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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,

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation * +CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation * +CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via cfe-commits
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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via cfe-commits
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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via 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, ---

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via cfe-commits
@@ -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`.

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

2023-10-27 Thread Dan Liew via 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, ---

[clang] fdce098 - [Clang][ASan] Teach Clang to not emit ASan module destructors when compiling with `-mkernel` or `-fapple-kext`.

2021-02-25 Thread Dan Liew via cfe-commits
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:

[clang] 5d64dd8 - [Clang][ASan] Introduce `-fsanitize-address-destructor-kind=` driver & frontend option.

2021-02-25 Thread Dan Liew via cfe-commits
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:

[clang] 7b1d2a2 - [NFC] Switch to auto marshalling infrastructure for `-fsanitize-address-destructor-kind=` flag.

2021-02-25 Thread Dan Liew via cfe-commits
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:

[clang] a159f91 - [compiler-rt] Fix stale incremental builds when using `LLVM_BUILD_EXTERNAL_COMPILER_RT=ON`.

2021-03-10 Thread Dan Liew via cfe-commits
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:

[clang] 03512b2 - [NFC][Driver] Add dummy compiler-rt sanitizer dylibs for Darwin.

2019-12-20 Thread Dan Liew via cfe-commits
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:

Re: [PATCH] D12265: [ZORG] Add support for libc++ to SphinxDocBuilder.py

2015-08-22 Thread Dan Liew via cfe-commits
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

Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!

2016-07-18 Thread Dan Liew via cfe-commits
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

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-07-08 Thread Dan Liew via cfe-commits
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

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-07-08 Thread Dan Liew via cfe-commits
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

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-07-08 Thread Dan Liew via 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

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-07-08 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-07-08 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (PR #93231)

2024-07-08 Thread Dan Liew via cfe-commits
@@ -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

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-07-08 Thread Dan Liew via cfe-commits
@@ -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

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-07-08 Thread Dan Liew via cfe-commits
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

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-07-08 Thread Dan Liew via 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

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-07-08 Thread Dan Liew via cfe-commits
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

[clang] [Parser][BoundsSafety] Print attribute as macro if it's system defined (PR #107619)

2024-09-10 Thread Dan Liew via 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

[clang] [Parser][BoundsSafety] Print attribute as macro if it's system defined (PR #107619)

2024-09-10 Thread Dan Liew via cfe-commits
@@ -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

[clang] [Parser][BoundsSafety] Print attribute as macro if it's system defined (PR #107619)

2024-09-10 Thread Dan Liew via cfe-commits
@@ -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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-04 Thread Dan Liew via cfe-commits
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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-04 Thread Dan Liew via 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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-04 Thread Dan Liew via cfe-commits
@@ -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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-04 Thread Dan Liew via cfe-commits
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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-04 Thread Dan Liew via cfe-commits
@@ -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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via 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 danliew-apple wrote: I'm fine with that. You could also do `LLV

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via 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: > "tools" has a pretty specific meaning for LLV

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via cfe-commits
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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via 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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via cfe-commits
@@ -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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via cfe-commits
@@ -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)

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via cfe-commits
@@ -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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via cfe-commits
@@ -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

[clang] [lldb] [llvm] [cmake] Build executables with -no_exported_symbols when building Apple toolchain (PR #87684)

2024-04-05 Thread Dan Liew via cfe-commits
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   2   3   4   >