If a class inherits from RefCountedBaseVPTR allow all its subclasses to be used with...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 20 Mar 2011 06:14:56 +0000 (06:14 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 20 Mar 2011 06:14:56 +0000 (06:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127966 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/IntrusiveRefCntPtr.h
include/llvm/CompilerDriver/CompilationGraph.h
include/llvm/CompilerDriver/Tool.h

index 37d4ac9d29df518abaa753357cf406257502fde1..e6926de413a1b10bd7ff4d4b2decbce71610f748 100644 (file)
@@ -64,7 +64,6 @@ namespace llvm {
 ///  inherit from RefCountedBaseVPTR can't be allocated on stack -
 ///  attempting to do this will produce a compile error.
 //===----------------------------------------------------------------------===//
-  template <class Derived>
   class RefCountedBaseVPTR {
     unsigned ref_cnt;
 
@@ -78,7 +77,8 @@ namespace llvm {
       if (--ref_cnt == 0) delete this;
     }
 
-    friend class IntrusiveRefCntPtr<Derived>;
+    template <typename T>
+    friend class IntrusiveRefCntPtr;
   };
 
 //===----------------------------------------------------------------------===//
index e1eea325e34853dab4cc01ecf0133881c539f06d..951aff6f938dffaf6d5312f6566c22a04e9a591b 100644 (file)
@@ -40,7 +40,7 @@ namespace llvmc {
   };
 
   /// Edge - Represents an edge of the compilation graph.
-  class Edge : public llvm::RefCountedBaseVPTR<Edge> {
+  class Edge : public llvm::RefCountedBaseVPTR {
   public:
     Edge(const std::string& T) : ToolName_(T) {}
     virtual ~Edge() {}
index d0926ba98312dd1a63f9f7a04e5e9ee4c7c9819a..18a2b767923ef07526b388ca4893f64e4bc011cf 100644 (file)
@@ -33,7 +33,7 @@ namespace llvmc {
   typedef llvm::StringSet<> InputLanguagesSet;
 
   /// Tool - Represents a single tool.
-  class Tool : public llvm::RefCountedBaseVPTR<Tool> {
+  class Tool : public llvm::RefCountedBaseVPTR {
   public:
 
     virtual ~Tool() {}