LLVMContext &Context,
std::string *ErrMsg = nullptr);
- /// getBitcodeTargetTriple - Read the header of the specified bitcode
- /// buffer and extract just the triple information. If successful,
- /// this returns a string and *does not* take ownership
- /// of 'buffer'. On error, this returns "", and fills in *ErrMsg
- /// if ErrMsg is non-null.
+ /// Read the header of the specified bitcode buffer and extract just the
+ /// triple information. If successful, this returns a string and *does not*
+ /// take ownership of 'buffer'. On error, this returns "".
std::string getBitcodeTargetTriple(MemoryBuffer *Buffer,
- LLVMContext &Context,
- std::string *ErrMsg = nullptr);
+ LLVMContext &Context);
/// Read the specified bitcode file, returning the module.
/// This method *never* takes ownership of Buffer.
}
std::string llvm::getBitcodeTargetTriple(MemoryBuffer *Buffer,
- LLVMContext& Context,
- std::string *ErrMsg) {
+ LLVMContext &Context) {
BitcodeReader *R = new BitcodeReader(Buffer, Context);
std::string Triple("");
- if (std::error_code EC = R->ParseTriple(Triple))
- if (ErrMsg)
- *ErrMsg = EC.message();
+ R->ParseTriple(Triple);
R->releaseBuffer();
delete R;