r244196 - Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 6 00:28:36 PDT 2015


Author: yrnkrn
Date: Thu Aug  6 02:28:36 2015
New Revision: 244196

URL: http://llvm.org/viewvc/llvm-project?rev=244196&view=rev
Log:
Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.


Modified:
    cfe/trunk/utils/TableGen/NeonEmitter.cpp

Modified: cfe/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/NeonEmitter.cpp?rev=244196&r1=244195&r2=244196&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/NeonEmitter.cpp Thu Aug  6 02:28:36 2015
@@ -532,6 +532,12 @@ public:
     ClassMap[NoTestOpI] = ClassNoTest;
   }
 
+  ~NeonEmitter() {
+    for (auto &P : IntrinsicMap)
+      for (Intrinsic *I : P.second)
+        delete I;
+  }
+
   // run - Emit arm_neon.h.inc
   void run(raw_ostream &o);
 




More information about the cfe-commits mailing list