[llvm] r216364 - NVPTX: remove another raw delete call
David Blaikie
dblaikie at gmail.com
Mon Aug 25 09:33:24 PDT 2014
On Sun, Aug 24, 2014 at 6:59 PM, Dylan Noblesmith <nobled at dreamwidth.org> wrote:
> Author: nobled
> Date: Sun Aug 24 20:59:32 2014
> New Revision: 216364
>
> URL: http://llvm.org/viewvc/llvm-project?rev=216364&view=rev
> Log:
> NVPTX: remove another raw delete call
>
> Modified:
> llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
>
> Modified: llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp?rev=216364&r1=216363&r2=216364&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp Sun Aug 24 20:59:32 2014
> @@ -1063,7 +1063,7 @@ bool NVPTXAsmPrinter::doFinalization(Mod
>
> Module::GlobalListType &global_list = M.getGlobalList();
> int i, n = global_list.size();
> - GlobalVariable **gv_array = new GlobalVariable *[n];
> + std::vector<GlobalVariable *> gv_array(n);
Another case of vector where you were favoring unique_ptr<T[]> in
other similar cases - in fact this case seems an even easier/better
case for unique_ptr<T[]> because you don't need the raw pointer at
all. Any particular reason to favor vector here?
>
> // first, back-up GlobalVariable in gv_array
> i = 0;
> @@ -1083,8 +1083,6 @@ bool NVPTXAsmPrinter::doFinalization(Mod
> global_list.insert(global_list.end(), gv_array[i]);
>
> clearAnnotationCache(&M);
> -
> - delete[] gv_array;
> return ret;
>
> //bool Result = AsmPrinter::doFinalization(M);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list