Commit f679fc17 by Nicolas Capens Committed by Nicolas Capens

Fix -warn-stack-size command line option for LLVM 12

The -warn-stack-size command line option won't be deprecated until the LLVM 13 release. This change also produces a compile-time error when LLVM 13+ is used so we won't fail to notice that the the stack size checking functionality has to be implemented using the per-function "warn-stack-size" attribute introduced by https://reviews.llvm.org/D104342. Note that development builds of LLVM use LLVM_MAJOR_VERSION=9999. Bug: b/191193823 Change-Id: I044d576a6dcd73354710783a7f7e042cb43254c5 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/55188 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent f239c9f1
......@@ -151,10 +151,14 @@ JITGlobals *JITGlobals::get()
#if defined(__i386__) || defined(__x86_64__)
"-x86-asm-syntax=intel", // Use Intel syntax rather than the default AT&T
#endif
#if LLVM_VERSION_MAJOR <= 12
"-warn-stack-size=524288" // Warn when a function uses more than 512 KiB of stack memory
#else
// TODO(b/191193823): TODO(ndesaulniers): Update this after
// go/compilers/fc018ebb608ee0c1239b405460e49f1835ab6175
#if LLVM_VERSION_MAJOR <= 11
"-warn-stack-size=524288" // Warn when a function uses more than 512 KiB of stack memory
# if LLVM_VERSION_MAJOR < 9999
# error Implement stack size checks using the "warn-stack-size" function attribute.
# endif
#endif
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment