aboutsummaryrefslogtreecommitdiff
path: root/libcpp
AgeCommit message (Collapse)AuthorFilesLines
2008-01-03re PR preprocessor/34602 (Internal error with invalid #line directive)Tom Tromey2-4/+15
libcpp PR preprocessor/34602. * directives.c (do_line): Don't try to spell EOF token. (do_linemarker): Add comment. gcc/testsuite PR preprocessor/34602: * gcc.dg/cpp/pr34602.c: New file. From-SVN: r131304
2007-12-11charset.c (convert_using_iconv): Close out any shift states, returning to ↵DJ Delorie2-4/+26
the initial state. * charset.c (convert_using_iconv): Close out any shift states, returning to the initial state. From-SVN: r130785
2007-12-06re PR c/29172 (--combine can't handle #pragma once)Tom Tromey4-8/+81
gcc PR c/29172: * c-opts.c (c_common_parse_file): Call cpp_clear_file_cache. libcpp PR c/29172: * internal.h (struct cpp_reader) <file_hash_entries>: Changed type. <file_hash_entries_allocated, file_hash_entries_used>: Removed. * files.c (FILE_HASH_POOL_SIZE): New macro. (struct file_hash_entry_pool): New. (destroy_all_cpp_files): New function. (allocate_file_hash_entries): Allocate a file_hash_entry_pool. (new_file_hash_entry): Update. (free_file_hash_entries): New function. (_cpp_cleanup_files): Call free_file_hash_entries and destroy_all_cpp_files. (cpp_clear_file_cache): New function. * include/cpplib.h (cpp_clear_file_cache): Declare. From-SVN: r130656
2007-12-05* vi.po: Update.Joseph Myers2-18/+15
From-SVN: r130615
2007-12-03( 5)Tom Tromey4-0/+76
From-SVN: r130586
2007-11-30re PR preprocessor/32868 (Don't warn about redefinitions of ↵Tom Tromey2-1/+8
__STDC_FORMAT_MACROS) libcpp PR preprocessor/32868: * macro.c (_cpp_create_definition): Special case __STDC_FORMAT_MACROS. gcc/testsuite PR preprocessor/32868: * gcc.dg/cpp/pr32868.c: New file. From-SVN: r130544
2007-11-30Really remove accidentally committed ChangeLog entryTom Tromey1-5/+0
From-SVN: r130541
2007-11-16* files.c (search_path_head): Fix check for absolute paths.Michael Matz2-1/+6
From-SVN: r130229
2007-11-15* es.po: Update.Joseph Myers2-16/+16
From-SVN: r130204
2007-11-12Fix erroneous ChangeLog changeTom Tromey1-5/+5
From-SVN: r130094
2007-11-12re PR c++/17577 (#pragma implementation no longer diagnoses use after file ↵Tom Tromey3-0/+39
to which it applies) gcc/cp PR c++/17577: * lex.c (handle_pragma_implementation): Use cpp_included_before. gcc/testsuite PR c++/17577: * g++.dg/ext/pr17577.h: New file. * g++.dg/ext/pr17577.C: New file. libcpp PR c++/17557: * include/cpplib.h (cpp_included_before): Declare. * files.c (struct file_hash_entry) <location>: New field. (_cpp_find_file): Initialize new field. (make_cpp_dir): Likewise. (cpp_included_before): New function. From-SVN: r130093
2007-11-11* de.po, zh_CN.po: Update.Joseph Myers3-31/+27
From-SVN: r130084
2007-11-10be.po, [...]: Update.Joseph Myers16-2544/+3024
* be.po, ca.po, da.po, de.po, el.po, es.po, fr.po, ja.po, nl.po, sv.po, tr.po, uk,po, vi.po, zh_CN.po, zh_TW.po: Update. From-SVN: r130075
2007-11-08* cpplib.pot: Regenerate.Joseph Myers2-150/+190
From-SVN: r130027
2007-11-01re PR preprocessor/30805 (Internal compiler error when using ↵Tom Tromey2-3/+13
"x##,##__VA_ARGS__" in macro) libcpp PR preprocessor/30805: * macro.c (paste_tokens): Handle padding token. (paste_tokens): Don't abort unless padding has PASTE_LEFT flag. gcc/testsuite PR preprocessor/30805: * gcc.dg/cpp/pr30805.c: New file. From-SVN: r129827
2007-10-31re PR preprocessor/30786 (ICE on _Pragma at end of file)Tom Tromey4-11/+30
gcc/testsuite PR preprocessor/30786: * gcc.dg/cpp/pr30786.c: New file. libcpp PR preprocessor/30786: * macro.c (builtin_macro): Return result of _cpp_do__Pragma. * directives.c (_cpp_do__Pragma): Return error status. * internal.h (_cpp_do__Pragma): Update. * directives.c (get__Pragma_string): Back up if EOF seen. From-SVN: r129800
2007-10-21* es.po, vi.po: Update.Joseph Myers3-5/+9
From-SVN: r129537
2007-10-10be.po, [...]: Update.Joseph Myers16-34/+38
* be.po, ca.po, da.po, de.po, el.po, es.po, fr.po, ja.po, nl.po, sv.po, tr.po, uk,po, vi.po, zh_CN.po, zh_TW.po: Update. From-SVN: r129206
2007-09-06tree-cfg.c (remove_bb): Only warn if line is non-zero.Tom Tromey8-10/+98
gcc: * tree-cfg.c (remove_bb): Only warn if line is non-zero. * c-pch.c (c_common_read_pch): Restore current location after reading PCH file. * tree.c (expand_location): Update. (expr_filename): Changed return type. Unified the two cases. (expr_lineno): Likewise. (annotate_with_file_line): Don't use EXPR_LINENO and EXPR_FILENAME as lvalues. * toplev.c (line_table): Changed type. (general_init): Update. (realloc_for_line_map): New function. (general_init): Allocate line_table using GC. * fix-header.c (line_table): Changed type. (read_scan_file): Update. (read_scan_file): Update. * c-ppoutput.c (maybe_print_line): Update. (print_line): Update. (cb_line_change): Update. (cb_define): Update. (pp_file_change): Update. * c-opts.c (c_common_init_options): Update. (finish_options): Update. (push_command_line_include): Update. * c-lex.c (cb_line_change): Update. (cb_def_pragma): Update. (cb_define): Update. (cb_undef): Update. (c_lex_with_flags): Use cpp_get_token_with_location. * input.h (line_table): Changed type. (location_from_locus): New macro. * tree.h (EXPR_FILENAME): No longer an lvalue. (EXPR_LINENO): Likewise. (expr_locus, set_expr_locus): Declare separately for USE_MAPPED_LOCATION. (expr_filename, expr_lineno): Changed return type. * gimplify.c (tree_to_gimple_tuple): Use SET_EXPR_LOCUS. * cfgexpand.c (expand_gimple_cond_expr): Use location_from_locus. (expand_gimple_basic_block): Likewise. * final.c (final_scan_insn): Use expanded_location. gcc/cp: * decl.c (finish_function): Put return's location on line zero of file. gcc/fortran: * scanner.c (get_file): Update. (load_file): Update. (gfc_next_char_literal): Use gfc_linebuf_linenum. * f95-lang.c (gfc_init): Update. * gfortran.h (gfc_linebuf_linenum): New macro. gcc/java: * lang.c (java_post_options): Update. * jcf-parse.c (set_source_filename): Update. (give_name_to_class): Update. (jcf_parse): Update. (duplicate_class_warning): Update. (parse_class_file): Update. (java_parse_file): Update. * expr.c (expand_byte_code): Update. gcc/testsuite: * lib/g++.exp (g++_target_compile): Use -fno-show-column. gcc/treelang: * tree1.c (treelang_init): Update. (treelang_parse_file): Update. (treelang_parse_file): Update. (treelang_parse_file): Update. * lex.l: Update. (update_lineno_charno): Likewise. libcpp: * internal.h (struct cpp_reader) <invocation_location>: New field. (struct cpp_reader) <set_invocation_location>: Likewise. * init.c (cpp_set_line_map): New function. * line-map.c (linemap_add): Use linemap's allocator. * include/line-map.h (GTY): Define. (line_map_realloc): New typedef. (struct line_map): Mark with GTY. (struct line_maps): Likewise. (struct line_maps) <maps>: Likewise. (struct line_maps) <reallocator>: New field. * include/symtab.h (GTY): Conditionally define. * include/cpplib.h (cpp_set_line_map): Declare. (cpp_get_token_with_location): Declare. * macro.c (cpp_get_token): Set invocation_location on the reader. (cpp_get_token_with_location): New function. From-SVN: r128190
2007-08-30expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur, ulr, ullr, ↵Chao-ying Fu3-4/+80
hk, k, lk, llk, uhk, uk, ulk, ullk. * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur, ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk. (cpp_classify_number): Support decimal fixed-point constants without exponents. Warn about fixed-point constants when -pedantic. * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change comments to support fixed-point values. (CPP_N_FRACT, CPP_N_ACCUM): Define. From-SVN: r127940
2007-08-21be.po, [...]: Update.Joseph Myers16-25/+906
* be.po, ca.po, da.po, de.po, el.po, es.po, fr.po, ja.po, nl.po, sv.po, tr.po, vi.po, zh_CN.po, zh_TW.po: Update. * uk.po: New. From-SVN: r127664
2007-08-18re PR preprocessor/32974 (#pragma GCC dependency generates extra token error.)Tom Tromey2-1/+11
gcc/testsuite PR preprocessor/32974: * gcc.dg/cpp/pr32974.c: New file. libcpp PR preprocessor/32974: * directives.c (parse_include): Don't check for EOL when processing #pragma dependency. From-SVN: r127614
2007-07-30directives-only.c: New file.Ollie Wild9-17/+313
libcpp/ * directives-only.c: New file. * internal.h (struct _cpp_dir_only_callbacks): New. (_cpp_preprocess_dir_only): New function. * directives.c (_cpp_handle_directive): Check directives_only before disabling execution of indented directives. * files.c (_cpp_stack_file): Add directives_only check. * include/cpplib.h (struct cpp_options): Add directives_only. (cpp_init_special_builtins): New function. * init.c (cpp_init_special_builtins): New function. (cpp_init_builtins): Move builtin_array initialization to cpp_init_special_builtins. (post_options): Check directives_only before setting pfile->state.prevent_expansion = 1. * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__ is expanded inside a directive while -fdirectives-only is enabled. * Makefile.in (libcpp_a_OBJS): Add directives-only.o. (libcpp_a_SOURCES): Add directives-only.c. gcc/ * c-ppoutput.c (print_lines_directives_only): New function. (scan_translation_unit_directives_only): New function. (preprocess_file): Add call to scan_translation_unit_directives_only. * c-opts.c (c_common_handle_option): Add OPT_fdirectives_only. (sanitize_cpp_opts): Add default flag_dump_macros setting for -fdirectives-only. Add errors for -fdirectives-only conflict with -Wunused-macros and -traditional. (finish_options): Add builtin macro initialization for -fdirectives-only + -fpreprocessed. * c.opt (fdirectives-only): New. * doc/cppopts.texi (fdirectives-only): New. gcc/testsuite/ * gcc.dg/cpp/counter-2.c: New test. * gcc.dg/cpp/counter-3.c: New test. * gcc.dg/cpp/dir-only-1.c: New test. * gcc.dg/cpp/dir-only-1.h: New file. * gcc.dg/cpp/dir-only-2.c: New test. * gcc.dg/cpp/dir-only-3.c: New test. * gcc.dg/cpp/dir-only-3a.h: New file. * gcc.dg/cpp/dir-only-3b.h: New file. * gcc.dg/cpp/dir-only-4.c: New test. * gcc.dg/cpp/dir-only-5.c: New test. * gcc.dg/cpp/dir-only-6.c: New test. From-SVN: r127066
2007-07-04traditional.c (_cpp_scan_out_logical_line): Initialize fmacro.args...Uros Bizjak2-1/+12
* traditional.c (_cpp_scan_out_logical_line): Initialize fmacro.args, fmacro.node, fmacro.offset, fmacro.line and fmacro.args to prevent 'may be used uninitialized' warning. From-SVN: r126311
2007-07-03cpplib.h (CPP_N_WIDTH_MD, [...]): Add new constants.Uros Bizjak3-3/+29
libcpp/ChangeLog: * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q): Add new constants. * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q' suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q for 'q' or 'Q' suffixes. gcc/ChangeLog: * targhooks.h (default_mode_for_suffix): New function declaration. * targhooks.c (default_mode_for_suffix): New default target hook. * target.h (struct c): New structure in the targetm struct. (mode_for_suffix): New target hook as part of struct c. target-def.h (TARGET_C_MODE_FOR_SUFFIX): Define as default_mode_for_suffix. (TARGET_C): New define. * c-lex.c: Include "target.h". (interpret_float): Use targetm.c.mode_for_suffix to determine the mode for a given non-standard suffix. Makefile.in (c-lex.o): Depend on $(TARGET_H). * config/i386/i386.c (ix86_c_mode_for_suffix): New static function. (TARGET_C_MODE_FOR_SUFFIX): Define to ix86_c_mode_for_suffix. * doc/extend.texi (Floating Types): New node. Document __float80 and __float128 types. Document 'w', 'W', 'q' and 'Q' suffixes. testsuite/ChangeLog: * gcc.dg/const-float80.c : New test. * gcc.dg/const-float128.c : New test. * gcc.dg/const-float80-ped.c : New test. * gcc.dg/const-float128-ped.c : New test. From-SVN: r126244
2007-06-26be.po, [...]: Update.Joseph Myers16-1944/+2344
* be.po, ca.po, da.po, de.po, el.po, es.po, fr.po, ja.po, nl.po, rw.po, sv.po, tr.po, vi.po, zh_CN.po, zh_TW.po: Update. From-SVN: r126041
2007-06-17Correct filename of files.c in recent Changelog entries.Danny Smith1-3/+3
From-SVN: r125779
2007-06-17cppfiles.c (open_file): Correct typo.Danny Smith2-2/+6
* cppfiles.c (open_file): Correct typo. From-SVN: r125778
2007-06-16cppfiles.c (open_file): Prevent the call for stat from overwriting errno.Vladimir Prus2-0/+8
* cppfiles.c (open_file): Prevent the call for stat from overwriting errno. From-SVN: r125757
2007-06-09cppfiles.c (open_file): Account for the fact that on windows, opening a ↵Vladimir Prus2-0/+19
directory gives EACCES. * cppfiles.c (open_file): Account for the fact that on windows, opening a directory gives EACCES. From-SVN: r125590
2007-06-05re PR preprocessor/23479 (Implement binary constants with a "0b" prefix)Joerg Wunsch3-3/+53
2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> PR preprocessor/23479 gcc/ * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. libcpp/ * expr.c (cpp_classify_number): Implement 0b-prefixed binary integer constants. (append_digit): Likewise. * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed binary integer constants. testsuite/ * testsuite/gcc.dg/binary-constants-1.c: Add test suites for the 0b-prefixed binary integer constants. * testsuite/gcc.dg/binary-constants-2.c: Ditto. * testsuite/gcc.dg/binary-constants-3.c: Ditto. * testsuite/gcc.dg/binary-constants-4.c: Ditto. From-SVN: r125346
2007-06-01Fixup whitespacingMike Stump1-39/+39
From-SVN: r125255
2007-05-31re PR preprocessor/14331 (please add option to suppress warning message "no ↵Dave Korn2-4/+6
newline at end of file") 2007-05-31 Dave Korn <dave.korn@artimi.com> PR preprocessor/14331 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF. From-SVN: r125212
2007-05-24macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.Ollie Wild6-1/+62
* macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER. * pch.c (cpp_write_pch_deps): Save __COUNTER__ state. (cpp_write_pch_state): Save __COUNTER__ state. (cpp_valid_state): Check valid __COUNTER__ state. (cpp_read_state): Read new __COUNTER__ state. * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator. * init.c (builtin_array): Add __COUNTER__/BT_COUNTER. * internal.h (struct cpp_reader): Add counter member. * gcc.dg/cpp/counter-1.c: New test. * gcc.dg/pch/counter-1.c: New test. * gcc.dg/pch/counter-1.hs: New file. * gcc.dg/pch/counter-2.c: New test. * gcc.dg/pch/counter-2.hs: New file. * gcc.dg/pch/counter-3.c: New test. * gcc.dg/pch/counter-3.hs: New file. * doc/cpp.texi (Common Predefined Macros): Add __COUNTER__ description. From-SVN: r125041
2007-05-23re PR preprocessor/20077 (GCC accepts macro definitions that fail a constraint)Simon Martin2-8/+26
2007-05-23 Simon Martin <simartin@users.sourceforge.net> PR preprocessor/20077 * macro.c (create_iso_definition): Fixed the method to determine whether the token-pasting operator appears at the beginning or the end of a macro. From-SVN: r125000
2007-05-21internal.h (struct cpp_reader): Add new fields: nonexistent_file_hash and ↵Ian Lance Taylor3-4/+93
nonexistent_file_ob. * internal.h (struct cpp_reader): Add new fields: nonexistent_file_hash and nonexistent_file_ob. * files.c: Include "obstack.h". (find_file_in_dir): Before trying to open the file, look up the path name in the hash table of nonexistent files. After failing to open the file, add the path name to the hash table. (_cpp_find_file): Cache the results of looking up the file name starting with the quote and bracket chain heads, if we can. (nonexistent_file_hash_eq): New static function. (_cpp_init_files): Initialize pfile->nonexistent_file_hash and pfile->nonexistent_file_ob. (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and pfile->nonexistent_file_ob. From-SVN: r124929
2007-05-14expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.Janis Johnson2-0/+6
libcpp/ * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic. gcc/testsuite/ * gcc.dg/fltconst-pedantic-dfp.c: New test. From-SVN: r124731
2007-05-14re PR c/31924 (gcc accepts invalid suffixes for decimal float constants)Janis Johnson2-8/+16
libcpp/ PR c/31924 * expr.c (interpret_float_suffix): Check for invalid suffix. gcc/testsuite/ PR c/31924 * gcc.dg/fltconst-1.c: New test. From-SVN: r124730
2007-05-02if-div.c: New file.Eric Christopher2-3/+9
2007-05-02 Eric Christopher <echristo@apple.com> * gcc.dg/cpp/if-div.c: New file. 2007-05-02 Eric Christopher <echristo@apple.com> * expr.c (num_div_op): Don't overflow if the result is zero. From-SVN: r124358
2007-05-02re PR preprocessor/28709 (Bad diagnostic pasting tokens with ##)Tom Tromey2-6/+20
libcpp PR preprocessor/28709: * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs. gcc/testsuite PR preprocessor/28709: * gcc.dg/cpp/pr28709.c: New file. From-SVN: r124356
2007-03-30make alloca call type correctMichael Meissner2-1/+6
From-SVN: r123374
2007-03-30directives.c (lex_macro_node_from_str): New.Richard Henderson3-0/+68
libcpp/ * directives.c (lex_macro_node_from_str): New. (cpp_push_definition, cpp_pop_definition): New. * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare. gcc/ * c-pragma.c (struct def_pragma_macro_value): New. (struct def_pragma_macro): New. (pushed_macro_table): New. (dpm_hash, dpm_eq): New. (handle_pragma_push_macro, handle_pragma_pop_macro): New. (init_pragma): Install them. * doc/tm.texi (HANDLE_PRAGMA_PUSH_POP_MACRO): New. Co-Authored-By: Kai Tietz <kai.tietz@onevision.com> From-SVN: r123370
2007-03-07* cpplib.pot: Regenerate.Joseph Myers2-108/+112
From-SVN: r122666
2007-03-01* Makefile.in: Add dummy install-pdf target.Brooks Moses2-0/+5
From-SVN: r122445
2007-01-30re PR preprocessor/30468 (-M not fully chops dirname)Tom Tromey2-2/+14
PR preprocessor/30468: * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped './'. From-SVN: r121341
2007-01-30re PR preprocessor/29966 (crash in cc1 with backtrace from free())Tom Tromey3-9/+19
PR preprocessor/29966: * macro.c (lex_expansion_token): Save and restore cpp_reader's cur_token. (_cpp_create_definition): Don't restore cur_token here. * lex.c (_cpp_lex_token): Added assertion. From-SVN: r121340
2007-01-27depstand.m4 (ZW_CREATE_DEPDIR): Use mkinstalldirs to make directory.Tom Tromey2-2/+6
config 2007-01-27 Paolo Bonzini <bonzini@gnu.org> * depstand.m4 (ZW_CREATE_DEPDIR): Use mkinstalldirs to make directory. libcpp * configure: Rebuilt. From-SVN: r121237
2007-01-12re PR preprocessor/28227 (valid #ifdef rejected)Tom Tromey2-8/+20
libcpp PR preprocessor/28227: * directives.c (lex_macro_node): Added 'is_def_or_undef' argument. (do_define): Update. (do_undef): Update. (do_ifdef): Update. (do_ifndef): Update. gcc/testsuite PR preprocessor/28227: * gcc.dg/cpp/pr28227.c: New file. From-SVN: r120731
2007-01-11warnings.m4: Use m4_expand_once to clear the AC_SUBST'ed variable.Paolo Bonzini2-1/+6
config: 2007-01-11 Paolo Bonzini <bonzini@gnu.org> * warnings.m4: Use m4_expand_once to clear the AC_SUBST'ed variable. (ACX_PROG_CC_WARNINGS_ARE_ERRORS): Fix typo. Add optional 2nd argument. libcpp: 2007-01-11 Paolo Bonzini <bonzini@gnu.org> * configure: Regenerate. From-SVN: r120675
2007-01-11warnings.m4: Add second parameter with name of variable.Paolo Bonzini2-1/+5
config: 2007-01-11 Paolo Bonzini <bonzini@gnu.org> * config/warnings.m4: Add second parameter with name of variable. Always append to the variable if it exists. libcpp: 2007-01-11 Paolo Bonzini <bonzini@gnu.org> * configure: Regenerate. From-SVN: r120673