diff options
| author | Dan Gohman <gohman@apple.com> | 2008-07-03 00:53:09 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-07-03 00:53:09 +0000 |
| commit | 7722f791f6563ceb21a07cd1b3905533a3bb3d8b (patch) | |
| tree | d13a57c28ebb66b23812b1c00eb5fdaee44102e0 /llvm/lib | |
| parent | f3c4d7f877063573ab19b661a982730302d479f8 (diff) | |
| download | bcm5719-llvm-7722f791f6563ceb21a07cd1b3905533a3bb3d8b.tar.gz bcm5719-llvm-7722f791f6563ceb21a07cd1b3905533a3bb3d8b.zip | |
Use operator new instead of new char[].
llvm-svn: 53066
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Type.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 3a9ea582f11..f1721306885 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -90,7 +90,7 @@ void Type::destroy() const { // 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 @@ FunctionType *FunctionType::get(const Type *ReturnType, 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 @@ StructType *StructType::get(const std::vector<const Type*> &ETypes, 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); |

