aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APFloat.cpp
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 /lib/Support/APFloat.cpp
parente7cbb792c95cb27a9704551579da19ebcaa06cdb (diff)
downloadexternal_llvm-abff3aa8217049cffe6da77c91e510c66b8c2313.tar.gz
external_llvm-abff3aa8217049cffe6da77c91e510c66b8c2313.tar.bz2
external_llvm-abff3aa8217049cffe6da77c91e510c66b8c2313.zip
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 'lib/Support/APFloat.cpp')
-rw-r--r--lib/Support/APFloat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 16586fbc9e..2ad66c5687 100644
--- a/lib/Support/APFloat.cpp
+++ b/lib/Support/APFloat.cpp
@@ -580,7 +580,7 @@ APFloat::initialize(const fltSemantics *ourSemantics)
void
APFloat::freeSignificand()
{
- if (partCount() > 1)
+ if (needsCleanup())
delete [] significand.parts;
}