Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dmd/dsymbol.d
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ extern (C++) class Dsymbol : ASTNode

final bool checkDeprecated(const ref Loc loc, Scope* sc)
{
if (global.params.useDeprecated != Diagnostic.off && isDeprecated())
if (global.params.useDeprecated != DiagnosticReporting.off && isDeprecated())
{
// Don't complain if we're inside a deprecated symbol's scope
if (sc.isDeprecated())
Expand Down
14 changes: 7 additions & 7 deletions src/dmd/errors.d
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,12 @@ extern (C++) void verrorSupplemental(const ref Loc loc, const(char)* format, va_
*/
extern (C++) void vwarning(const ref Loc loc, const(char)* format, va_list ap)
{
if (global.params.warnings != Diagnostic.off)
if (global.params.warnings != DiagnosticReporting.off)
{
if (!global.gag)
{
verrorPrint(loc, Classification.warning, "Warning: ", format, ap);
if (global.params.warnings == Diagnostic.error)
if (global.params.warnings == DiagnosticReporting.error)
global.warnings++;
}
else
Expand All @@ -346,7 +346,7 @@ extern (C++) void vwarning(const ref Loc loc, const(char)* format, va_list ap)
*/
extern (C++) void vwarningSupplemental(const ref Loc loc, const(char)* format, va_list ap)
{
if (global.params.warnings != Diagnostic.off && !global.gag)
if (global.params.warnings != DiagnosticReporting.off && !global.gag)
verrorPrint(loc, Classification.warning, " ", format, ap);
}

Expand All @@ -362,9 +362,9 @@ extern (C++) void vwarningSupplemental(const ref Loc loc, const(char)* format, v
extern (C++) void vdeprecation(const ref Loc loc, const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null)
{
__gshared const(char)* header = "Deprecation: ";
if (global.params.useDeprecated == Diagnostic.error)
if (global.params.useDeprecated == DiagnosticReporting.error)
verror(loc, format, ap, p1, p2, header);
else if (global.params.useDeprecated == Diagnostic.inform)
else if (global.params.useDeprecated == DiagnosticReporting.inform)
{
if (!global.gag)
{
Expand Down Expand Up @@ -408,9 +408,9 @@ extern (C++) void vmessage(const ref Loc loc, const(char)* format, va_list ap)
*/
extern (C++) void vdeprecationSupplemental(const ref Loc loc, const(char)* format, va_list ap)
{
if (global.params.useDeprecated == Diagnostic.error)
if (global.params.useDeprecated == DiagnosticReporting.error)
verrorSupplemental(loc, format, ap);
else if (global.params.useDeprecated == Diagnostic.inform && !global.gag)
else if (global.params.useDeprecated == DiagnosticReporting.inform && !global.gag)
verrorPrint(loc, Classification.deprecation, " ", format, ap);
}

Expand Down
4 changes: 2 additions & 2 deletions src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -8530,7 +8530,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
return setError();
}

if (0 && global.params.warnings != Diagnostic.off && !global.gag && exp.op == TOK.assign &&
if (0 && global.params.warnings != DiagnosticReporting.off && !global.gag && exp.op == TOK.assign &&
e2x.op != TOK.slice && e2x.op != TOK.assign &&
e2x.op != TOK.arrayLiteral && e2x.op != TOK.string_ &&
!(e2x.op == TOK.add || e2x.op == TOK.min ||
Expand Down Expand Up @@ -8594,7 +8594,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
}
else
{
if (0 && global.params.warnings != Diagnostic.off && !global.gag && exp.op == TOK.assign &&
if (0 && global.params.warnings != DiagnosticReporting.off && !global.gag && exp.op == TOK.assign &&
t1.ty == Tarray && t2.ty == Tsarray &&
e2x.op != TOK.slice &&
t2.implicitConvTo(t1))
Expand Down
6 changes: 3 additions & 3 deletions src/dmd/globals.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum TARGET : bool
DragonFlyBSD = xversion!`DragonFlyBSD`,
}

enum Diagnostic : ubyte
enum DiagnosticReporting : ubyte
{
error, // generate an error
inform, // generate a warning
Expand Down Expand Up @@ -132,15 +132,15 @@ struct Param
bool isSolaris; // generate code for Solaris
bool hasObjectiveC; // target supports Objective-C
bool mscoff = false; // for Win32: write MsCoff object files instead of OMF
Diagnostic useDeprecated = Diagnostic.inform; // how use of deprecated features are handled
DiagnosticReporting useDeprecated = DiagnosticReporting.inform; // how use of deprecated features are handled
bool stackstomp; // add stack stomping code
bool useUnitTests; // generate unittest code
bool useInline = false; // inline expand functions
bool useDIP25; // implement http://wiki.dlang.org/DIP25
bool noDIP25; // revert to pre-DIP25 behavior
bool release; // build release version
bool preservePaths; // true means don't strip path from source file
Diagnostic warnings = Diagnostic.off; // how compiler warnings are handled
DiagnosticReporting warnings = DiagnosticReporting.off; // how compiler warnings are handled
bool pic; // generate position-independent-code for shared libs
bool color; // use ANSI colors in console output
bool cov; // generate code coverage data
Expand Down
6 changes: 3 additions & 3 deletions src/dmd/lexer.d
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ This is usually the default diagnostic reporter.
*/
final class StderrDiagnosticReporter : DiagnosticReporter
{
private const Diagnostic useDeprecated;
private const DiagnosticReporting useDeprecated;

private int errorCount_;
private int warningCount_;
Expand All @@ -346,7 +346,7 @@ final class StderrDiagnosticReporter : DiagnosticReporter
useDeprecated = indicates how deprecation diagnostics should be
handled
*/
this(Diagnostic useDeprecated)
this(DiagnosticReporting useDeprecated)
{
this.useDeprecated = useDeprecated;
}
Expand Down Expand Up @@ -392,7 +392,7 @@ final class StderrDiagnosticReporter : DiagnosticReporter
{
vdeprecation(loc, format, args);

if (useDeprecated == Diagnostic.error)
if (useDeprecated == DiagnosticReporting.error)
errorCount_++;
else
deprecationCount_++;
Expand Down
10 changes: 5 additions & 5 deletions src/dmd/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -1573,11 +1573,11 @@ bool parseCommandLine(const ref Strings arguments, const size_t argc, ref Param
if (arg == "-allinst") // https://dlang.org/dmd.html#switch-allinst
params.allInst = true;
else if (arg == "-de") // https://dlang.org/dmd.html#switch-de
params.useDeprecated = Diagnostic.error;
params.useDeprecated = DiagnosticReporting.error;
else if (arg == "-d") // https://dlang.org/dmd.html#switch-d
params.useDeprecated = Diagnostic.off;
params.useDeprecated = DiagnosticReporting.off;
else if (arg == "-dw") // https://dlang.org/dmd.html#switch-dw
params.useDeprecated = Diagnostic.inform;
params.useDeprecated = DiagnosticReporting.inform;
else if (arg == "-c") // https://dlang.org/dmd.html#switch-c
params.link = false;
else if (startsWith(p + 1, "checkaction")) // https://dlang.org/dmd.html#switch-checkaction
Expand Down Expand Up @@ -2009,9 +2009,9 @@ bool parseCommandLine(const ref Strings arguments, const size_t argc, ref Param
params.useDIP25 = false;
}
else if (arg == "-w") // https://dlang.org/dmd.html#switch-w
params.warnings = Diagnostic.error;
params.warnings = DiagnosticReporting.error;
else if (arg == "-wi") // https://dlang.org/dmd.html#switch-wi
params.warnings = Diagnostic.inform;
params.warnings = DiagnosticReporting.inform;
else if (arg == "-O") // https://dlang.org/dmd.html#switch-O
params.optimize = true;
else if (p[1] == 'o')
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/semantic3.d
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ private extern(C++) final class Semantic3Visitor : Visitor

// don't do it for unused deprecated types
// or error ypes
if (!ad.getRTInfo && Type.rtinfo && (!ad.isDeprecated() || global.params.useDeprecated != Diagnostic.error) && (ad.type && ad.type.ty != Terror))
if (!ad.getRTInfo && Type.rtinfo && (!ad.isDeprecated() || global.params.useDeprecated != DiagnosticReporting.error) && (ad.type && ad.type.ty != Terror))
{
// Evaluate: RTinfo!type
auto tiargs = new Objects();
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/sideeffect.d
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ bool discardValue(Expression e)
}
case TOK.call:
/* Issue 3882: */
if (global.params.warnings != Diagnostic.off && !global.gag)
if (global.params.warnings != DiagnosticReporting.off && !global.gag)
{
CallExp ce = cast(CallExp)e;
if (e.type.ty == Tvoid)
Expand Down