r337037 - SafeStack: Add builtins to read unsafe stack top/bottom
Vlad Tsyrklevich via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 13 12:48:35 PDT 2018
Author: vlad.tsyrklevich
Date: Fri Jul 13 12:48:35 2018
New Revision: 337037
URL: http://llvm.org/viewvc/llvm-project?rev=337037&view=rev
Log:
SafeStack: Add builtins to read unsafe stack top/bottom
Summary:
Introduce built-ins to read the unsafe stack top and bottom. The unsafe
stack top is required to implement garbage collection scanning for
Oilpan. Currently there is already a built-in 'get_unsafe_stack_start'
to read the bottom of the unsafe stack, but I chose to duplicate this
API because 'start' is ambiguous (e.g. Oilpan uses WTF::GetStackStart to
read the safe stack top.)
Reviewers: pcc
Reviewed By: pcc
Subscribers: llvm-commits, kcc
Differential Revision: https://reviews.llvm.org/D49152
Modified:
cfe/trunk/docs/SafeStack.rst
cfe/trunk/include/clang/Basic/Builtins.def
Modified: cfe/trunk/docs/SafeStack.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SafeStack.rst?rev=337037&r1=337036&r2=337037&view=diff
==============================================================================
--- cfe/trunk/docs/SafeStack.rst (original)
+++ cfe/trunk/docs/SafeStack.rst Fri Jul 13 12:48:35 2018
@@ -165,11 +165,23 @@ never be stored on the heap, as it would
This builtin function returns current unsafe stack pointer of the current
thread.
+``__builtin___get_unsafe_stack_bottom()``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This builtin function returns a pointer to the bottom of the unsafe stack of the
+current thread.
+
+``__builtin___get_unsafe_stack_top()``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This builtin function returns a pointer to the top of the unsafe stack of the
+current thread.
+
``__builtin___get_unsafe_stack_start()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This builtin function returns a pointer to the start of the unsafe stack of the
-current thread.
+Deprecated: This builtin function is an alias for
+``__builtin___get_unsafe_stack_bottom()``.
Design
======
Modified: cfe/trunk/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=337037&r1=337036&r2=337037&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.def (original)
+++ cfe/trunk/include/clang/Basic/Builtins.def Fri Jul 13 12:48:35 2018
@@ -1412,6 +1412,8 @@ BUILTIN(__builtin_dump_struct, "ivC*v*",
// Safestack builtins
BUILTIN(__builtin___get_unsafe_stack_start, "v*", "Fn")
+BUILTIN(__builtin___get_unsafe_stack_bottom, "v*", "Fn")
+BUILTIN(__builtin___get_unsafe_stack_top, "v*", "Fn")
BUILTIN(__builtin___get_unsafe_stack_ptr, "v*", "Fn")
// Nontemporal loads/stores builtins
More information about the cfe-commits
mailing list