[llvm] r305255 - [IR] Remove override of operator new from PHINode.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 17:00:20 PDT 2017


Author: ctopper
Date: Mon Jun 12 19:00:19 2017
New Revision: 305255

URL: http://llvm.org/viewvc/llvm-project?rev=305255&view=rev
Log:
[IR] Remove override of operator new from PHINode.

This just forwarded to the same signature in User. The version in User is protected so there's no danger of anyone outside of PHINode constructing with the wrong operator new. All PHINodes are created by a static Create function in PHINode.

I believe at one point in history this called User::operator new(s, 0) so it was useful then.

Modified:
    llvm/trunk/include/llvm/IR/Instructions.h

Modified: llvm/trunk/include/llvm/IR/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Instructions.h?rev=305255&r1=305254&r2=305255&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Instructions.h (original)
+++ llvm/trunk/include/llvm/IR/Instructions.h Mon Jun 12 19:00:19 2017
@@ -2584,11 +2584,6 @@ class PHINode : public Instruction {
     allocHungoffUses(ReservedSpace);
   }
 
-  // allocate space for exactly zero operands
-  void *operator new(size_t s) {
-    return User::operator new(s);
-  }
-
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;




More information about the llvm-commits mailing list