If a class inherits from RefCountedBaseVPTR allow all its subclasses to be used with IntrusiveRefCntPtr.

llvm-svn: 127966
This commit is contained in:
Argyrios Kyrtzidis 2011-03-20 06:14:56 +00:00
parent 6bc47435a9
commit f906dcc618
3 changed files with 4 additions and 4 deletions

View 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;
};
//===----------------------------------------------------------------------===//

View 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() {}

View 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() {}