aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/APFloat.h
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-06-03 13:03:05 +0000
committerManuel Klimek <klimek@google.com>2013-06-03 13:03:05 +0000
commitabff3aa8217049cffe6da77c91e510c66b8c2313 (patch)
treebb733eb4d9b3fd6799811554fad43be8add63741 /include/llvm/ADT/APFloat.h
parente7cbb792c95cb27a9704551579da19ebcaa06cdb (diff)
downloadexternal_llvm-abff3aa8217049cffe6da77c91e510c66b8c2313.zip
external_llvm-abff3aa8217049cffe6da77c91e510c66b8c2313.tar.gz
external_llvm-abff3aa8217049cffe6da77c91e510c66b8c2313.tar.bz2
Introduce needsCleanup() for APFloat and APInt.
This is needed in clang so one can check if the object needs the destructor called after its memory was freed. This is useful when creating many APInt/APFloat objects with placement new, where the overhead of tracking the pointers for cleanup is significant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/APFloat.h')
-rw-r--r--include/llvm/ADT/APFloat.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/ADT/APFloat.h b/include/llvm/ADT/APFloat.h
index 64e56a0..33f997e 100644
--- a/include/llvm/ADT/APFloat.h
+++ b/include/llvm/ADT/APFloat.h
@@ -201,6 +201,9 @@ public:
/// @}
+ /// \brief Returns whether this instance allocated memory.
+ bool needsCleanup() const { return partCount() > 1; }
+
/// \name Convenience "constructors"
/// @{