Avoid leak when parsing fails and BasicBlock has no use/function.
Associate BasicBlocks with the function being parsed to avoid leaks in the case of parse failures. Associating with the function means that we can no longer determine if defined/fwd declared simply by considering if a BasicBlock has an associated function, so track forward declared block references explicitly (this should also allow flagging multiple undeclared fwd references). Split out getting the named block from defining it, in the case of definition move the block to the end of the function. Also destroy all forward reference placeholders in FunctionParser. Return parse failure in parseAttributeDict if there is no left brace instead of asserting. PiperOrigin-RevId: 217049507
Loading
Please sign in to comment