Minor cleanups, plug a minor memory leak
authorChris Lattner <sabre@nondot.org>
Tue, 23 Dec 2003 20:05:15 +0000 (20:05 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 23 Dec 2003 20:05:15 +0000 (20:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10596 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/ParserInternals.h
lib/AsmParser/llvmAsmParser.y

index c18434d1f0767683e8d19ea25cf0e7eaec4f8db8..bb248c34ed1ac5dde74bf815a126446f2e6297a4 100644 (file)
@@ -67,8 +67,7 @@ static inline void ThrowException(const std::string &message,
 // discriminated union.
 //
 // Note that I can't implement this class in a straight forward manner with 
-// constructors and stuff because it goes in a union, and GCC doesn't like 
-// putting classes with ctor's in unions.  :(
+// constructors and stuff because it goes in a union.
 //
 struct ValID {
   enum {
index 5706b5396eab8591a7c90409c73b81abbe67f255..8049dc8c6a9c22cc7eeabe5c56a615fd00e61fed 100644 (file)
@@ -1122,10 +1122,8 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
     
       if (I != CurModule.GlobalRefs.end()) {
        V = I->second;             // Placeholder already exists, use it...
+        $2.destroy();
       } else {
-       // TODO: Include line number info by creating a subclass of
-       // TODO: GlobalVariable here that includes the said information!
-       
        // Create a placeholder for the global variable reference...
        GlobalVariable *GV = new GlobalVariable(PT->getElementType(),
                                                 false,