- // If we are parsing into an existing module, do it.
- if (M)
- return LLParser(F, SM, Err, M).Run() ? nullptr : M;
-
- // Otherwise create a new module.
- std::unique_ptr<Module> M2(new Module(F->getBufferIdentifier(), Context));
- if (LLParser(F, SM, Err, M2.get()).Run())
+ std::unique_ptr<Module> M =
+ make_unique<Module>(Buf->getBufferIdentifier(), Context);
+ if (LLParser(Buf->getBuffer(), SM, Err, M.get()).Run())