Updated playground
This commit is contained in:
parent
7ef422b824
commit
08272b175a
@ -6,3 +6,7 @@ make all-target-libstdc++-v3 -j8
|
|||||||
./gcc/xg++ -B./gcc/ -shared -fPIC -fno-rtti -I ../gcc/include -I ../gcc/gcc plugin.cpp -I ./gcc -I ./x86_64-pc-linux-gnu/libstdc++-v3/include -I ./x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I ../gcc/libstdc++-v3/include -I ../gcc/libstdc++-v3/libsupc++ -I ../gcc/libcpp/include -L ./x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -o myplugin.so
|
./gcc/xg++ -B./gcc/ -shared -fPIC -fno-rtti -I ../gcc/include -I ../gcc/gcc plugin.cpp -I ./gcc -I ./x86_64-pc-linux-gnu/libstdc++-v3/include -I ./x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I ../gcc/libstdc++-v3/include -I ../gcc/libstdc++-v3/libsupc++ -I ../gcc/libcpp/include -L ./x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -o myplugin.so
|
||||||
|
|
||||||
./gcc/xgcc -B./gcc -fplugin=./myplugin.so -fdump-tree-original test.c -o test
|
./gcc/xgcc -B./gcc -fplugin=./myplugin.so -fdump-tree-original test.c -o test
|
||||||
|
|
||||||
|
git log
|
||||||
|
git format-patch -1 <hash>
|
||||||
|
python3 contrib/check_GNU_style.py gcc_component_ref.patch
|
||||||
|
|||||||
@ -19,9 +19,6 @@
|
|||||||
#include <builtins.h>
|
#include <builtins.h>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
typedef tree (*c_component_ref_hook_fn) (tree ref);
|
|
||||||
extern "C" void c_register_component_ref_hook (c_component_ref_hook_fn hook);
|
|
||||||
|
|
||||||
int plugin_is_GPL_compatible;
|
int plugin_is_GPL_compatible;
|
||||||
|
|
||||||
struct MemberOffset {
|
struct MemberOffset {
|
||||||
@ -264,15 +261,23 @@ static tree my_component_ref_cb (tree ref)
|
|||||||
return new_ref; // ALWAYS an INDIRECT_REF, directly to the member (same type as COMPONENT_REF!)
|
return new_ref; // ALWAYS an INDIRECT_REF, directly to the member (same type as COMPONENT_REF!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void build_component_ref_cb(void* event_data, void* user_data) {
|
||||||
|
tree* component_ref_node = (tree*)event_data;
|
||||||
|
if (!component_ref_node)
|
||||||
|
return;
|
||||||
|
|
||||||
|
tree repl = my_component_ref_cb(*component_ref_node);
|
||||||
|
if (repl)
|
||||||
|
*component_ref_node = repl;
|
||||||
|
}
|
||||||
|
|
||||||
int plugin_init (struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) {
|
int plugin_init (struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) {
|
||||||
if (!plugin_default_version_check(version, &gcc_version)) {
|
if (!plugin_default_version_check(version, &gcc_version)) {
|
||||||
std::cerr << "GCC version mismatch!" << std::endl;
|
std::cerr << "GCC version mismatch!" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
c_register_component_ref_hook(my_component_ref_cb);
|
register_callback(plugin_info->base_name, PLUGIN_BUILD_COMPONENT_REF, build_component_ref_cb, NULL);
|
||||||
|
|
||||||
// register_callback(plugin_info->base_name, PLUGIN_ATTRIBUTES, register_attributes, NULL);
|
|
||||||
|
|
||||||
struct register_pass_info access_discover_pass_info;
|
struct register_pass_info access_discover_pass_info;
|
||||||
access_discover_pass_info.pass = new access_discover_pass(nullptr);
|
access_discover_pass_info.pass = new access_discover_pass(nullptr);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user