- std::string ErrorStr;
- OwningPtr<MemoryBuffer>
- F(MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr));
- if (F == 0) {
- Err.setError("Could not open input file '" + Filename + "'");
- return 0;
- }
-
- OwningPtr<Module> M(new Module(Filename, Context));
- if (LLParser(F.get(), Err, M.get()).Run())
- return 0;
- return M.take();
-}
-
-Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
- ParseError &Err, LLVMContext* Context) {
- Err.setFilename("<string>");
-
- OwningPtr<MemoryBuffer>
- F(MemoryBuffer::getMemBuffer(AsmString, AsmString+strlen(AsmString),
- "<string>"));
-