Skip to content

Commit 2582556

Browse files
Copilotdamyanp
andcommitted
Use return instead of report_fatal_error for help/version printing
For help and version printing in CommandLine.cpp, simply return after printing rather than throwing a fatal error exception, since these are not error conditions. Co-authored-by: damyanp <[email protected]>
1 parent e08da9b commit 2582556

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/Support/CommandLine.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,8 @@ class HelpPrinter {
15471547
GlobalParser->MoreHelp.clear();
15481548

15491549
// Halt the program since help information was printed
1550-
report_fatal_error("Help information was printed"); // HLSL Change - don't exit() in shared library
1550+
// HLSL Change - don't exit() in shared library; just return after printing
1551+
return;
15511552
}
15521553
};
15531554

@@ -1798,7 +1799,7 @@ class VersionPrinter {
17981799

17991800
if (OverrideVersionPrinter != nullptr) {
18001801
(*OverrideVersionPrinter)();
1801-
report_fatal_error("Version information was printed"); // HLSL Change - don't exit() in shared library
1802+
return; // HLSL Change - don't exit() in shared library
18021803
}
18031804
print();
18041805

@@ -1812,7 +1813,7 @@ class VersionPrinter {
18121813
(*I)();
18131814
}
18141815

1815-
report_fatal_error("Version information was printed"); // HLSL Change - don't exit() in shared library
1816+
// HLSL Change - don't exit() in shared library
18161817
}
18171818
};
18181819
} // End anonymous namespace

0 commit comments

Comments
 (0)