Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
6638be02
Commit
6638be02
authored
Sep 22, 2011
by
Manuel Mohr
Browse files
Added callback mechanism to determine compilerlib function names.
parent
e599bf38
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/libfirm/iroptimize.h
View file @
6638be02
...
...
@@ -1082,6 +1082,29 @@ FIRM_API ir_value_classify_sign classify_value_sign(ir_node *n);
FIRM_API
ir_tarval
*
computed_value_Cmp_Confirm
(
const
ir_node
*
cmp
,
ir_node
*
left
,
ir_node
*
right
,
ir_relation
relation
);
typedef
ir_entity
*
(
*
compilerlib_entity_creator_t
)(
ident
*
id
,
ir_type
*
mt
);
/**
* Set the compilerlib entity creation callback that is used to create
* compilerlib function entities.
*
* @param cb the new compilerlib entity creation callback
*/
FIRM_API
void
set_compilerlib_entity_creator
(
compilerlib_entity_creator_t
c
);
/**
* Get the compilerlib entity creation callback.
*/
FIRM_API
compilerlib_entity_creator_t
get_compilerlib_entity_creator
();
/**
* Construct the entity for a given function using the current compilerlib
* entity creation callback.
*
* @param id the identifier of the compilerlib function
* @param mt the method type of the compilerlib function
*/
FIRM_API
ir_entity
*
create_compilerlib_entity
(
ident
*
id
,
ir_type
*
mt
);
#include
"end.h"
#endif
ir/ir/ircomplib.c
0 → 100644
View file @
6638be02
/*
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* Licensees holding valid libFirm Professional Edition licenses may use
* this file in accordance with the libFirm Commercial License.
* Agreement provided with the Software.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
/**
* @file
* @brief Compilerlib entity creation related functions.
* @date 2011-09-22
* @author Manuel Mohr
* @version $Id$
*/
#include
"config.h"
#include
"irprog.h"
#include
"iroptimize.h"
#include
"typerep.h"
#include
<stddef.h>
#include
<assert.h>
/* The default implementation does not set a different ld name. */
static
ir_entity
*
compilerlib_entity_def_creator
(
ident
*
id
,
ir_type
*
mt
)
{
return
new_entity
(
get_glob_type
(),
id
,
mt
);
}
static
compilerlib_entity_creator_t
creator
=
compilerlib_entity_def_creator
;
void
set_compilerlib_entity_creator
(
compilerlib_entity_creator_t
c
)
{
assert
(
c
!=
NULL
);
creator
=
c
;
}
compilerlib_entity_creator_t
get_compilerlib_entity_creator
()
{
return
creator
;
}
ir_entity
*
create_compilerlib_entity
(
ident
*
id
,
ir_type
*
mt
)
{
return
creator
(
id
,
mt
);
}
ir/lower/lower_copyb.c
View file @
6638be02
...
...
@@ -187,12 +187,10 @@ static ir_node *get_memcpy_symconst(ir_graph *irg)
{
ident
*
id
=
new_id_from_str
(
"memcpy"
);
ir_type
*
mt
=
get_memcpy_methodtype
();
ir_entity
*
ent
=
new_entity
(
get_glob_type
(),
id
,
mt
);
ir_entity
*
ent
=
create_compilerlib_entity
(
id
,
mt
);
symconst_symbol
sym
;
set_entity_ld_ident
(
ent
,
get_entity_ident
(
ent
));
sym
.
entity_p
=
ent
;
return
new_r_SymConst
(
irg
,
mode_P_code
,
sym
,
symconst_addr_ent
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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