AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperand
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 8 Jun 2014 16:18:35 +0000 (16:18 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 8 Jun 2014 16:18:35 +0000 (16:18 +0000)
commitc50f986b4d8ecbf3437c67e987e26e268ef5f06a
tree595699717d2ecd1830d24da0ed463a78c5f16ccf
parente570687bd8bff68921a2fa9840ad5aa270a8c9d8
AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperand

I saw at least a memory leak or two from inspection (on probably
untested error paths) and r206991, which was the original inspiration
for this change.

I ran this idea by Jim Grosbach a few weeks ago & he was OK with it.
Since it's a basically mechanical patch that seemed sufficient - usual
post-commit review, revert, etc, as needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210427 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/MC/MCTargetAsmParser.h
lib/MC/MCParser/AsmParser.cpp
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
lib/Target/X86/AsmParser/X86AsmInstrumentation.h
lib/Target/X86/AsmParser/X86AsmParser.cpp
lib/Target/X86/AsmParser/X86Operand.h
utils/TableGen/AsmMatcherEmitter.cpp