[llvm-commits] [llvm] r127966 - in /llvm/trunk/include/llvm: ADT/IntrusiveRefCntPtr.h CompilerDriver/CompilationGraph.h CompilerDriver/Tool.h
Argyrios Kyrtzidis
akyrtzi at gmail.com
Sat Mar 19 23:14:56 PDT 2011
Author: akirtzidis
Date: Sun Mar 20 01:14:56 2011
New Revision: 127966
URL: http://llvm.org/viewvc/llvm-project?rev=127966&view=rev
Log:
If a class inherits from RefCountedBaseVPTR allow all its subclasses to be used with IntrusiveRefCntPtr.
Modified:
llvm/trunk/include/llvm/ADT/IntrusiveRefCntPtr.h
llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h
llvm/trunk/include/llvm/CompilerDriver/Tool.h
Modified: llvm/trunk/include/llvm/ADT/IntrusiveRefCntPtr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/IntrusiveRefCntPtr.h?rev=127966&r1=127965&r2=127966&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/IntrusiveRefCntPtr.h (original)
+++ llvm/trunk/include/llvm/ADT/IntrusiveRefCntPtr.h Sun Mar 20 01:14:56 2011
@@ -64,7 +64,6 @@
/// 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 @@
if (--ref_cnt == 0) delete this;
}
- friend class IntrusiveRefCntPtr<Derived>;
+ template <typename T>
+ friend class IntrusiveRefCntPtr;
};
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h?rev=127966&r1=127965&r2=127966&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h (original)
+++ llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h Sun Mar 20 01:14:56 2011
@@ -40,7 +40,7 @@
};
/// 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() {}
Modified: llvm/trunk/include/llvm/CompilerDriver/Tool.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CompilerDriver/Tool.h?rev=127966&r1=127965&r2=127966&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CompilerDriver/Tool.h (original)
+++ llvm/trunk/include/llvm/CompilerDriver/Tool.h Sun Mar 20 01:14:56 2011
@@ -33,7 +33,7 @@
typedef llvm::StringSet<> InputLanguagesSet;
/// Tool - Represents a single tool.
- class Tool : public llvm::RefCountedBaseVPTR<Tool> {
+ class Tool : public llvm::RefCountedBaseVPTR {
public:
virtual ~Tool() {}
More information about the llvm-commits
mailing list