aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorZiemowit Laski <zlaski@apple.com>2004-09-10 20:47:34 +0000
committerZiemowit Laski <zlaski@gcc.gnu.org>2004-09-10 20:47:34 +0000
commit80aa8340eb9eefbbf55ba9150abec353500573d5 (patch)
tree1064b1a45e8322e7e3ae36a5af70009c4b2cd540 /gcc/cp
parent375d2edc9f376bd6bb0e102075744664edb0c6c3 (diff)
downloadgcc-80aa8340eb9eefbbf55ba9150abec353500573d5.zip
gcc-80aa8340eb9eefbbf55ba9150abec353500573d5.tar.gz
gcc-80aa8340eb9eefbbf55ba9150abec353500573d5.tar.bz2
decl.c (objc_get_current_scope, [...]): New functions, to be called from ObjC++.
[gcc/cp/ChangeLog] 2004-09-10 Ziemowit Laski <zlaski@apple.com> * decl.c (objc_get_current_scope, objc_mark_locals_volatile): New functions, to be called from ObjC++. From-SVN: r87321
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c32
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ab3da7f..2de9a9f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-10 Ziemowit Laski <zlaski@apple.com>
+
+ * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
+ New functions, to be called from ObjC++.
+
2004-09-10 Kazu Hirata <kazu@cs.umass.edu>
* class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 84a5d9a..f2d8fc2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -403,6 +403,38 @@ pop_labels (tree block)
named_labels = NULL;
}
+/* The following two routines are used to interface to Objective-C++.
+ The binding level is purposely treated as an opaque type. */
+
+void *
+objc_get_current_scope (void)
+{
+ return current_binding_level;
+}
+
+/* The following routine is used by the NeXT-style SJLJ exceptions;
+ variables get marked 'volatile' so as to not be clobbered by
+ _setjmp()/_longjmp() calls. */
+
+void
+objc_mark_locals_volatile (void *enclosing_blk)
+{
+ struct cp_binding_level *scope;
+
+ for (scope = current_binding_level;
+ scope && scope != enclosing_blk && scope->kind == sk_block;
+ scope = scope->level_chain)
+ {
+ tree decl;
+
+ for (decl = scope->names; decl; decl = TREE_CHAIN (decl))
+ {
+ DECL_REGISTER (decl) = 0;
+ TREE_THIS_VOLATILE (decl) = 1;
+ }
+ }
+}
+
/* Exit a binding level.
Pop the level off, and restore the state of the identifier-decl mappings
that were in effect when this level was entered.