gcc gcc/ChangeLog.apple-ppc gcc/c-common.c gcc ...

shebs@gcc.gnu.org shebs@gcc.gnu.org
Wed Aug 4 00:08:00 GMT 2004


CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	apple-ppc-branch
Changes by:	shebs@gcc.gnu.org	2004-08-04 00:08:39

Modified files:
	gcc            : ChangeLog.apple-ppc c-common.c c-common.h 
	                 c-decl.c c-lex.c c-opts.c c-parse.in c-tree.h 
	                 c-typeck.c c.opt function.h scan-decls.c tree.h 
	gcc/config     : darwin-protos.h darwin.c 
	gcc/config/rs6000: rs6000-protos.h rs6000.c rs6000.h 
	gcc/cp         : ChangeLog.apple-ppc cp-tree.h decl.c parser.c 
	                 semantics.c typeck.c 
	gcc/doc        : extend.texi invoke.texi 
	gcc/testsuite  : ChangeLog.apple-ppc 
	libcpp         : internal.h lex.c macro.c 
	libcpp/include : cpplib.h 
Added files:
	gcc/testsuite/g++.dg: asm-block-1.C asm-block-2.C 
	                      asm-function-1.C asm-function-2.C 
	                      asm-function-3.C asm-function-4.C 
	                      asm-function-5.C asm-function-6.C 
	gcc/testsuite/gcc.apple: asm-block-1.c asm-block-2.c 
	                         asm-function-1.c asm-function-2.c 
	                         asm-function-3.c asm-function-4.c 
	                         asm-function-5.c asm-function-6.c 
	libcpp         : ChangeLog.apple-ppc 

