summaryrefslogtreecommitdiffstats
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-27 02:01:10 +0000
committerechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-27 02:01:10 +0000
commitccb84981e8d4a7b18aac1f69858683b2dd712d8f (patch)
treee038a62a69bfb1693a9ec4eefdb706a3fe353e15 /gcc/c-lex.c
parentebe8d6b361a82c302a151247479b95c77dfd1659 (diff)
downloadppe42-gcc-ccb84981e8d4a7b18aac1f69858683b2dd712d8f.tar.gz
ppe42-gcc-ccb84981e8d4a7b18aac1f69858683b2dd712d8f.zip
2004-02-26 Eric Christopher <echristo@redhat.com>
* lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78548 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index cbd557346f9..3986b2771bb 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -54,6 +54,7 @@ static splay_tree file_info_tree;
int pending_lang_change; /* If we need to switch languages - C++ only */
int c_header_level; /* depth in C headers - C++ only */
+bool c_lex_string_translate = true; /* If we need to translate characters received. */
static tree interpret_integer (const cpp_token *, unsigned int);
static tree interpret_float (const cpp_token *, unsigned int);
@@ -308,7 +309,7 @@ get_nonpadding_token (void)
timevar_pop (TV_CPP);
return tok;
-}
+}
int
c_lex_with_flags (tree *value, unsigned char *cpp_flags)
@@ -675,7 +676,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (tok->type == CPP_WSTRING)
wide = true;
obstack_grow (&str_ob, &tok->val.str, sizeof (cpp_string));
-
+
tok = get_nonpadding_token ();
if (c_dialect_objc () && tok->type == CPP_ATSIGN)
{
@@ -693,7 +694,9 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (count > 1 && !objc_string && warn_traditional && !in_system_header)
warning ("traditional C rejects string constant concatenation");
- if (cpp_interpret_string (parse_in, strs, count, &istr, wide))
+ if ((c_lex_string_translate
+ ? cpp_interpret_string : cpp_interpret_string_notranslate)
+ (parse_in, strs, count, &istr, wide))
{
value = build_string (istr.len, (char *)istr.text);
free ((void *)istr.text);
OpenPOWER on IntegriCloud