From bdd69736718d1e01d4c83e9ff14a21c472007fce Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 22 Apr 2015 05:27:11 +0000 Subject: [PATCH] [TableGen] Remove some deletes that violate ownership semantics. These don't seem to execute in our codebase today and date back to a time when there was an allocation in this function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235481 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/Record.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index c032bc19251..ba3f7235536 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -404,12 +404,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { ++i) { RecordRecTy *SuperRecTy1 = RecordRecTy::get(*i); RecTy *NewType1 = resolveTypes(SuperRecTy1, T2); - if (NewType1) { - if (NewType1 != SuperRecTy1) { - delete SuperRecTy1; - } + if (NewType1) return NewType1; - } } } if (RecordRecTy *RecTy2 = dyn_cast(T2)) { @@ -422,12 +418,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { ++i) { RecordRecTy *SuperRecTy2 = RecordRecTy::get(*i); RecTy *NewType2 = resolveTypes(T1, SuperRecTy2); - if (NewType2) { - if (NewType2 != SuperRecTy2) { - delete SuperRecTy2; - } + if (NewType2) return NewType2; - } } } return nullptr;