From 118f8dc12c67534f18a8fe5c95b3319cf962bf14 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Sun, 30 Jun 2002 17:43:41 -0700 Subject: [PATCH] objc-act.c (finish_file): Avoid finish_objc() if -fsyntax-only. 2002-06-30 Devang Patel * objc/objc-act.c (finish_file): Avoid finish_objc() if -fsyntax-only. 2002-06-30 Devang Patel * objc.dg/fsyntax-only.m: New test. From-SVN: r55125 --- gcc/ChangeLog | 5 +++++ gcc/objc/objc-act.c | 5 ++++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/objc.dg/fsyntax-only.m | 11 +++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/objc.dg/fsyntax-only.m diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce3428bf7dc..87200bca3c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-06-30 Devang Patel + + * objc/objc-act.c (finish_file): Avoid finish_objc() if + -fsyntax-only. + Fri Jun 28 17:22:37 2002 Denis Chertykov Frank Ch. Eigler Matthew Green diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index c6b9d5ff4ef..73e30d71881 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -522,7 +522,10 @@ finish_file () { c_objc_common_finish_file (); - finish_objc (); /* Objective-C finalization */ + /* Finalize Objective-C runtime data. No need to generate tables + and code if only checking syntax. */ + if (!flag_syntax_only) + finish_objc (); if (gen_declaration_file) fclose (gen_declaration_file); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed515741298..0dcf1ca4853 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-06-30 Devang Patel + + * objc.dg/fsyntax-only.m: New test. + 2002-06-27 Mark Mitchell PR c++/6695 diff --git a/gcc/testsuite/objc.dg/fsyntax-only.m b/gcc/testsuite/objc.dg/fsyntax-only.m new file mode 100644 index 00000000000..54a879e22c5 --- /dev/null +++ b/gcc/testsuite/objc.dg/fsyntax-only.m @@ -0,0 +1,11 @@ +/* Test -fsyntax-only compiler option */ +/* { dg-do compile } */ +/* { dg-options "-fsyntax-only" } */ + +@interface foo +-(void) my_method:(int) i with:(int) j; +@end + +@implementation foo +-(void) my_method:(int) i with:(int) j { } +@end