Search code examples
c++xcodexcode5pragma

Apple LLVM 5.0 pragma optimize


What is the equivalent of GCC's #pragma GCC optimize("O0") or VS's #pragma optimize("", off) in Apple LLVM 5.0 compiler?

I need it to disable optimizations for just a section of code.


Solution

  • From a brief search it doesn't look like clang/llvm supports such a pragma at this time. If you don't want to turn off optimizations for an entire file I suggest factoring what you don't want optimized into a separate file and setting -O0 on it separately.