d: Remove another dependency on the front-end OutBuffer type.
As the DMD front-end never frees allocated memory, the glue layer between the DMD front-end and GCC should generally avoid using DMD types and interfaces if the purpose is internal only. gcc/d/ChangeLog: * d-lang.cc (d_parse_file): Replace OutBuffer with obstack.
This commit is contained in:
parent
d103f336bd
commit
e52f5d0786
@ -1032,18 +1032,20 @@ d_parse_file (void)
|
|||||||
message ("binary %s", global.params.argv0.ptr);
|
message ("binary %s", global.params.argv0.ptr);
|
||||||
message ("version %s", global.version.ptr);
|
message ("version %s", global.version.ptr);
|
||||||
|
|
||||||
if (global.params.versionids)
|
if (global.versionids)
|
||||||
{
|
{
|
||||||
OutBuffer buf;
|
obstack buffer;
|
||||||
buf.writestring ("predefs ");
|
gcc_obstack_init (&buffer);
|
||||||
for (size_t i = 0; i < global.params.versionids->length; i++)
|
obstack_grow (&buffer, "predefs ", 9);
|
||||||
|
for (size_t i = 0; i < global.versionids->length; i++)
|
||||||
{
|
{
|
||||||
const char *s = (*global.params.versionids)[i];
|
Identifier *id = (*global.versionids)[i];
|
||||||
buf.writestring (" ");
|
const char *str = id->toChars ();
|
||||||
buf.writestring (s);
|
obstack_1grow (&buffer, ' ');
|
||||||
|
obstack_grow (&buffer, str, strlen (str));
|
||||||
}
|
}
|
||||||
|
|
||||||
message ("%s", buf.peekChars ());
|
message ("%s", (char *) obstack_finish (&buffer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user