aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-03 00:53:09 +0000
committerDan Gohman <gohman@apple.com>2008-07-03 00:53:09 +0000
commit8de552d6f34393f219a120055a6ce388281efa91 (patch)
tree70d8b273c6cf0b3208717e3ef2e9d418bd102f11
parent9b44c1f2a0ebe31e670994cfe131c7c3e0e80494 (diff)
Use operator new instead of new char[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53066 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Type.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 3a9ea582f1..f172130688 100644
--- a/lib/VMCore/Type.cpp
+++ b/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);