[llvm] r223866 - Extend some comments around GCModuleInfo, GCFunctionInfo, & GCStrategy

Philip Reames listmail at philipreames.com
Tue Dec 9 16:30:11 PST 2014


Author: reames
Date: Tue Dec  9 18:30:11 2014
New Revision: 223866

URL: http://llvm.org/viewvc/llvm-project?rev=223866&view=rev
Log:
Extend some comments around GCModuleInfo, GCFunctionInfo, & GCStrategy

Nothing particularly interesting here, just documenting the way the code currently works before I start changing it...


Modified:
    llvm/trunk/include/llvm/CodeGen/GCMetadata.h
    llvm/trunk/include/llvm/CodeGen/GCStrategy.h

Modified: llvm/trunk/include/llvm/CodeGen/GCMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/GCMetadata.h?rev=223866&r1=223865&r2=223866&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/GCMetadata.h (original)
+++ llvm/trunk/include/llvm/CodeGen/GCMetadata.h Tue Dec  9 18:30:11 2014
@@ -80,8 +80,8 @@ namespace llvm {
   };
 
 
-  /// GCFunctionInfo - Garbage collection metadata for a single function.
-  ///
+  /// Garbage collection metadata for a single function.  Currently, this
+  /// information only applies to GCStrategies which use GCRoot.
   class GCFunctionInfo {
   public:
     typedef std::vector<GCPoint>::iterator iterator;
@@ -161,8 +161,9 @@ namespace llvm {
   };
 
 
-  /// GCModuleInfo - Garbage collection metadata for a whole module.
-  ///
+  /// An analysis pass which caches information about the entire Module.
+  /// Records both the function level information used by GCRoots and a
+  /// cache of the 'active' gc strategy objects for the current Module.
   class GCModuleInfo : public ImmutablePass {
     typedef StringMap<GCStrategy*> strategy_map_type;
     typedef std::vector<std::unique_ptr<GCStrategy>> list_type;

Modified: llvm/trunk/include/llvm/CodeGen/GCStrategy.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/GCStrategy.h?rev=223866&r1=223865&r2=223866&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/GCStrategy.h (original)
+++ llvm/trunk/include/llvm/CodeGen/GCStrategy.h Tue Dec  9 18:30:11 2014
@@ -51,7 +51,9 @@ namespace llvm {
   
   /// GCStrategy describes a garbage collector algorithm's code generation
   /// requirements, and provides overridable hooks for those needs which cannot
-  /// be abstractly described.
+  /// be abstractly described.  GCStrategy objects currently must be looked up
+  /// through the GCModuleInfo analysis pass.  They are owned by the analysis
+  /// pass and recreated every time that pass is invalidated.
   class GCStrategy {
   public:
     typedef std::vector<std::unique_ptr<GCFunctionInfo>> list_type;





More information about the llvm-commits mailing list