[llvm-commits] [gcc-plugin] r81000 - in /gcc-plugin/trunk: llvm-backend.cpp llvm-cache.c

Duncan Sands baldrick at free.fr
Fri Sep 4 05:29:30 PDT 2009


Author: baldrick
Date: Fri Sep  4 07:29:30 2009
New Revision: 81000

URL: http://llvm.org/viewvc/llvm-project?rev=81000&view=rev
Log:
Register our tree->Value map as a gcc cache tab rather
than an ordinary garbage collection root.  This has the
magic effect that the map no longer gets in the way of
garbage collecting the tree, and if the tree is garbage
collected then the map entry is automagically deleted.

Modified:
    gcc-plugin/trunk/llvm-backend.cpp
    gcc-plugin/trunk/llvm-cache.c

Modified: gcc-plugin/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=81000&r1=80999&r2=81000&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-backend.cpp (original)
+++ gcc-plugin/trunk/llvm-backend.cpp Fri Sep  4 07:29:30 2009
@@ -2080,7 +2080,7 @@
 
 
 // Garbage collector roots.
-extern const struct ggc_root_tab gt_pch_rc__gt_llvm_cache_h[];
+extern const struct ggc_cache_tab gt_ggc_rc__gt_llvm_cache_h[];
 
 
 /// llvm_plugin_info - Information about this plugin.  Users can access this
@@ -2137,8 +2137,8 @@
   TakeoverAsmOutput();
 
   // Register our garbage collector roots.
-  register_callback (plugin_name, PLUGIN_REGISTER_GGC_ROOTS, NULL,
-                     (void *)gt_pch_rc__gt_llvm_cache_h);
+  register_callback (plugin_name, PLUGIN_REGISTER_GGC_CACHES, NULL,
+                     (void *)gt_ggc_rc__gt_llvm_cache_h);
 
   // Perform late initialization just before processing the compilation unit.
   register_callback (plugin_name, PLUGIN_START_UNIT, llvm_start_unit, NULL);

Modified: gcc-plugin/trunk/llvm-cache.c
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-cache.c?rev=81000&r1=80999&r2=81000&view=diff

==============================================================================
--- gcc-plugin/trunk/llvm-cache.c (original)
+++ gcc-plugin/trunk/llvm-cache.c Fri Sep  4 07:29:30 2009
@@ -31,8 +31,6 @@
 // GCC headers
 #include "ggc.h"
 
-#include "stdio.h" //QQ
-
 struct GTY(()) tree_llvm_map {
   struct tree_map_base base;
   const void * GTY((skip)) val;
@@ -42,12 +40,7 @@
 #define tree_llvm_map_hash tree_map_base_hash
 #define tree_llvm_map_marked_p tree_map_base_marked_p
 
-__attribute__((used)) static int debug_tree_llvm_map_marked_p (const void *p) {//QQ
-  printf("debug_ggc call for %p\n", p);
-  return tree_map_base_marked_p(p);
-}
-
-static GTY ((if_marked ("debug_tree_llvm_map_marked_p"),
+static GTY ((if_marked ("tree_llvm_map_marked_p"),
              param_is (struct tree_llvm_map)))
   htab_t llvm_cache;
 





More information about the llvm-commits mailing list