aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c59
1 files changed, 55 insertions, 4 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 3986b2771bb..436396352da 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -41,6 +41,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm_p.h"
#include "splay-tree.h"
#include "debug.h"
+/* APPLE LOCAL AltiVec */
+#include "cpphash.h"
/* We may keep statistics about how long which files took to compile. */
static int header_time, body_time;
@@ -106,6 +108,24 @@ init_c_lex (void)
cb->define = cb_define;
cb->undef = cb_undef;
}
+
+ /* APPLE LOCAL begin Symbol Separation */
+ /* Set up call back routines. These routines are used when separate symbol
+ repositories are used. */
+ if (write_symbols != NO_DEBUG)
+ {
+ cb->restore_write_symbols = cb_restore_write_symbols;
+ cb->clear_write_symbols = cb_clear_write_symbols;
+ cb->is_builtin_identifier = cb_is_builtin_identifier;
+ cb->start_symbol_repository = cb_start_symbol_repository;
+ cb->end_symbol_repository = cb_end_symbol_repository;
+ if (flag_grepository)
+ {
+ cpp_options *options = cpp_get_options (parse_in);
+ options->use_ss = 1;
+ }
+ }
+ /* APPLE LOCAL end Symbol Separation */
}
struct c_fileinfo *
@@ -177,7 +197,8 @@ cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED,
{
/* Convert escapes in the string. */
cpp_string cstr = { 0, 0 };
- if (cpp_interpret_string (pfile, str, 1, &cstr, false))
+ /* APPLE LOCAL pascal strings */
+ if (cpp_interpret_string (pfile, str, 1, &cstr, false, false))
{
ASM_OUTPUT_IDENT (asm_out_file, (const char *) cstr.text);
free ((void *)cstr.text);
@@ -646,7 +667,8 @@ static enum cpp_ttype
lex_string (const cpp_token *tok, tree *valp, bool objc_string)
{
tree value;
- bool wide = false;
+ /* APPLE LOCAL pascal strings */
+ bool wide = false, pascal_p = false;
size_t count = 1;
struct obstack str_ob;
cpp_string istr;
@@ -658,6 +680,11 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (tok->type == CPP_WSTRING)
wide = true;
+ /* APPLE LOCAL begin pascal strings */
+ else if (CPP_OPTION (parse_in, pascal_strings)
+ && str.text[1] == '\\' && str.text[2] == 'p')
+ pascal_p = true;
+ /* APPLE LOCAL end pascal strings */
tok = get_nonpadding_token ();
if (c_dialect_objc () && tok->type == CPP_ATSIGN)
@@ -691,12 +718,18 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
/* We have read one more token than we want. */
_cpp_backup_tokens (parse_in, 1);
+ /* APPLE LOCAL begin pascal strings */
+ if (wide || objc_string)
+ pascal_p = false;
+ /* APPLE LOCAL end pascal strings */
+
if (count > 1 && !objc_string && warn_traditional && !in_system_header)
warning ("traditional C rejects string constant concatenation");
if ((c_lex_string_translate
? cpp_interpret_string : cpp_interpret_string_notranslate)
- (parse_in, strs, count, &istr, wide))
+ /* APPLE LOCAL pascal strings */
+ (parse_in, strs, count, &istr, wide, pascal_p))
{
value = build_string (istr.len, (char *)istr.text);
free ((void *)istr.text);
@@ -715,7 +748,11 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
value = build_string (1, "");
}
- TREE_TYPE (value) = wide ? wchar_array_type_node : char_array_type_node;
+ /* APPLE LOCAL begin pascal strings */
+ TREE_TYPE (value) = wide ? wchar_array_type_node
+ : pascal_p ? pascal_string_type_node
+ : char_array_type_node;
+ /* APPLE LOCAL end pascal strings */
*valp = fix_string_type (value);
if (strs != &str)
@@ -755,3 +792,17 @@ lex_charconst (const cpp_token *token)
TREE_TYPE (value) = type;
return value;
}
+
+/* APPLE LOCAL begin Symbol Separation */
+
+/* Write context information in .cinfo file.
+ Use PCH routines directly. But set and restore cinfo_state before using them. */
+void
+c_common_write_context (void)
+{
+ /* MERGE FIXME: This used to say 'lineno', not '0', but now we don't
+ have a 'lineno' variable (and it was probably always wrong). */
+ (*debug_hooks->end_symbol_repository) (0);
+ cpp_write_symbol_deps (parse_in);
+}
+/* APPLE LOCAL end Symbol Separation */