From: Alexey Samsonov Date: Fri, 21 Mar 2014 07:15:47 +0000 (+0000) Subject: Kill deprecated -fbounds-checking flag X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a86ef85c47a0ad9b982ffec1436ac3c93c7c34dd;p=clang Kill deprecated -fbounds-checking flag git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204436 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def index 706c722306..94c4616752 100644 --- a/include/clang/Basic/Sanitizers.def +++ b/include/clang/Basic/Sanitizers.def @@ -103,7 +103,6 @@ SANITIZER_GROUP("integer", Integer, SignedIntegerOverflow | UnsignedIntegerOverflow | Shift | IntegerDivideByZero) -// -fbounds-checking SANITIZER("local-bounds", LocalBounds) SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index b3afd7a0b8..0900649b69 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -391,10 +391,6 @@ def fblocks : Flag<["-"], "fblocks">, Group, Flags<[CC1Option]>, def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group; def fborland_extensions : Flag<["-"], "fborland-extensions">, Group, Flags<[CC1Option]>, HelpText<"Accept non-standard constructs supported by the Borland compiler">; -def fbounds_checking : Flag<["-"], "fbounds-checking">, Group, - HelpText<"Enable run-time bounds checks">; -def fbounds_checking_EQ : Joined<["-"], "fbounds-checking=">, Flags<[CC1Option]>, - Group; def fbuiltin : Flag<["-"], "fbuiltin">, Group; def fcaret_diagnostics : Flag<["-"], "fcaret-diagnostics">, Group; def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group; diff --git a/lib/Driver/SanitizerArgs.cpp b/lib/Driver/SanitizerArgs.cpp index d66f3b4a01..502cec7d3f 100644 --- a/lib/Driver/SanitizerArgs.cpp +++ b/lib/Driver/SanitizerArgs.cpp @@ -279,12 +279,7 @@ bool SanitizerArgs::parse(const Driver &D, const llvm::opt::ArgList &Args, unsigned &Remove, bool DiagnoseErrors) { Add = 0; Remove = 0; - const char *DeprecatedReplacement = 0; - if (A->getOption().matches(options::OPT_fbounds_checking) || - A->getOption().matches(options::OPT_fbounds_checking_EQ)) { - Add = LocalBounds; - DeprecatedReplacement = "-fsanitize=local-bounds"; - } else if (A->getOption().matches(options::OPT_fsanitize_EQ)) { + if (A->getOption().matches(options::OPT_fsanitize_EQ)) { Add = parse(D, A, DiagnoseErrors); } else if (A->getOption().matches(options::OPT_fno_sanitize_EQ)) { Remove = parse(D, A, DiagnoseErrors); @@ -292,11 +287,6 @@ bool SanitizerArgs::parse(const Driver &D, const llvm::opt::ArgList &Args, // Flag is not relevant to sanitizers. return false; } - // If this is a deprecated synonym, produce a warning directing users - // towards the new spelling. - if (DeprecatedReplacement && DiagnoseErrors) - D.Diag(diag::warn_drv_deprecated_arg) - << A->getAsString(Args) << DeprecatedReplacement; return true; } diff --git a/test/Driver/bounds-checking.c b/test/Driver/bounds-checking.c deleted file mode 100644 index fdd20ca374..0000000000 --- a/test/Driver/bounds-checking.c +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2> %t -// RUN: FileCheck -check-prefix=CHECK < %t %s -// CHECK: "-fsanitize=array-bounds,local-bounds" - -// RUN: %clang -fbounds-checking -### -fsyntax-only %s 2> %t -// RUN: FileCheck -check-prefix=CHECK-OLD < %t %s -// CHECK-OLD: "-fsanitize=local-bounds" - -// RUN: %clang -fbounds-checking=3 -### -fsyntax-only %s 2> %t -// RUN: FileCheck -check-prefix=CHECK-OLD2 < %t %s -// CHECK-OLD2: "-fsanitize=local-bounds" diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c index aa9dfa22bb..9c84086f3c 100644 --- a/test/Driver/fsanitize.c +++ b/test/Driver/fsanitize.c @@ -12,6 +12,9 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER // CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift),?){4}"}} +// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS +// CHECK-BOUNDS: "-fsanitize={{((array-bounds|local-bounds),?){2}"}} + // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-sanitize=thread -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED // CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|object-size|array-bounds),?){12}"}} @@ -101,9 +104,6 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 // OK -// RUN: %clang -target x86_64-linux-gnu -fbounds-checking -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEPRECATED -// CHECK-DEPRECATED: argument '-fbounds-checking' is deprecated, use '-fsanitize=local-bounds' instead - // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NO-PIE // CHECK-TSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2" // CHECK-TSAN-NO-PIE: "-pie"