Add a method to the BitcodeReader to parse only the identification block
[oota-llvm.git] / include / llvm / Bitcode / ReaderWriter.h
index 5f1c7200468c5818175f9af229154314b14aa7f2..dc039557ae30729da873ce2d40e44f879f124591 100644 (file)
@@ -54,6 +54,13 @@ namespace llvm {
   getBitcodeTargetTriple(MemoryBufferRef Buffer, LLVMContext &Context,
                          DiagnosticHandlerFunction DiagnosticHandler = nullptr);
 
+  /// Read the header of the specified bitcode buffer and extract just the
+  /// producer string information. If successful, this returns a string. On
+  /// error, this returns "".
+  std::string getBitcodeProducerString(
+      MemoryBufferRef Buffer, LLVMContext &Context,
+      DiagnosticHandlerFunction DiagnosticHandler = nullptr);
+
   /// Read the specified bitcode file, returning the module.
   ErrorOr<std::unique_ptr<Module>>
   parseBitcodeFile(MemoryBufferRef Buffer, LLVMContext &Context,