diff options
author | Yiran Wang <yiran@google.com> | 2015-06-23 15:33:17 -0700 |
---|---|---|
committer | Yiran Wang <yiran@google.com> | 2015-06-29 10:56:28 -0700 |
commit | 1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch) | |
tree | 3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/libcpp | |
parent | f378ebf14df0952eae870c9865bab8326aa8f137 (diff) | |
download | toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2 toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip |
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/libcpp')
-rw-r--r-- | gcc-4.9/libcpp/ChangeLog | 40 | ||||
-rw-r--r-- | gcc-4.9/libcpp/directives.c | 14 | ||||
-rw-r--r-- | gcc-4.9/libcpp/expr.c | 75 | ||||
-rw-r--r-- | gcc-4.9/libcpp/files.c | 18 | ||||
-rw-r--r-- | gcc-4.9/libcpp/identifiers.c | 2 | ||||
-rw-r--r-- | gcc-4.9/libcpp/internal.h | 8 | ||||
-rw-r--r-- | gcc-4.9/libcpp/lex.c | 115 | ||||
-rw-r--r-- | gcc-4.9/libcpp/line-map.c | 10 | ||||
-rw-r--r-- | gcc-4.9/libcpp/pch.c | 2 | ||||
-rw-r--r-- | gcc-4.9/libcpp/po/ChangeLog | 8 | ||||
-rw-r--r-- | gcc-4.9/libcpp/po/ja.po | 27 | ||||
-rw-r--r-- | gcc-4.9/libcpp/traditional.c | 19 |
12 files changed, 301 insertions, 37 deletions
diff --git a/gcc-4.9/libcpp/ChangeLog b/gcc-4.9/libcpp/ChangeLog index 32bb84f94..47dc9a962 100644 --- a/gcc-4.9/libcpp/ChangeLog +++ b/gcc-4.9/libcpp/ChangeLog @@ -1,3 +1,43 @@ +2014-11-28 Jakub Jelinek <jakub@redhat.com> + + Backported from mainline + 2014-11-25 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/60436 + * line-map.c (linemap_line_start): If highest is above 0x60000000 + and we are still tracking columns or highest is above 0x70000000, + force add_map. + +2014-10-30 Release Manager + + * GCC 4.9.2 released. + +2014-10-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + Backport from mainline r215873 + 2014-10-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + * lex.c (search_line_fast): Add new version to be used for Power8 + and later targets when Altivec is enabled. Restrict the existing + Altivec version to big-endian systems so that lvsr is not used on + little endian, where it is deprecated. Remove LE-specific code + from the now-BE-only version. + +2014-10-08 Edward Smith-Rowland <3dw4rd@verizon.net> + + Implement SD-6: SG10 Feature Test Recommendations + * internal.h (lexer_state, spec_nodes): Add in__has_include__. + * directives.c: Support __has_include__ builtin. + * expr.c (parse_has_include): New function to parse __has_include__ + builtin; (eval_token()): Use it. + * files.c (_cpp_has_header()): New funtion to look for header; + (open_file_failed()): Not an error to not find a header file for + __has_include__. + * identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__. + * pch.c (cpp_read_state): Lookup __has_include__. + * traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through + __has_include__ statements. + 2014-07-16 Release Manager * GCC 4.9.1 released. diff --git a/gcc-4.9/libcpp/directives.c b/gcc-4.9/libcpp/directives.c index 3486a48d2..22a034dd2 100644 --- a/gcc-4.9/libcpp/directives.c +++ b/gcc-4.9/libcpp/directives.c @@ -549,6 +549,11 @@ lex_macro_node (cpp_reader *pfile, bool is_def_or_undef) if (is_def_or_undef && node == pfile->spec_nodes.n_defined) cpp_error (pfile, CPP_DL_ERROR, "\"defined\" cannot be used as a macro name"); + else if (is_def_or_undef + && (node == pfile->spec_nodes.n__has_include__ + || node == pfile->spec_nodes.n__has_include_next__)) + cpp_error (pfile, CPP_DL_ERROR, + "\"__has_include__\" cannot be used as a macro name"); else if (! (node->flags & NODE_POISONED)) return node; } @@ -2601,3 +2606,12 @@ _cpp_init_directives (cpp_reader *pfile) node->directive_index = i; } } + +/* Extract header file from a bracket include. Parsing starts after '<'. + The string is malloced and must be freed by the caller. */ +char * +_cpp_bracket_include(cpp_reader *pfile) +{ + return glue_header_name (pfile); +} + diff --git a/gcc-4.9/libcpp/expr.c b/gcc-4.9/libcpp/expr.c index 147bd97c5..29cb0fa51 100644 --- a/gcc-4.9/libcpp/expr.c +++ b/gcc-4.9/libcpp/expr.c @@ -64,6 +64,8 @@ static unsigned int interpret_float_suffix (cpp_reader *, const uchar *, size_t) static unsigned int interpret_int_suffix (cpp_reader *, const uchar *, size_t); static void check_promotion (cpp_reader *, const struct op *); +static cpp_num parse_has_include (cpp_reader *, enum include_type); + /* Token type abuse to create unary plus and minus operators. */ #define CPP_UPLUS ((enum cpp_ttype) (CPP_LAST_CPP_OP + 1)) #define CPP_UMINUS ((enum cpp_ttype) (CPP_LAST_CPP_OP + 2)) @@ -1041,6 +1043,10 @@ eval_token (cpp_reader *pfile, const cpp_token *token, case CPP_NAME: if (token->val.node.node == pfile->spec_nodes.n_defined) return parse_defined (pfile); + else if (token->val.node.node == pfile->spec_nodes.n__has_include__) + return parse_has_include (pfile, IT_INCLUDE); + else if (token->val.node.node == pfile->spec_nodes.n__has_include_next__) + return parse_has_include (pfile, IT_INCLUDE_NEXT); else if (CPP_OPTION (pfile, cplusplus) && (token->val.node.node == pfile->spec_nodes.n_true || token->val.node.node == pfile->spec_nodes.n_false)) @@ -2065,3 +2071,72 @@ num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op, return lhs; } + +/* Handle meeting "__has_include__" in a preprocessor expression. */ +static cpp_num +parse_has_include (cpp_reader *pfile, enum include_type type) +{ + cpp_num result; + bool paren = false; + cpp_hashnode *node = 0; + const cpp_token *token; + bool bracket = false; + char *fname = 0; + + result.unsignedp = false; + result.high = 0; + result.overflow = false; + result.low = 0; + + pfile->state.in__has_include__++; + + token = cpp_get_token (pfile); + if (token->type == CPP_OPEN_PAREN) + { + paren = true; + token = cpp_get_token (pfile); + } + + if (token->type == CPP_STRING || token->type == CPP_HEADER_NAME) + { + if (token->type == CPP_HEADER_NAME) + bracket = true; + fname = XNEWVEC (char, token->val.str.len - 1); + memcpy (fname, token->val.str.text + 1, token->val.str.len - 2); + fname[token->val.str.len - 2] = '\0'; + node = token->val.node.node; + } + else if (token->type == CPP_LESS) + { + bracket = true; + fname = _cpp_bracket_include (pfile); + } + else + cpp_error (pfile, CPP_DL_ERROR, + "operator \"__has_include__\" requires a header string"); + + if (fname) + { + int angle_brackets = (bracket ? 1 : 0); + + if (_cpp_has_header (pfile, fname, angle_brackets, type)) + result.low = 1; + else + result.low = 0; + + XDELETEVEC (fname); + } + + if (paren && cpp_get_token (pfile)->type != CPP_CLOSE_PAREN) + cpp_error (pfile, CPP_DL_ERROR, + "missing ')' after \"__has_include__\""); + + /* A possible controlling macro of the form #if !__has_include__ (). + _cpp_parse_expr checks there was no other junk on the line. */ + if (node) + pfile->mi_ind_cmacro = node; + + pfile->state.in__has_include__--; + + return result; +} diff --git a/gcc-4.9/libcpp/files.c b/gcc-4.9/libcpp/files.c index 7e8877854..149f06df2 100644 --- a/gcc-4.9/libcpp/files.c +++ b/gcc-4.9/libcpp/files.c @@ -1023,6 +1023,9 @@ open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets) int sysp = pfile->line_table->highest_line > 1 && pfile->buffer ? pfile->buffer->sysp : 0; bool print_dep = CPP_OPTION (pfile, deps.style) > (angle_brackets || !!sysp); + if (pfile->state.in__has_include__) + return; + errno = file->err_no; if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT) { @@ -1939,3 +1942,18 @@ check_file_against_entries (cpp_reader *pfile ATTRIBUTE_UNUSED, return bsearch (&d, pchf->entries, pchf->count, sizeof (struct pchf_entry), pchf_compare) != NULL; } + +/* Return true if the file FNAME is found in the appropriate include file path + as indicated by ANGLE_BRACKETS. */ + +bool +_cpp_has_header (cpp_reader *pfile, const char *fname, int angle_brackets, + enum include_type type) +{ + cpp_dir *start_dir = search_path_head (pfile, fname, angle_brackets, type); + _cpp_file *file = _cpp_find_file (pfile, fname, start_dir, + /*fake=*/false, angle_brackets, + /*implicit_preinclude=*/false); + return file->err_no != ENOENT; +} + diff --git a/gcc-4.9/libcpp/identifiers.c b/gcc-4.9/libcpp/identifiers.c index cfb9979a6..8fba8c004 100644 --- a/gcc-4.9/libcpp/identifiers.c +++ b/gcc-4.9/libcpp/identifiers.c @@ -72,6 +72,8 @@ _cpp_init_hashtable (cpp_reader *pfile, cpp_hash_table *table) s->n_false = cpp_lookup (pfile, DSC("false")); s->n__VA_ARGS__ = cpp_lookup (pfile, DSC("__VA_ARGS__")); s->n__VA_ARGS__->flags |= NODE_DIAGNOSTIC; + s->n__has_include__ = cpp_lookup (pfile, DSC("__has_include__")); + s->n__has_include_next__ = cpp_lookup (pfile, DSC("__has_include_next__")); } /* Tear down the identifier hash table. */ diff --git a/gcc-4.9/libcpp/internal.h b/gcc-4.9/libcpp/internal.h index b5106211c..602a5035a 100644 --- a/gcc-4.9/libcpp/internal.h +++ b/gcc-4.9/libcpp/internal.h @@ -258,6 +258,9 @@ struct lexer_state /* Nonzero when parsing arguments to a function-like macro. */ unsigned char parsing_args; + /* Nonzero if in a __has_include__ or __has_include_next__ statement. */ + unsigned char in__has_include__; + /* Nonzero if prevent_expansion is true only because output is being discarded. */ unsigned char discarding_output; @@ -279,6 +282,8 @@ struct spec_nodes cpp_hashnode *n_true; /* C++ keyword true */ cpp_hashnode *n_false; /* C++ keyword false */ cpp_hashnode *n__VA_ARGS__; /* C99 vararg macros */ + cpp_hashnode *n__has_include__; /* __has_include__ operator */ + cpp_hashnode *n__has_include_next__; /* __has_include_next__ operator */ }; typedef struct _cpp_line_note _cpp_line_note; @@ -645,6 +650,8 @@ extern bool _cpp_save_file_entries (cpp_reader *pfile, FILE *f); extern bool _cpp_read_file_entries (cpp_reader *, FILE *); extern const char *_cpp_get_file_name (_cpp_file *); extern struct stat *_cpp_get_file_stat (_cpp_file *); +extern bool _cpp_has_header (cpp_reader *, const char *, int, + enum include_type); /* In expr.c */ extern bool _cpp_parse_expr (cpp_reader *, bool); @@ -680,6 +687,7 @@ extern void _cpp_init_internal_pragmas (cpp_reader *); extern void _cpp_do_file_change (cpp_reader *, enum lc_reason, const char *, linenum_type, unsigned int); extern void _cpp_pop_buffer (cpp_reader *); +extern char *_cpp_bracket_include (cpp_reader *); /* In directives.c */ struct _cpp_dir_only_callbacks diff --git a/gcc-4.9/libcpp/lex.c b/gcc-4.9/libcpp/lex.c index 6d69b591f..ec07c6e65 100644 --- a/gcc-4.9/libcpp/lex.c +++ b/gcc-4.9/libcpp/lex.c @@ -515,9 +515,111 @@ init_vectorized_lexer (void) search_line_fast = impl; } -#elif (GCC_VERSION >= 4005) && defined(__ALTIVEC__) +#elif defined(_ARCH_PWR8) && defined(__ALTIVEC__) -/* A vection of the fast scanner using AltiVec vectorized byte compares. */ +/* A vection of the fast scanner using AltiVec vectorized byte compares + and VSX unaligned loads (when VSX is available). This is otherwise + the same as the pre-GCC 5 version. */ + +static const uchar * +search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) +{ + typedef __attribute__((altivec(vector))) unsigned char vc; + + const vc repl_nl = { + '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n', + '\n', '\n', '\n', '\n', '\n', '\n', '\n', '\n' + }; + const vc repl_cr = { + '\r', '\r', '\r', '\r', '\r', '\r', '\r', '\r', + '\r', '\r', '\r', '\r', '\r', '\r', '\r', '\r' + }; + const vc repl_bs = { + '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', + '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' + }; + const vc repl_qm = { + '?', '?', '?', '?', '?', '?', '?', '?', + '?', '?', '?', '?', '?', '?', '?', '?', + }; + const vc zero = { 0 }; + + vc data, t; + + /* Main loop processing 16 bytes at a time. */ + do + { + vc m_nl, m_cr, m_bs, m_qm; + + data = *((const vc *)s); + s += 16; + + m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl); + m_cr = (vc) __builtin_vec_cmpeq(data, repl_cr); + m_bs = (vc) __builtin_vec_cmpeq(data, repl_bs); + m_qm = (vc) __builtin_vec_cmpeq(data, repl_qm); + t = (m_nl | m_cr) | (m_bs | m_qm); + + /* T now contains 0xff in bytes for which we matched one of the relevant + characters. We want to exit the loop if any byte in T is non-zero. + Below is the expansion of vec_any_ne(t, zero). */ + } + while (!__builtin_vec_vcmpeq_p(/*__CR6_LT_REV*/3, t, zero)); + + /* Restore s to to point to the 16 bytes we just processed. */ + s -= 16; + + { +#define N (sizeof(vc) / sizeof(long)) + + union { + vc v; + /* Statically assert that N is 2 or 4. */ + unsigned long l[(N == 2 || N == 4) ? N : -1]; + } u; + unsigned long l, i = 0; + + u.v = t; + + /* Find the first word of T that is non-zero. */ + switch (N) + { + case 4: + l = u.l[i++]; + if (l != 0) + break; + s += sizeof(unsigned long); + l = u.l[i++]; + if (l != 0) + break; + s += sizeof(unsigned long); + case 2: + l = u.l[i++]; + if (l != 0) + break; + s += sizeof(unsigned long); + l = u.l[i]; + } + + /* L now contains 0xff in bytes for which we matched one of the + relevant characters. We can find the byte index by finding + its bit index and dividing by 8. */ +#ifdef __BIG_ENDIAN__ + l = __builtin_clzl(l) >> 3; +#else + l = __builtin_ctzl(l) >> 3; +#endif + return s + l; + +#undef N + } +} + +#elif (GCC_VERSION >= 4005) && defined(__ALTIVEC__) && defined (__BIG_ENDIAN__) + +/* A vection of the fast scanner using AltiVec vectorized byte compares. + This cannot be used for little endian because vec_lvsl/lvsr are + deprecated for little endian and the code won't work properly. */ /* ??? Unfortunately, attribute(target("altivec")) is not yet supported, so we can't compile this function without -maltivec on the command line (or implied by some other switch). */ @@ -559,13 +661,8 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) beginning with all ones and shifting in zeros according to the mis-alignment. The LVSR instruction pulls the exact shift we want from the address. */ -#ifdef __BIG_ENDIAN__ mask = __builtin_vec_lvsr(0, s); mask = __builtin_vec_perm(zero, ones, mask); -#else - mask = __builtin_vec_lvsl(0, s); - mask = __builtin_vec_perm(ones, zero, mask); -#endif data &= mask; /* While altivec loads mask addresses, we still need to align S so @@ -629,11 +726,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED) /* L now contains 0xff in bytes for which we matched one of the relevant characters. We can find the byte index by finding its bit index and dividing by 8. */ -#ifdef __BIG_ENDIAN__ l = __builtin_clzl(l) >> 3; -#else - l = __builtin_ctzl(l) >> 3; -#endif return s + l; #undef N diff --git a/gcc-4.9/libcpp/line-map.c b/gcc-4.9/libcpp/line-map.c index f9a7658cb..78c43933d 100644 --- a/gcc-4.9/libcpp/line-map.c +++ b/gcc-4.9/libcpp/line-map.c @@ -527,10 +527,10 @@ linemap_line_start (struct line_maps *set, linenum_type to_line, && line_delta * ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) > 1000) || (max_column_hint >= (1U << ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map))) || (max_column_hint <= 80 - && ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) >= 10)) - { - add_map = true; - } + && ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) >= 10) + || (highest > 0x60000000 + && (set->max_column_hint || highest > 0x70000000))) + add_map = true; else max_column_hint = set->max_column_hint; if (add_map) @@ -541,7 +541,7 @@ linemap_line_start (struct line_maps *set, linenum_type to_line, /* If the column number is ridiculous or we've allocated a huge number of source_locations, give up on column numbers. */ max_column_hint = 0; - if (highest >0x70000000) + if (highest > 0x70000000) return 0; column_bits = 0; } diff --git a/gcc-4.9/libcpp/pch.c b/gcc-4.9/libcpp/pch.c index cddca837f..3ff39d7ef 100644 --- a/gcc-4.9/libcpp/pch.c +++ b/gcc-4.9/libcpp/pch.c @@ -833,6 +833,8 @@ cpp_read_state (cpp_reader *r, const char *name, FILE *f, s->n_true = cpp_lookup (r, DSC("true")); s->n_false = cpp_lookup (r, DSC("false")); s->n__VA_ARGS__ = cpp_lookup (r, DSC("__VA_ARGS__")); + s->n__has_include__ = cpp_lookup (r, DSC("__has_include__")); + s->n__has_include_next__ = cpp_lookup (r, DSC("__has_include_next__")); } old_state = r->state; diff --git a/gcc-4.9/libcpp/po/ChangeLog b/gcc-4.9/libcpp/po/ChangeLog index b9f60389e..db8d31264 100644 --- a/gcc-4.9/libcpp/po/ChangeLog +++ b/gcc-4.9/libcpp/po/ChangeLog @@ -1,3 +1,11 @@ +2014-11-07 Joseph Myers <joseph@codesourcery.com> + + * ja.po: Update. + +2014-10-30 Release Manager + + * GCC 4.9.2 released. + 2014-07-16 Release Manager * GCC 4.9.1 released. diff --git a/gcc-4.9/libcpp/po/ja.po b/gcc-4.9/libcpp/po/ja.po index cb2c95e1c..2c48c2c77 100644 --- a/gcc-4.9/libcpp/po/ja.po +++ b/gcc-4.9/libcpp/po/ja.po @@ -4,22 +4,21 @@ # Daisuke Yamashita <yamad@mb.infoweb.ne.jp>, 1999-2001 # Masahito Yamaga <yamaga@ipc.chiba-u.ac.jp>, 1999. # IIDA Yosiaki <iida@secom.ne.jp>, 1999. -# Yasuaki Taniguchi <yasuakit@gmail.com>, 2010, 2011. # Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>, 2012, 2013 +# Yasuaki Taniguchi <yasuakit@gmail.com>, 2010, 2011, 2014. msgid "" msgstr "" -"Project-Id-Version: cpplib 4.8-b20130224\n" +"Project-Id-Version: cpplib 4.9-b20140202\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" "POT-Creation-Date: 2014-02-02 17:35+0000\n" -"PO-Revision-Date: 2013-03-04 18:01+0900\n" -"Last-Translator: Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>\n" +"PO-Revision-Date: 2014-11-07 08:19+0000\n" +"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n" "Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 1.5.4\n" #: charset.c:673 #, c-format @@ -456,10 +455,8 @@ msgid "invalid suffix \"%.*s\" on integer constant" msgstr "整数定数に無効な接尾辞 \"%.*s\" があります" #: expr.c:667 -#, fuzzy -#| msgid "use of C++0x long long integer constant" msgid "use of C++11 long long integer constant" -msgstr "C++0x の long long 整数定数を使用しています" +msgstr "C++11 の long long 整数定数を使用しています" #: expr.c:668 msgid "use of C99 long long integer constant" @@ -470,10 +467,8 @@ msgid "imaginary constants are a GCC extension" msgstr "虚数定数は GCC 拡張です" #: expr.c:690 -#, fuzzy -#| msgid "binary constants are a GCC extension" msgid "binary constants are a C++1y feature or GCC extension" -msgstr "二進定数は GCC 拡張です" +msgstr "二進定数は C++1y の機能または GCC 拡張です" #: expr.c:787 msgid "integer constant is too large for its type" @@ -703,10 +698,8 @@ msgid "raw string delimiter longer than 16 characters" msgstr "生の文字列区切りが 16 文字より大きいです" #: lex.c:1558 -#, fuzzy -#| msgid "invalid character '%c' in raw string delimiter" msgid "invalid new-line in raw string delimiter" -msgstr "生の文字列区切り内に無効な文字 '%c' があります" +msgstr "生の文字列区切り内に無効な改行があります" #: lex.c:1562 #, c-format @@ -718,10 +711,8 @@ msgid "unterminated raw string" msgstr "終端されていない生の文字列です" #: lex.c:1654 lex.c:1783 -#, fuzzy -#| msgid "invalid suffix on literal; C++11 requires a space between literal and identifier" msgid "invalid suffix on literal; C++11 requires a space between literal and string macro" -msgstr "リテラルの接尾辞が無効です。C++11 では、リテラルと識別子の間にスペースを入れる必要があります。" +msgstr "リテラルの接尾辞が無効です。C++11 では、リテラルと文字列マクロの間にスペースを入れる必要があります。" #: lex.c:1765 msgid "null character(s) preserved in literal" @@ -762,7 +753,7 @@ msgstr "無効な組み込みマクロ \"%s\" です" #: macro.c:236 macro.c:333 #, c-format msgid "macro \"%s\" might prevent reproducible builds" -msgstr "" +msgstr "マクロ \"%s\" は再生性可能なビルドを阻害するかもしれません" #: macro.c:267 msgid "could not determine file timestamp" diff --git a/gcc-4.9/libcpp/traditional.c b/gcc-4.9/libcpp/traditional.c index b770db7ab..dfb53787a 100644 --- a/gcc-4.9/libcpp/traditional.c +++ b/gcc-4.9/libcpp/traditional.c @@ -74,7 +74,9 @@ enum ls {ls_none = 0, /* Normal state. */ ls_defined_close, /* Looking for ')' of defined(). */ ls_hash, /* After # in preprocessor conditional. */ ls_predicate, /* After the predicate, maybe paren? */ - ls_answer}; /* In answer to predicate. */ + ls_answer, /* In answer to predicate. */ + ls_has_include, /* After __has_include__. */ + ls_has_include_close}; /* Looking for ')' of __has_include__. */ /* Lexing TODO: Maybe handle space in escaped newlines. Stop lex.c from recognizing comments and directives during its lexing pass. */ @@ -524,6 +526,13 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) lex_state = ls_defined; continue; } + else if (pfile->state.in_expression + && (node == pfile->spec_nodes.n__has_include__ + || node == pfile->spec_nodes.n__has_include_next__)) + { + lex_state = ls_has_include; + continue; + } } break; @@ -547,6 +556,8 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) lex_state = ls_answer; else if (lex_state == ls_defined) lex_state = ls_defined_close; + else if (lex_state == ls_has_include) + lex_state = ls_has_include_close; } break; @@ -584,7 +595,8 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) goto new_context; } } - else if (lex_state == ls_answer || lex_state == ls_defined_close) + else if (lex_state == ls_answer || lex_state == ls_defined_close + || lex_state == ls_has_include_close) lex_state = ls_none; } break; @@ -665,7 +677,8 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) lex_state = ls_none; else if (lex_state == ls_hash || lex_state == ls_predicate - || lex_state == ls_defined) + || lex_state == ls_defined + || lex_state == ls_has_include) lex_state = ls_none; /* ls_answer and ls_defined_close keep going until ')'. */ |