From b518c25b3e3ec03da389ca48910ded42ca1305e3 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sun, 20 Mar 2011 06:14:56 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/IntrusiveRefCntPtr.h | 4 ++-- include/llvm/CompilerDriver/CompilationGraph.h | 2 +- include/llvm/CompilerDriver/Tool.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/ADT/IntrusiveRefCntPtr.h b/include/llvm/ADT/IntrusiveRefCntPtr.h index 37d4ac9d29d..e6926de413a 100644 --- a/include/llvm/ADT/IntrusiveRefCntPtr.h +++ b/include/llvm/ADT/IntrusiveRefCntPtr.h @@ -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 RefCountedBaseVPTR { unsigned ref_cnt; @@ -78,7 +77,8 @@ namespace llvm { if (--ref_cnt == 0) delete this; } - friend class IntrusiveRefCntPtr; + template + friend class IntrusiveRefCntPtr; }; //===----------------------------------------------------------------------===// diff --git a/include/llvm/CompilerDriver/CompilationGraph.h b/include/llvm/CompilerDriver/CompilationGraph.h index e1eea325e34..951aff6f938 100644 --- a/include/llvm/CompilerDriver/CompilationGraph.h +++ b/include/llvm/CompilerDriver/CompilationGraph.h @@ -40,7 +40,7 @@ namespace llvmc { }; /// Edge - Represents an edge of the compilation graph. - class Edge : public llvm::RefCountedBaseVPTR { + class Edge : public llvm::RefCountedBaseVPTR { public: Edge(const std::string& T) : ToolName_(T) {} virtual ~Edge() {} diff --git a/include/llvm/CompilerDriver/Tool.h b/include/llvm/CompilerDriver/Tool.h index d0926ba9831..18a2b767923 100644 --- a/include/llvm/CompilerDriver/Tool.h +++ b/include/llvm/CompilerDriver/Tool.h @@ -33,7 +33,7 @@ namespace llvmc { typedef llvm::StringSet<> InputLanguagesSet; /// Tool - Represents a single tool. - class Tool : public llvm::RefCountedBaseVPTR { + class Tool : public llvm::RefCountedBaseVPTR { public: virtual ~Tool() {}