[llvm-commits] [llvm] r53066 - /llvm/trunk/lib/VMCore/Type.cpp

Dan Gohman gohman at apple.com
Wed Jul 2 17:53:09 PDT 2008


Author: djg
Date: Wed Jul  2 19:53:09 2008
New Revision: 53066

URL: http://llvm.org/viewvc/llvm-project?rev=53066&view=rev
Log:
Use operator new instead of new char[].

Modified:
    llvm/trunk/lib/VMCore/Type.cpp

Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=53066&r1=53065&r2=53066&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Wed Jul  2 19:53:09 2008
@@ -90,7 +90,7 @@
 
     // Finally, remove the memory as an array deallocation of the chars it was
     // constructed from.
-    delete [] reinterpret_cast<const char*>(this); 
+    operator delete(const_cast<Type *>(this));
 
     return;
   }
@@ -1124,8 +1124,8 @@
   if (FT)
     return FT;
 
-  FT = (FunctionType*) new char[sizeof(FunctionType) + 
-                                sizeof(PATypeHandle)*(Params.size()+1)];
+  FT = (FunctionType*) operator new(sizeof(FunctionType) +
+                                    sizeof(PATypeHandle)*(Params.size()+1));
   new (FT) FunctionType(ReturnType, Params, isVarArg);
   FunctionTypes->add(VT, FT);
 
@@ -1266,8 +1266,8 @@
   if (ST) return ST;
 
   // Value not found.  Derive a new type!
-  ST = (StructType*) new char[sizeof(StructType) + 
-                              sizeof(PATypeHandle) * ETypes.size()];
+  ST = (StructType*) operator new(sizeof(StructType) +
+                                  sizeof(PATypeHandle) * ETypes.size());
   new (ST) StructType(ETypes, isPacked);
   StructTypes->add(STV, ST);
 





More information about the llvm-commits mailing list