Do not require a Context to extract the FunctionIndex from Bitcode (NFC)
[oota-llvm.git] / include / llvm / Bitcode / ReaderWriter.h
index dc039557ae30729da873ce2d40e44f879f124591..1c08ded1656ad8a7f284ec20316760a30d6e8619 100644 (file)
@@ -67,7 +67,7 @@ namespace llvm {
                    DiagnosticHandlerFunction DiagnosticHandler = nullptr);
 
   /// Check if the given bitcode buffer contains a function summary block.
-  bool hasFunctionSummary(MemoryBufferRef Buffer, LLVMContext &Context,
+  bool hasFunctionSummary(MemoryBufferRef Buffer,
                           DiagnosticHandlerFunction DiagnosticHandler);
 
   /// Parse the specified bitcode buffer, returning the function info index.
@@ -77,11 +77,9 @@ namespace llvm {
   /// the index. Otherwise skip the function summary section, and only create
   /// an index object with a map from function name to function summary offset.
   /// The index is used to perform lazy function summary reading later.
-  ErrorOr<std::unique_ptr<FunctionInfoIndex>>
-  getFunctionInfoIndex(MemoryBufferRef Buffer, LLVMContext &Context,
-                       DiagnosticHandlerFunction DiagnosticHandler,
-                       const Module *ExportingModule = nullptr,
-                       bool IsLazy = false);
+  ErrorOr<std::unique_ptr<FunctionInfoIndex>> getFunctionInfoIndex(
+      MemoryBufferRef Buffer, DiagnosticHandlerFunction DiagnosticHandler,
+      const Module *ExportingModule = nullptr, bool IsLazy = false);
 
   /// This method supports lazy reading of function summary data from the
   /// combined index during function importing. When reading the combined index
@@ -89,11 +87,9 @@ namespace llvm {
   /// Then this method is called for each function considered for importing,
   /// to parse the summary information for the given function name into
   /// the index.
-  std::error_code
-  readFunctionSummary(MemoryBufferRef Buffer, LLVMContext &Context,
-                      DiagnosticHandlerFunction DiagnosticHandler,
-                      StringRef FunctionName,
-                      std::unique_ptr<FunctionInfoIndex> Index);
+  std::error_code readFunctionSummary(
+      MemoryBufferRef Buffer, DiagnosticHandlerFunction DiagnosticHandler,
+      StringRef FunctionName, std::unique_ptr<FunctionInfoIndex> Index);
 
   /// \brief Write the specified module to the specified raw output stream.
   ///