Previously, #pragma clang __debug overflow_stack wasn't really working, the function was simply looping and not overflowing.
I tested this in various configurations, with Clang 9, MSVC 2017/2019 and GCC 9 on Ubuntu.
Details
Details
Diff Detail
Diff Detail
Event Timeline
clang/lib/Lex/Pragma.cpp | ||
---|---|---|
1148 | Would it be better if we had something like LLVM_[DISABLE|ENABLE]_OPT in Compiler.h instead of the #ifdefs? That would map to #pragma clang optimize [off|on] (and corresponding #pragma on MSVC/GCC). Note that there's no way I know of to disable optimizations on a per-function basis on MSVC. |
Comment Actions
Withdrawing this, I found an crash in Debug build. I think this can't work without doing all the crash processing in a separate, pre-allocated thread.
Would it be better if we had something like LLVM_[DISABLE|ENABLE]_OPT in Compiler.h instead of the #ifdefs? That would map to #pragma clang optimize [off|on] (and corresponding #pragma on MSVC/GCC). Note that there's no way I know of to disable optimizations on a per-function basis on MSVC.