@@ -34,6 +34,24 @@ int CONDITIONAL_ASSERT_Global_enable_flag =
3434 1 ; // Default to `on` in debug builds
3535#endif
3636
37+ static void ASSERT_help () {
38+ static int ASSERT_help_shown = 0 ;
39+ if (ASSERT_help_shown) {
40+ return ;
41+ }
42+ ASSERT_help_shown = 1 ;
43+
44+ if (!AssertHelp) {
45+ llvm::errs () << " (to display assertion configuration options: -Xllvm -assert-help)\n " ;
46+ return ;
47+ }
48+
49+ llvm::errs () << " \n " ;
50+ llvm::errs () << " Control assertion behavior with one or more of the following options:\n\n " ;
51+ llvm::errs () << " -Xllvm -assert-continue\n " ;
52+ llvm::errs () << " Continue after any failed assertion\n\n " ;
53+ }
54+
3755void ASSERT_failure (const char *expr, const char *filename, int line, const char *func) {
3856 // Find the last component of `filename`
3957 // Needed on Windows MSVC, which lacks __FILE_NAME__
@@ -62,24 +80,6 @@ void ASSERT_failure(const char *expr, const char *filename, int line, const char
6280 abort ();
6381}
6482
65- void ASSERT_help () {
66- static int ASSERT_help_shown = 0 ;
67- if (ASSERT_help_shown) {
68- return ;
69- }
70- ASSERT_help_shown = 1 ;
71-
72- if (!AssertHelp) {
73- llvm::errs () << " (to display assertion configuration options: -Xllvm -assert-help)\n " ;
74- return ;
75- }
76-
77- llvm::errs () << " \n " ;
78- llvm::errs () << " Control assertion behavior with one or more of the following options:\n\n " ;
79- llvm::errs () << " -Xllvm -assert-continue\n " ;
80- llvm::errs () << " Continue after any failed assertion\n\n " ;
81- }
82-
8383// This has to be callable in the same way as the macro version,
8484// so we can't put it inside a namespace.
8585#undef CONDITIONAL_ASSERT_enabled
0 commit comments