diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-29 23:37:31 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-29 23:37:31 +0000 |
commit | e06600c5cf184775d2161a4f7b5557a0d13c8653 (patch) | |
tree | 28019526c589f4373ea64e0d8b3463996e5fd6a6 | |
parent | 9cd6f0f58570a98a6d6acee8803c73986c6846b4 (diff) |
Make DISABLE_SMART_POINTERS work, again
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70443 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Parse/Ownership.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/Parse/Ownership.h b/include/clang/Parse/Ownership.h index 652fc46505..54c04c2c4d 100644 --- a/include/clang/Parse/Ownership.h +++ b/include/clang/Parse/Ownership.h @@ -379,6 +379,12 @@ namespace clang { 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 @@ namespace clang { 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; |