summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd0cf5b2de355cb5ec6ec90a7057f60a4d2a10169 (patch)
tree0581e56a7d4225f3ab3d1f21acc608dcfbc81b9d /llvm/lib/Support/APFloat.cpp
parent17ee1abfa7a093fea959037f668e8bb8c67c5f19 (diff)
downloadbcm5719-llvm-d0cf5b2de355cb5ec6ec90a7057f60a4d2a10169.tar.gz
bcm5719-llvm-d0cf5b2de355cb5ec6ec90a7057f60a4d2a10169.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. llvm-svn: 183100
Diffstat (limited to 'llvm/lib/Support/APFloat.cpp')
-rw-r--r--llvm/lib/Support/APFloat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index 16586fbc9e8..2ad66c5687c 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -580,7 +580,7 @@ APFloat::initialize(const fltSemantics *ourSemantics)
void
APFloat::freeSignificand()
{
- if (partCount() > 1)
+ if (needsCleanup())
delete [] significand.parts;
}
OpenPOWER on IntegriCloud