Commit 3ce9f090 by Joseph Myers Committed by Joseph Myers

gcc.c (%[Spec]): Don't document.

	* gcc.c (%[Spec]): Don't document.
	(struct spec_list): Update comment.
	(do_spec_1): Don't handle %[Spec].
	* doc/invoke.texi (%[@var{name}]): Remove documentation of spec.

From-SVN: r175970
parent 41dfca87
2011-07-07 Joseph Myers <joseph@codesourcery.com> 2011-07-07 Joseph Myers <joseph@codesourcery.com>
* gcc.c (%[Spec]): Don't document.
(struct spec_list): Update comment.
(do_spec_1): Don't handle %[Spec].
* doc/invoke.texi (%[@var{name}]): Remove documentation of spec.
2011-07-07 Joseph Myers <joseph@codesourcery.com>
* common/common-target-def.h (TARGET_HAVE_NAMED_SECTIONS): Don't * common/common-target-def.h (TARGET_HAVE_NAMED_SECTIONS): Don't
default based on TARGET_ASM_NAMED_SECTION. default based on TARGET_ASM_NAMED_SECTION.
* common/common-target.def (have_named_sections): Default to true. * common/common-target.def (have_named_sections): Default to true.
......
...@@ -9768,9 +9768,6 @@ Use this when inconsistent options are detected. ...@@ -9768,9 +9768,6 @@ Use this when inconsistent options are detected.
@item %(@var{name}) @item %(@var{name})
Substitute the contents of spec string @var{name} at this point. Substitute the contents of spec string @var{name} at this point.
@item %[@var{name}]
Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
@item %x@{@var{option}@} @item %x@{@var{option}@}
Accumulate an option for @samp{%X}. Accumulate an option for @samp{%X}.
......
...@@ -438,7 +438,6 @@ or with constant text in a single argument. ...@@ -438,7 +438,6 @@ or with constant text in a single argument.
This may be combined with '.', '!', ',', '|', and '*' as above. This may be combined with '.', '!', ',', '|', and '*' as above.
%(Spec) processes a specification defined in a specs file as *Spec: %(Spec) processes a specification defined in a specs file as *Spec:
%[Spec] as above, but put __ around -D arguments
The conditional text X in a %{S:X} or similar construct may contain The conditional text X in a %{S:X} or similar construct may contain
other nested % constructs or spaces, or even newlines. They are other nested % constructs or spaces, or even newlines. They are
...@@ -1149,8 +1148,8 @@ static const char *multilib_dir; ...@@ -1149,8 +1148,8 @@ static const char *multilib_dir;
static const char *multilib_os_dir; static const char *multilib_os_dir;
/* Structure to keep track of the specs that have been defined so far. /* Structure to keep track of the specs that have been defined so far.
These are accessed using %(specname) or %[specname] in a compiler These are accessed using %(specname) in a compiler or link
or link spec. */ spec. */
struct spec_list struct spec_list
{ {
...@@ -5212,11 +5211,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) ...@@ -5212,11 +5211,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
/* Process a string found as the value of a spec given by name. /* Process a string found as the value of a spec given by name.
This feature allows individual machine descriptions This feature allows individual machine descriptions
to add and use their own specs. to add and use their own specs. */
%[...] modifies -D options the way %P does;
%(...) uses the spec unmodified. */
case '[':
warning (0, "use of obsolete %%[ operator in specs");
case '(': case '(':
{ {
const char *name = p; const char *name = p;
...@@ -5225,7 +5220,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) ...@@ -5225,7 +5220,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
/* The string after the S/P is the name of a spec that is to be /* The string after the S/P is the name of a spec that is to be
processed. */ processed. */
while (*p && *p != ')' && *p != ']') while (*p && *p != ')')
p++; p++;
/* See if it's in the list. */ /* See if it's in the list. */
...@@ -5234,63 +5229,20 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) ...@@ -5234,63 +5229,20 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{ {
name = *(sl->ptr_spec); name = *(sl->ptr_spec);
#ifdef DEBUG_SPECS #ifdef DEBUG_SPECS
fnotice (stderr, "Processing spec %c%s%c, which is '%s'\n", fnotice (stderr, "Processing spec (%s), which is '%s'\n",
c, sl->name, (c == '(') ? ')' : ']', name); sl->name, name);
#endif #endif
break; break;
} }
if (sl) if (sl)
{ {
if (c == '(')
{
value = do_spec_1 (name, 0, NULL); value = do_spec_1 (name, 0, NULL);
if (value != 0) if (value != 0)
return value; return value;
} }
else
{
char *x = (char *) alloca (strlen (name) * 2 + 1);
char *buf = x;
const char *y = name;
int flag = 0;
/* Copy all of NAME into BUF, but put __ after
every -D and at the end of each arg. */
while (1)
{
if (! strncmp (y, "-D", 2))
{
*x++ = '-';
*x++ = 'D';
*x++ = '_';
*x++ = '_';
y += 2;
flag = 1;
continue;
}
else if (flag
&& (*y == ' ' || *y == '\t' || *y == '='
|| *y == '}' || *y == 0))
{
*x++ = '_';
*x++ = '_';
flag = 0;
}
if (*y == 0)
break;
else
*x++ = *y++;
}
*x = 0;
value = do_spec_1 (buf, 0, NULL);
if (value != 0)
return value;
}
}
/* Discard the closing paren or bracket. */ /* Discard the closing paren. */
if (*p) if (*p)
p++; p++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment