Added negative test case so that we can be sure we handle erroneous situations
while parsing the .cpsetup directive.
Details
Diff Detail
Event Timeline
LGTM with one nit about the placement of TmpReg.clear()
You can also use unique_ptr to avoid the manual delete statements if you want to.
lib/Target/Mips/AsmParser/MipsAsmParser.cpp | ||
---|---|---|
2326 | It's probably best to use std::unique_ptr so you don't have to manually delete the object. | |
2340 | Move this up to the 'delete FuncRegOpnd' |
Use of std::unique_ptr to avoid having to manually delete the MipsOperands created while
parsing the directive.
I know you LGTM'd this already but I made the change you suggested (use of std::unique_ptr). Do you want to skim read this patch again just to make sure I implemented exactly what you suggested ?
Matheus
The unique_ptr would be better as part of the 'SmallVector<MCParsedAsmOperand *, 1> TmpReg'. At the moment, there are two pointers to TmpReg[0] so it's not really unique.
It's probably best to use std::unique_ptr so you don't have to manually delete the object.