]> granicus.if.org Git - clang/commitdiff
Kill deprecated -fbounds-checking flag
authorAlexey Samsonov <samsonov@google.com>
Fri, 21 Mar 2014 07:15:47 +0000 (07:15 +0000)
committerAlexey Samsonov <samsonov@google.com>
Fri, 21 Mar 2014 07:15:47 +0000 (07:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204436 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Sanitizers.def
include/clang/Driver/Options.td
lib/Driver/SanitizerArgs.cpp
test/Driver/bounds-checking.c [deleted file]
test/Driver/fsanitize.c

index 706c7223061303e486e748ec883f1c4468a8d531..94c461675274f011af701fca930f42980a87d898 100644 (file)
@@ -103,7 +103,6 @@ SANITIZER_GROUP("integer", Integer,
                 SignedIntegerOverflow | UnsignedIntegerOverflow | Shift |
                 IntegerDivideByZero)
 
-// -fbounds-checking
 SANITIZER("local-bounds", LocalBounds)
 SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds)
 
index b3afd7a0b8eb49c776704653a16b44219944cc44..0900649b690cec1eadaa86b45a1cffb209b19800 100644 (file)
@@ -391,10 +391,6 @@ def fblocks : Flag<["-"], "fblocks">, Group<f_Group>, Flags<[CC1Option]>,
 def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group<f_Group>;
 def fborland_extensions : Flag<["-"], "fborland-extensions">, Group<f_Group>, Flags<[CC1Option]>,
   HelpText<"Accept non-standard constructs supported by the Borland compiler">;
-def fbounds_checking : Flag<["-"], "fbounds-checking">, Group<f_Group>,
-  HelpText<"Enable run-time bounds checks">;
-def fbounds_checking_EQ : Joined<["-"], "fbounds-checking=">, Flags<[CC1Option]>,
-  Group<f_Group>;
 def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>;
 def fcaret_diagnostics : Flag<["-"], "fcaret-diagnostics">, Group<f_Group>;
 def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>;
index d66f3b4a0137ac4b48b54de75bdc34cbfdaf2edb..502cec7d3f730339ee4b4910192356a09ad71b9a 100644 (file)
@@ -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 (file)
index fdd20ca..0000000
+++ /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"
index aa9dfa22bbe076b2d0a85c1535048704b14e394e..9c84086f3cc6e932af9103df9ce6b97884f0b24f 100644 (file)
@@ -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}"}}
 
 // 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"