@@ -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
@@ -0,0 +1,25 @@
+// RUN: not %clang -fbounds-safety-experimental -x c++ %s 2>&1 | FileCheck
-check-prefix ERR %s
+
rapidsna wrote:
@MaskRay Thank you! I removed the blank lines.
https://github.com/llvm/llvm-project/pull/70480
rapidsna wrote:
> The other experimental flags I see start with experimental, this one ends
> with it. Why isn't this called `-fexerimental-bounds-safety`?
@tbaederr Thank you! I just renamed the flag to `-fexperimental-bounds-safety`.
https://github.com/llvm/llvm-project/pull/70480
@@ -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
@@ -0,0 +1,11 @@
+// RUN: %clang -c %s -### 2>&1 | FileCheck -check-prefix T0 %s
rapidsna wrote:
@nickdesaulniers @MaskRay Thank you! I removed the new directory and moved the
tests to conform to the existing layout.
https://github.com/rapidsna updated
https://github.com/llvm/llvm-project/pull/70480
>From 99ec6e055dd32a86bf6d589a6895658dcbe1d7bd Mon Sep 17 00:00:00 2001
From: Yeoul Na
Date: Fri, 27 Oct 2023 08:34:37 -0700
Subject: [PATCH 1/5] [Driver][BoundsSafety] Add -fbounds-safety-experimental
flag
https://github.com/rapidsna 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
https://github.com/rapidsna 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
@@ -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
@@ -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
@@ -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
@@ -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
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
@@ -3618,6 +3618,30 @@ void CompilerInvocationBase::GenerateLangArgs(const
LangOptions ,
GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
}
+static void CheckBoundsSafetyLang(InputKind IK, DiagnosticsEngine ) {
+ // Currently, bounds safety is
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -859,53 +859,60 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E,
unsigned Type,
}
if (IsDynamic) {
-LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
-getLangOpts().getStrictFlexArraysLevel();
-const Expr *Base =
@@ -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
@@ -0,0 +1,25 @@
+// RUN: not %clang -fbounds-safety-experimental -x c++ %s 2>&1 | FileCheck
-check-prefix ERR %s
+
+// RUN: not %clang -fbounds-safety-experimental -x objective-c %s 2>&1 |
FileCheck -check-prefix ERR %s
+
+// RUN: not %clang -fbounds-safety-experimental -x
@@ -0,0 +1,11 @@
+// RUN: %clang -c %s -### 2>&1 | FileCheck -check-prefix T0 %s
rapidsna wrote:
@nickdesaulniers I was hoping that we could keep -fbounds-safety tests under a
separate folder clang/test/BoundsSafety in order to avoid them from getting
mixed up
@@ -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
rapidsna wrote:
> The other experimental flags I see start with experimental, this one ends
> with it. Why isn't this called `-fexerimental-bounds-safety`?
Oh, I can see most of them start with `-fexperimental`, not everything though.
I can fix this. Is there a formal convention?
https://github.com/rapidsna edited
https://github.com/llvm/llvm-project/pull/70606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rapidsna created
https://github.com/llvm/llvm-project/pull/70749
The document is mostly the exact copy of RFC: Enforcing Bounds Safety in C,
except some minor adjustments in the tone to make it more suitable for
documentation:
@@ -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
rapidsna
https://github.com/rapidsna updated
https://github.com/llvm/llvm-project/pull/70480
>From 99ec6e055dd32a86bf6d589a6895658dcbe1d7bd Mon Sep 17 00:00:00 2001
From: Yeoul Na
Date: Fri, 27 Oct 2023 08:34:37 -0700
Subject: [PATCH 1/2] [Driver][BoundsSafety] Add -fbounds-safety-experimental
flag
@@ -0,0 +1,9 @@
+// RUN: %clang -c %s -### 2>&1 | not grep fbounds-safety-experimental
rapidsna wrote:
Done!
https://github.com/llvm/llvm-project/pull/70480
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -3835,6 +3852,12 @@ bool CompilerInvocation::ParseLangArgs(LangOptions
, ArgList ,
Opts.Trigraphs =
Args.hasFlag(OPT_ftrigraphs, OPT_fno_trigraphs, Opts.Trigraphs);
+ Opts.BoundsSafety = Args.hasFlag(OPT_fbounds_safety, OPT_fno_bounds_safety,
@@ -3618,6 +3618,23 @@ void CompilerInvocationBase::GenerateLangArgs(const
LangOptions ,
GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
}
+static bool SupportsBoundsSafety(Language Lang) {
+ // Currently, bounds safety is only supported for
@@ -3618,6 +3618,23 @@ void CompilerInvocationBase::GenerateLangArgs(const
LangOptions ,
GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
}
+static bool SupportsBoundsSafety(Language Lang) {
+ // Currently, bounds safety is only supported for
@@ -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<
rapidsna wrote:
Done!
https://github.com/llvm/llvm-project/pull/70480
@@ -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<
rapidsna wrote:
Done!
https://github.com/llvm/llvm-project/pull/70480
https://github.com/rapidsna updated
https://github.com/llvm/llvm-project/pull/70480
>From 99ec6e055dd32a86bf6d589a6895658dcbe1d7bd Mon Sep 17 00:00:00 2001
From: Yeoul Na
Date: Fri, 27 Oct 2023 08:34:37 -0700
Subject: [PATCH 1/2] [Driver][BoundsSafety] Add -fbounds-safety-experimental
flag
rapidsna wrote:
I'll push BoundsSafety.rst documentation in a separate PR.
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
https://github.com/rapidsna created
https://github.com/llvm/llvm-project/pull/70480
-fbounds-safety-experimental is an experimental flag for -fbounds-safety, which
is a bounds-safety extension for C. -fbounds-safety will require substantial
changes across the Clang codebase. So we introduce
201 - 249 of 249 matches
Mail list logo