]> granicus.if.org Git - clang/commitdiff
Revert r177218.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 3 May 2013 23:20:27 +0000 (23:20 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 3 May 2013 23:20:27 +0000 (23:20 +0000)
Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181073 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Diagnostic.h
include/clang/Basic/DiagnosticOptions.def
include/clang/Driver/CC1Options.td
lib/Basic/Diagnostic.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/Warnings.cpp
lib/Sema/SemaLookup.cpp
test/SemaObjC/typo-correction.m

index 900964b68adbe4edf38c0ba53badd29c1591be72..3e125944a36164f1345abd301304ecff305e7eb4 100644 (file)
@@ -175,7 +175,6 @@ private:
   bool SuppressAllDiagnostics;   // Suppress all diagnostics.
   bool ElideType;                // Elide common types of templates.
   bool PrintTemplateTree;        // Print a tree when comparing templates.
-  bool WarnOnSpellCheck;         // Emit warning when spellcheck is initiated.
   bool ShowColors;               // Color printing is enabled.
   OverloadsShown ShowOverloads;  // Which overload candidates to show.
   unsigned ErrorLimit;           // Cap of # errors emitted, 0 -> no limit.
@@ -467,10 +466,6 @@ public:
   /// tree format.
   void setPrintTemplateTree(bool Val = false) { PrintTemplateTree = Val; }
   bool getPrintTemplateTree() { return PrintTemplateTree; }
-
-  /// \brief Warn when spellchecking is initated, for testing.
-  void setWarnOnSpellCheck(bool Val = false) { WarnOnSpellCheck = Val; }
-  bool getWarnOnSpellCheck() { return WarnOnSpellCheck; }
  
   /// \brief Set color printing, so the type diffing will inject color markers
   /// into the output.
index 8e5562c86305412c848c6ed51788b7118ce8d421..41bbff2edec25b4261a974173951b40659749a2b 100644 (file)
@@ -72,7 +72,6 @@ DIAGOPT(VerifyDiagnostics, 1, 0) /// Check that diagnostics match the expected
 
 DIAGOPT(ElideType, 1, 0)         /// Elide identical types in template diffing
 DIAGOPT(ShowTemplateTree, 1, 0)  /// Print a template tree when diffing
-DIAGOPT(WarnOnSpellCheck, 1, 0)  /// -fwarn-on-spellcheck
 
 VALUE_DIAGOPT(ErrorLimit, 32, 0)           /// Limit # errors emitted.
 /// Limit depth of macro expansion backtrace.
index e4dd34509efeb794a2052b3db6f15b2a20cc46d8..96a50fc5c66a0b65509ec0f42fa7f10abb95e263 100644 (file)
@@ -245,9 +245,6 @@ def fmessage_length : Separate<["-"], "fmessage-length">, MetaVarName<"<N>">,
 def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">,
   HelpText<"Silence ObjC rewriting warnings">;
 
-def fwarn_on_spellcheck : Flag<["-"], "fwarn-on-spellcheck">,
-  HelpText<"Emit warning if spell-check is initiated, for testing">;
-
 //===----------------------------------------------------------------------===//
 // Frontend Options
 //===----------------------------------------------------------------------===//
index c5b277a9a88c1a1018e5bd0222e401c85a61762a..45d4b539e8c2168a17ab3cf03439ca8eb5094fa1 100644 (file)
@@ -48,7 +48,6 @@ DiagnosticsEngine::DiagnosticsEngine(
   AllExtensionsSilenced = 0;
   IgnoreAllWarnings = false;
   WarningsAsErrors = false;
-  WarnOnSpellCheck = false;
   EnableAllWarnings = false;
   ErrorsAsFatal = false;
   SuppressSystemWarnings = false;
index b5fb71e00f2870809e60525e5547c0a01498300c..42ea96f0f2add21b70c8f95599664f80e6b7b9d6 100644 (file)
@@ -568,7 +568,6 @@ bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
   Opts.VerifyDiagnostics = Args.hasArg(OPT_verify);
   Opts.ElideType = !Args.hasArg(OPT_fno_elide_type);
   Opts.ShowTemplateTree = Args.hasArg(OPT_fdiagnostics_show_template_tree);
-  Opts.WarnOnSpellCheck = Args.hasArg(OPT_fwarn_on_spellcheck);
   Opts.ErrorLimit = Args.getLastArgIntValue(OPT_ferror_limit, 0, Diags);
   Opts.MacroBacktraceLimit
     = Args.getLastArgIntValue(OPT_fmacro_backtrace_limit,
index b7547b9998e71967cb626d5e0672c015027fc339..767096a1c990afe2589fa99090cf8499cc64a8e6 100644 (file)
@@ -56,7 +56,6 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
 
   Diags.setElideType(Opts.ElideType);
   Diags.setPrintTemplateTree(Opts.ShowTemplateTree);
-  Diags.setWarnOnSpellCheck(Opts.WarnOnSpellCheck);
   Diags.setShowColors(Opts.ShowColors);
  
   // Handle -ferror-limit
index 85a74490cbf08c351e2dfc60ffcc47fddd3c1728..940f8f32fa54264ed457bca02d81686532633b4f 100644 (file)
@@ -3792,13 +3792,6 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName,
   if (S && S->isInObjcMethodScope() && Typo == getSuperIdentifier())
     return TypoCorrection();
 
-  // This is for testing.
-  if (Diags.getWarnOnSpellCheck()) {
-    unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Warning,
-                                            "spell-checking initiated for %0");
-    Diag(TypoName.getLoc(), DiagID) << TypoName.getName();
-  }
-
   NamespaceSpecifierSet Namespaces(Context, CurContext, SS);
 
   TypoCorrectionConsumer Consumer(*this, Typo);
index 3fd61e2ecea32f6853550eb66d3ba1299719dd76..893e31294ad67f8e042cbefb27d889c494557272 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only -fwarn-on-spellcheck
+// RUN: %clang_cc1 %s -verify -fsyntax-only
 
 @interface B
 @property int x;
@@ -8,8 +8,7 @@
 @end
 
 // Spell-checking 'undefined' is ok.
-undefined var; // expected-warning {{spell-checking initiated}} \
-               // expected-error {{unknown type name}}
+undefined var; // expected-error {{unknown type name}}
 
 typedef int super1;
 @implementation S