mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
If a class inherits from RefCountedBaseVPTR allow all its subclasses to be used with IntrusiveRefCntPtr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -64,7 +64,6 @@ namespace llvm {
|
|||||||
/// inherit from RefCountedBaseVPTR can't be allocated on stack -
|
/// inherit from RefCountedBaseVPTR can't be allocated on stack -
|
||||||
/// attempting to do this will produce a compile error.
|
/// attempting to do this will produce a compile error.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
template <class Derived>
|
|
||||||
class RefCountedBaseVPTR {
|
class RefCountedBaseVPTR {
|
||||||
unsigned ref_cnt;
|
unsigned ref_cnt;
|
||||||
|
|
||||||
@ -78,7 +77,8 @@ namespace llvm {
|
|||||||
if (--ref_cnt == 0) delete this;
|
if (--ref_cnt == 0) delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend class IntrusiveRefCntPtr<Derived>;
|
template <typename T>
|
||||||
|
friend class IntrusiveRefCntPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -40,7 +40,7 @@ namespace llvmc {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Edge - Represents an edge of the compilation graph.
|
/// Edge - Represents an edge of the compilation graph.
|
||||||
class Edge : public llvm::RefCountedBaseVPTR<Edge> {
|
class Edge : public llvm::RefCountedBaseVPTR {
|
||||||
public:
|
public:
|
||||||
Edge(const std::string& T) : ToolName_(T) {}
|
Edge(const std::string& T) : ToolName_(T) {}
|
||||||
virtual ~Edge() {}
|
virtual ~Edge() {}
|
||||||
|
@ -33,7 +33,7 @@ namespace llvmc {
|
|||||||
typedef llvm::StringSet<> InputLanguagesSet;
|
typedef llvm::StringSet<> InputLanguagesSet;
|
||||||
|
|
||||||
/// Tool - Represents a single tool.
|
/// Tool - Represents a single tool.
|
||||||
class Tool : public llvm::RefCountedBaseVPTR<Tool> {
|
class Tool : public llvm::RefCountedBaseVPTR {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~Tool() {}
|
virtual ~Tool() {}
|
||||||
|
Reference in New Issue
Block a user