Skip to content

Commit 2f0e46d

Browse files
WalterBrightthewilsonator
authored andcommitted
remove tip()
1 parent b41cb91 commit 2f0e46d

5 files changed

Lines changed: 4 additions & 42 deletions

File tree

compiler/include/dmd/errors.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ enum class ErrorKind
2020
warning = 0,
2121
deprecation = 1,
2222
error = 2,
23-
tip = 3,
24-
message = 4,
23+
message = 3,
2524
};
2625

2726
#if defined(__GNUC__)
@@ -40,7 +39,6 @@ D_ATTRIBUTE_FORMAT(4, 5) void error(const char *filename, unsigned linnum, unsig
4039
D_ATTRIBUTE_FORMAT(2, 3) void errorSupplemental(Loc loc, const char *format, ...);
4140
D_ATTRIBUTE_FORMAT(1, 2) void message(const char *format, ...);
4241
D_ATTRIBUTE_FORMAT(2, 3) void message(Loc loc, const char *format, ...);
43-
D_ATTRIBUTE_FORMAT(1, 2) void tip(const char *format, ...);
4442

4543
#if defined(__GNUC__) || defined(__clang__)
4644
#define D_ATTRIBUTE_NORETURN __attribute__((noreturn))

compiler/src/dmd/dtemplate.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ extern (C++) class TemplateInstance : ScopeDsymbol
938938
return &errorSupplemental;
939939
case Classification.deprecation:
940940
return &deprecationSupplemental;
941-
case Classification.gagged, Classification.tip, Classification.warning:
941+
case Classification.gagged, Classification.warning:
942942
assert(0);
943943
}
944944
}();

compiler/src/dmd/errors.d

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ErrorSinkCompiler : ErrorSink
100100
}
101101

102102
// SourceLoc-taking entry points used directly by `error(filename,linnum,...)`,
103-
// `errorBackend`, `tip()` and supplemental sites; also called by the Loc
103+
// `errorBackend` and supplemental sites; also called by the Loc
104104
// overloads above.
105105

106106
final void verror(const SourceLoc loc, const(char)* format, va_list ap)
@@ -175,13 +175,6 @@ class ErrorSinkCompiler : ErrorSink
175175
emit(loc, format, ap, ErrorKind.message, false, false);
176176
}
177177

178-
final void vtip(const(char)* format, va_list ap)
179-
{
180-
if (global.gag)
181-
return;
182-
emit(SourceLoc.init, format, ap, ErrorKind.tip, false, false);
183-
}
184-
185178
final void verrorSupplemental(const SourceLoc loc, const(char)* format, va_list ap)
186179
{
187180
if (global.gag)
@@ -233,7 +226,7 @@ class ErrorSinkCompiler : ErrorSink
233226
* loc = location of the diagnostic
234227
* format = printf-style format string
235228
* ap = arguments for `format`
236-
* kind = error / warning / deprecation / tip / message
229+
* kind = error / warning / deprecation / message
237230
* supplemental = follow-on note, not a primary diagnostic
238231
* gagged = diagnostic occurred under speculative gagging
239232
*/
@@ -269,7 +262,6 @@ private Classification classificationFor(ErrorKind kind) @safe @nogc pure nothro
269262
case ErrorKind.error: return Classification.error;
270263
case ErrorKind.warning: return Classification.warning;
271264
case ErrorKind.deprecation: return Classification.deprecation;
272-
case ErrorKind.tip: return Classification.tip;
273265
case ErrorKind.message: return Classification.error; // unused (handled above)
274266
}
275267
}
@@ -284,7 +276,6 @@ enum Classification : Color
284276
gagged = Color.brightBlue, /// for gagged errors
285277
warning = Color.brightYellow, /// for warnings
286278
deprecation = Color.brightCyan, /// for deprecations
287-
tip = Color.brightGreen, /// for tip messages
288279
}
289280

290281

@@ -573,30 +564,6 @@ alias DiagnosticHandler = bool delegate(const ref SourceLoc location, Color head
573564
*/
574565
__gshared DiagnosticHandler diagnosticHandler;
575566

576-
/**
577-
* Print a tip message with the prefix and highlighting.
578-
* Params:
579-
* format = printf-style format specification
580-
* ... = printf-style variadic arguments
581-
*/
582-
static if (__VERSION__ < 2092)
583-
extern (C++) void tip(const(char)* format, ...)
584-
{
585-
va_list ap;
586-
va_start(ap, format);
587-
global.errorSink.vtip(format, ap);
588-
va_end(ap);
589-
}
590-
else
591-
pragma(printf) extern (C++) void tip(const(char)* format, ...)
592-
{
593-
va_list ap;
594-
va_start(ap, format);
595-
global.errorSink.vtip(format, ap);
596-
va_end(ap);
597-
}
598-
599-
600567
// Encapsulates a diagnostic as described by its location, format message, and kind.
601568
private struct DiagnosticContext
602569
{
@@ -636,7 +603,6 @@ private void printDiagnostic(const(char)* format, va_list ap, ref DiagnosticCont
636603
case ErrorKind.error: header = "Error: "; break;
637604
case ErrorKind.deprecation: header = "Deprecation: "; break;
638605
case ErrorKind.warning: header = "Warning: "; break;
639-
case ErrorKind.tip: header = " Tip: "; break;
640606
case ErrorKind.message: assert(0);
641607
}
642608
}

compiler/src/dmd/errorsink.d

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ enum ErrorKind
2121
warning,
2222
deprecation,
2323
error,
24-
tip,
2524
message,
2625
}
2726

compiler/src/dmd/sarif.d

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ private string errorKindToString(ErrorKind kind) nothrow
3636
case ErrorKind.error: return "error";
3737
case ErrorKind.warning: return "warning";
3838
case ErrorKind.deprecation: return "note";
39-
case ErrorKind.tip: return "note";
4039
case ErrorKind.message: return "none";
4140
}
4241
}

0 commit comments

Comments
 (0)