Log message:
	Support for CodeWarrior-style assembly language blocks and
	functions. Radar 3368707. Reviewed by Mike Stump and Dale
	Johannesen.
	
	* c.opt (-fasm-blocks): New option.
	* c-common.h (enum cw_asm_states): New enum, state values.
	* c-tree.h: Declare some functions.
	* c-common.c (flag_cw_asm_blocks): New flag.
	(cw_asm_states, cw_asm_in_decl, cw_asm_block, cw_asm_at_bol,
	cw_asm_in_operands, cw_asm_labelno, cw_asm_buffer,
	cw_asm_operands, cw_asm_labels, cw_asm_labels_uniq): New globals.
	(cw_asm_default_function_conversion, cw_asm_stmt,
	cw_asm_field_offset, cw_asm_field_offset, print_cw_asm_operand,
	cw_asm_get_register_var, cw_asm_reg_name, cw_asm_label,
	get_atsign_identifier, clear_cw_asm_labels, get_cw_asm_label,
	cw_asm_build_register_offset, cw_asm_entry): New functions.
	c-decl.c: (grokdeclarator): Recognize asm keyword, set flag
	on function decl if seen.
	(start_function): Change asm state to expect local decls.
	(lookup_struct_or_union_tag): New function.
	c-lex.c (cw_asm_saved_token, c_lex_depth): New globals.
	(c_lex_with_flags): Add state machine to return BOL and EOL
	tokens at appropriate moments, return CPP_ATSIGN as its own
	token if in asm block.
	c-opts.c (c_common_handle_option): Recognize -fasm-blocks.
	c-parse.in: Add rules for parsing CW asm blocks.
	(CW_ASM_KEYWORD, CW_ASM_BOL, CW_ASM_EOL): New tokens.
	(cw_asm_expr_no_commas, cw_asm_unary_expr, cw_asm_primary,
	cw_asm_operands, cw_nonnull_asm_operands, cw_asm_operand, cw_asm_stmt,
	single_cw_asm_stmt, cw_asm_compstmt, cw_asm_compstmt_start,
	cw_asm_compstmt_nostart): New nonterminals.
	(lineno_decl): Flag no longer in decls part.
	(scspec): Add CW_ASM_KEYWORD.
	(stmt): Add cw_asm_compstmt and cw_asm_stmt alternatives.
	(yylexname): Detect asm functions and return CW_ASM_KEYWORD.
	(_yylex): Return '@' as token if CW asm, return BOL/EOL.
	c-typeck.c (build_external_ref): Handle asm register names
	and labels specially.
	(cw_asm_typename_or_reserved, cw_asm_c_build_component_ref):
	New functions.
	
	* function.h (struct function): New fields cw_asm_function,
	cw_asm_noreturn, cw_asm_frame_size.
	* tree.h (DECL_CW_ASM_FUNCTION, DECL_CW_ASM_NORETURN,
	DECL_CW_ASM_FRAME_SIZE): New macros.
	(struct tree_decl): New fields cw_asm_function_flag,
	cw_asm_noreturn_flag, cw_asm_frame_size.
	* config/darwin.h (CW_ASM_SPECIAL_LABEL): Define.
	* config/darwin-protos.h (darwin_cw_asm_special_label): Declare.
	* config/darwin.c (darwin_cw_asm_special_label): New function.
	* rs6000/rs6000-protos.h (rs6000_cw_asm_register_name): Declare.
	* rs6000/rs6000.c (rs6000_cw_asm_register_name): New function.
	* rs6000/rs6000.h (CW_ASM_REGISTER_NAME): Define.
	* scan-decls.c (flag_cw_asm_blocks, etc): Dummy definitions.
	
	* doc/extend.texi, doc/invoke.texi: Document.
	
	* cp-tree.h (cw_asm_cp_build_component_ref): Declare.
	* decl.c (grokdeclarator): Recognize asm keyword, set flag
	on function decl if seen.
	* parser.c (cp_lexer_get_preprocessor_token): Allow @-tokens
	if doing asm.
	(cp_parser_primary_expression): Recognize @-tokens in asm,
	replace with @-identifier (which will become a label) later.
	(cp_parser_unary_expression): Call asm-specific postfix
	expression handler.
	(cp_parser_compound_statement): Handle asm compound statements
	specially.
	(cp_parser_statement_seq_opt): Handle statement sequences in
	asm blocks specially.
	(cp_parser_simple_declaration): Leave instead of erroring out
	if apparent asm opcode is seen.
	(cp_parser_decl_specifier_seq,
	cp_parser_storage_class_specifier_opt): Accept RID_ASM as a specifier.
	(cp_parser_asm_definition): Detect asm blocks and handle.
	(cp_parser_cw_asm_compound_statement,
	cp_parser_cw_asm_declaration_seq_opt, cp_parser_cw_asm_line_seq_opt,
	cp_parser_cw_asm_line, cp_parser_cw_asm_statement_seq_opt,
	cp_parser_cw_asm_statement, cp_parser_cw_asm_operands,
	cp_parser_cw_asm_operand, cp_parser_cw_asm_postfix_expression,
	cw_asm_typename_or_reserved): New functions.
	semantics.c (finish_id_expression): Handle register names
	and labels in asm blocks specially.
	* typeck.c (cw_asm_cp_build_component_ref): New function.
	
	Support for CodeWarrior-style assembly language blocks and
	functions.  Radar 3368707.
	* testsuite/gcc.apple/asm-block-[12].c: New tests.
	* testsuite/gcc.apple/asm-function-[1-6].c: New tests.
	* testsuite/g++.dg/asm-block-[12].C: New tests.
	* testsuite/g+.dg/asm-function-[1-6].C: New tests.
	
	Support for CodeWarrior-style assembly language blocks and
	functions.  Radar 3368707.
	* include/cpplib.h (CPP_BOL, CPP_EOL): Define.
	* internal.h (struct cpp_context): New field bol_p.
	* lex.c (lex_identifier): Handle special chars in opcodes.
	(cw_asm_label_follows): New global.
	(_cpp_lex_direct): Special handling for @-labels,
	flag end of operands when ';' seen.
	* macro.c (enter_macro_context): Add bol_p argument and use.
	(push_ptoken_context): Seed bol_p field.
	(push_token_context): Ditto.
	(cpp_get_token): Detect tokens at beginning of line and record.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.104&r2=1.1.2.105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.344.2.64.2.12&r2=1.344.2.64.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.141.2.48.2.10&r2=1.141.2.48.2.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.334.2.87.2.12&r2=1.334.2.87.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-lex.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.182.2.18.2.6&r2=1.182.2.18.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-opts.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.7.2.30.2.13&r2=1.7.2.30.2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parse.in.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.144.2.30.2.3&r2=1.144.2.30.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.99.2.33.2.2&r2=1.99.2.33.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.196.2.43.2.7&r2=1.196.2.43.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c.opt.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.11.2.9.2.8&r2=1.11.2.9.2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.83.2.30.2.3&r2=1.83.2.30.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/scan-decls.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.30.2.4&r2=1.30.2.4.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.342.2.179.2.9&r2=1.342.2.179.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/darwin-protos.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.13.2.14.2.5&r2=1.13.2.14.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/darwin.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.22.2.24.2.14&r2=1.22.2.24.2.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000-protos.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.37.2.21.4.9&r2=1.37.2.21.4.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.332.2.46.2.38&r2=1.332.2.46.2.39
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.210.2.36.2.8&r2=1.210.2.36.2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.4&r2=1.1.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.719.2.53.2.3&r2=1.719.2.53.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.911.2.67.2.9&r2=1.911.2.67.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.32.2.23.2.1&r2=1.32.2.23.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.264.2.48.2.1&r2=1.264.2.48.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.408.2.43.2.9&r2=1.408.2.43.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/extend.texi.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.82.2.36.2.3&r2=1.82.2.36.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.152.2.84.2.15&r2=1.152.2.84.2.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.17&r2=1.1.2.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-block-1.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-block-2.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-function-1.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-function-2.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-function-3.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-function-4.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-function-5.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/asm-function-6.C.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-block-1.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-block-2.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-function-1.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-function-2.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-function-3.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-function-4.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-function-5.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.apple/asm-function-6.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libcpp/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libcpp/internal.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.2.2.2&r2=1.2.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libcpp/lex.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.2.2.1&r2=1.2.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libcpp/macro.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.2.2.1&r2=1.2.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libcpp/include/cpplib.h.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.2.2.2&r2=1.2.2.3



More information about the Gcc-cvs mailing list