summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/User.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/User.cpp')
-rw-r--r--llvm/lib/IR/User.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/IR/User.cpp b/llvm/lib/IR/User.cpp
index ee83eacf2b2..4dae071185f 100644
--- a/llvm/lib/IR/User.cpp
+++ b/llvm/lib/IR/User.cpp
@@ -13,6 +13,7 @@
#include "llvm/IR/Operator.h"
namespace llvm {
+class BasicBlock;
//===----------------------------------------------------------------------===//
// User Class
@@ -39,10 +40,12 @@ void User::replaceUsesOfWith(Value *From, Value *To) {
// User allocHungoffUses Implementation
//===----------------------------------------------------------------------===//
-Use *User::allocHungoffUses(unsigned N) const {
+Use *User::allocHungoffUses(unsigned N, bool IsPhi) const {
// Allocate the array of Uses, followed by a pointer (with bottom bit set) to
// the User.
size_t size = N * sizeof(Use) + sizeof(Use::UserRef);
+ if (IsPhi)
+ size += N * sizeof(BasicBlock *);
Use *Begin = static_cast<Use*>(::operator new(size));
Use *End = Begin + N;
(void) new(End) Use::UserRef(const_cast<User*>(this), 1);
OpenPOWER on IntegriCloud