From e9703015803e5014e12fedaf9658ab7c966835bf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 23 Dec 2003 20:05:15 +0000 Subject: [PATCH] Minor cleanups, plug a minor memory leak llvm-svn: 10596 --- llvm/lib/AsmParser/ParserInternals.h | 3 +-- llvm/lib/AsmParser/llvmAsmParser.y | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/llvm/lib/AsmParser/ParserInternals.h b/llvm/lib/AsmParser/ParserInternals.h index c18434d1f076..bb248c34ed1a 100644 --- a/llvm/lib/AsmParser/ParserInternals.h +++ b/llvm/lib/AsmParser/ParserInternals.h @@ -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 { diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index 5706b5396eab..8049dc8c6a9c 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -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,