summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2019-04-22 08:37:18 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2019-05-17 21:48:36 +0200
commit1ed78094f8837ad0171242c47e42cb61c9cc470d (patch)
tree2e487e0f346c053b7e73733a098b69f6103abc8c
parent9baf218f724afde6f6ec76b2968b171ef73b9dd6 (diff)
Use make_string().
-rw-r--r--src/firm/ast2firm.c5
-rw-r--r--src/parser/preprocessor.c6
2 files changed, 4 insertions, 7 deletions
diff --git a/src/firm/ast2firm.c b/src/firm/ast2firm.c
index d678108..c940ec2 100644
--- a/src/firm/ast2firm.c
+++ b/src/firm/ast2firm.c
@@ -35,6 +35,7 @@
#include "jump_target.h"
#include "mangle.h"
#include "parser/parser.h"
+#include "parser/preprocessor.h"
typedef struct complex_value {
ir_node *real;
@@ -2154,9 +2155,7 @@ static ir_node *select_to_firm(const select_expression_t *expression)
static ir_node *make_name(funcname_expression_t const *const expr, char const *const name)
{
- begin_string_construction();
- obstack_grow(&string_obst, name, strlen(name));
- string_t *const string = finish_string_construction(STRING_ENCODING_CHAR);
+ string_t *const string = make_string(name);
return string_to_firm(&expr->base.pos, string);
}
diff --git a/src/parser/preprocessor.c b/src/parser/preprocessor.c
index 45fc35d..3a2ec3c 100644
--- a/src/parser/preprocessor.c
+++ b/src/parser/preprocessor.c
@@ -278,10 +278,8 @@ static void switch_input(input_t *const decoder, char const *const input_name,
void switch_pp_input(FILE *const stream, char const *const input_name, searchpath_entry_t *const path, bool const is_system_header)
{
- input_t *const input = input_from_stream(stream, input_decoder);
- begin_string_construction();
- obstack_grow(&string_obst, input_name, strlen(input_name));
- const string_t *string = finish_string_construction(STRING_ENCODING_CHAR);
+ input_t *const input = input_from_stream(stream, input_decoder);
+ string_t const *const string = make_string(input_name);
switch_input(input, string->begin, path, is_system_header);
}