[Orc] Add sensible defaults for the ObjectLinkingLayer constructor.
[oota-llvm.git] / include / llvm / AsmParser / Parser.h
index ab440cc47c77118d415d3583fb2d1352c3561660..7ef78d73da1750ddef8d34f184cddc7e70d8a483 100644 (file)
 #ifndef LLVM_ASMPARSER_PARSER_H
 #define LLVM_ASMPARSER_PARSER_H
 
-#include "llvm/ADT/StringRef.h"
-#include <memory>
+#include "llvm/Support/MemoryBuffer.h"
 
 namespace llvm {
 
 class Module;
-class MemoryBuffer;
 class SMDiagnostic;
 class LLVMContext;
 
@@ -50,14 +48,24 @@ std::unique_ptr<Module> parseAssemblyString(StringRef AsmString,
                                             SMDiagnostic &Error,
                                             LLVMContext &Context);
 
-/// This function is the low-level interface to the LLVM Assembly Parser.
-/// ParseAssemblyFile and ParseAssemblyString are wrappers around this function.
+/// parseAssemblyFile and parseAssemblyString are wrappers around this function.
 /// @brief Parse LLVM Assembly from a MemoryBuffer.
 /// @param F The MemoryBuffer containing assembly
 /// @param Err Error result info.
 /// @param Context Context in which to allocate globals info.
-std::unique_ptr<Module> parseAssembly(std::unique_ptr<MemoryBuffer> F,
-                                      SMDiagnostic &Err, LLVMContext &Context);
+std::unique_ptr<Module> parseAssembly(MemoryBufferRef F, SMDiagnostic &Err,
+                                      LLVMContext &Context);
+
+/// This function is the low-level interface to the LLVM Assembly Parser.
+/// This is kept as an independent function instead of being inlined into
+/// parseAssembly for the convenience of interactive users that want to add
+/// recently parsed bits to an existing module.
+///
+/// @param F The MemoryBuffer containing assembly
+/// @param M The module to add data to.
+/// @param Err Error result info.
+/// @return true on error.
+bool parseAssemblyInto(MemoryBufferRef F, Module &M, SMDiagnostic &Err);
 
 } // End llvm namespace