Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
e70b123a
Commit
e70b123a
authored
Nov 07, 2005
by
Michael Beck
Browse files
do not access the ld_name field of entities if it's not set, else
a default name is generated [r6876]
parent
26c150fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ir/irargs.c
View file @
e70b123a
...
...
@@ -14,6 +14,8 @@
# include "config.h"
#endif
#ifdef WITH_LIBCORE
#include
"bitset.h"
#include
<ctype.h>
...
...
@@ -84,6 +86,15 @@ static int firm_emit_dbg(lc_appendable_t *app,
return
lc_arg_append
(
app
,
occ
,
buf
,
strlen
(
buf
));
}
/**
* Beware: do not set the entity ld_name
*/
static
const
char
*
get_entity_ld_name_ex
(
entity
*
ent
)
{
if
(
ent
->
ld_name
)
return
get_entity_ld_name
(
ent
);
return
get_entity_name
(
ent
);
}
/**
* emit a Firm object
*/
...
...
@@ -114,7 +125,7 @@ static int firm_emit(lc_appendable_t *app,
break
;
case
k_entity
:
snprintf
(
buf
,
sizeof
(
buf
),
"%s%s"
,
A
(
"ent"
),
isupper
(
occ
->
conversion
)
?
get_entity_ld_name
(
X
)
:
get_entity_name
(
X
));
isupper
(
occ
->
conversion
)
?
get_entity_ld_name
_ex
(
X
)
:
get_entity_name
(
X
));
snprintf
(
add
,
sizeof
(
add
),
"[%ld]"
,
get_entity_nr
(
X
));
break
;
case
k_type
:
...
...
@@ -280,3 +291,5 @@ lc_arg_env_t *firm_get_arg_env(void)
return
env
;
}
#endif
/* WITH_LIBCORE */
ir/ir/irprintf.c
View file @
e70b123a
...
...
@@ -252,6 +252,15 @@ static void dump_with_settings(const appender_t *app, void *object, size_t limit
app
->
append_str
(
object
,
limit
,
str
);
}
/**
* Beware: do not set the entity ld_name
*/
static
const
char
*
get_entity_ld_name_ex
(
entity
*
ent
)
{
if
(
ent
->
ld_name
)
return
get_entity_ld_name
(
ent
);
return
get_entity_name
(
ent
);
}
/**
* emit a Firm object. Backported from irargs.
*/
...
...
@@ -280,7 +289,7 @@ static void firm_emit(char *buf, int buflen, char conversion,
break
;
case
k_entity
:
snprintf
(
buf
,
buflen
,
"%s%s"
,
A
(
"ent"
),
isupper
(
conversion
)
?
get_entity_ld_name
(
X
)
:
get_entity_name
(
X
));
isupper
(
conversion
)
?
get_entity_ld_name
_ex
(
X
)
:
get_entity_name
(
X
));
snprintf
(
add
,
sizeof
(
add
),
"[%ld]"
,
get_entity_nr
(
X
));
break
;
case
k_type
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment