[llvm] r228336 - [ASan] Enable -asan-stack-dynamic-alloca by default.

Alexey Samsonov vonosmas at gmail.com
Thu Feb 5 11:39:21 PST 2015

Author: samsonov
Date: Thu Feb  5 13:39:20 2015
New Revision: 228336

URL: http://llvm.org/viewvc/llvm-project?rev=228336&view=rev
[ASan] Enable -asan-stack-dynamic-alloca by default.

By default, store all local variables in dynamic alloca instead of
static one. It reduces the stack space usage in use-after-return mode
(dynamic alloca will not be called if the local variables are stored
in a fake stack), and improves the debug info quality for local
variables (they will not be described relatively to %rbp/%rsp, which
are assumed to be clobbered by function calls).


Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=228336&r1=228335&r2=228336&view=diff
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Thu Feb  5 13:39:20 2015
@@ -189,7 +189,7 @@ static cl::opt<bool> ClCheckLifetime("as
 static cl::opt<bool> ClDynamicAllocaStack(
     cl::desc("Use dynamic alloca to represent stack variables"), cl::Hidden,
-    cl::init(false));
+    cl::init(true));
 // Debug flags.
 static cl::opt<int> ClDebug("asan-debug", cl::desc("debug"), cl::Hidden,

More information about the llvm-commits mailing list