[cfe-commits] r70443 - /cfe/trunk/include/clang/Parse/Ownership.h

Douglas Gregor dgregor at apple.com
Wed Apr 29 16:37:35 PDT 2009


Author: dgregor
Date: Wed Apr 29 18:37:31 2009
New Revision: 70443

URL: http://llvm.org/viewvc/llvm-project?rev=70443&view=rev
Log:
Make DISABLE_SMART_POINTERS work, again

Modified:
    cfe/trunk/include/clang/Parse/Ownership.h

Modified: cfe/trunk/include/clang/Parse/Ownership.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Ownership.h?rev=70443&r1=70442&r2=70443&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Ownership.h (original)
+++ cfe/trunk/include/clang/Parse/Ownership.h Wed Apr 29 18:37:31 2009
@@ -379,6 +379,12 @@
       return Node;
     }
 
+    /// Take outside ownership of the raw pointer and cast it down.
+    template<typename T>
+    T *takeAs() {
+      return static_cast<T*>(Node);
+    }
+
     /// Alias for interface familiarity with unique_ptr.
     void * release() {
       return take();
@@ -698,8 +704,9 @@
     unsigned size() const { return Count; }
 
     void reset(void **args, bool *argIsType, unsigned count) {
+#if !defined(DISABLE_SMART_POINTERS)
       destroy();
-
+#endif
       Args = args;
       ArgIsType = argIsType;
       Count = count;





More information about the cfe-commits mailing list