- if (F != stdin)
- fclose(F);
-
- if (Result) { // Check to see that it is valid...
- if (verifyModule(*Result)) {
- delete Result;
- throw ParseException(Filename, "Source file is not well formed LLVM!");
- }
- }
+Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
+ ParseError *Err) {
+ TheParseError = Err;
+ MemoryBuffer *F = MemoryBuffer::getMemBuffer(AsmString,
+ AsmString+strlen(AsmString),
+ "<string>");
+ Module *Result = RunVMAsmParser(F);
+ delete F;